@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $path = basename($fullPath); |
| 111 | 111 | |
| 112 | 112 | if ($normalizedPath !== $path) { |
| 113 | - $output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>'); |
|
| 113 | + $output->writeln("\t<error>Entry \"".$fullPath.'" will not be accessible due to incompatible encoding</error>'); |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
@@ -120,42 +120,42 @@ discard block |
||
| 120 | 120 | # check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception |
| 121 | 121 | # printout and count |
| 122 | 122 | if ($verbose) { |
| 123 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
| 123 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
| 124 | 124 | $output->writeln("\tFile <info>$path</info>"); |
| 125 | 125 | $this->filesCounter += 1; |
| 126 | 126 | if ($this->hasBeenInterrupted()) { |
| 127 | 127 | throw new InterruptedException(); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
| 130 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
| 131 | 131 | $output->writeln("\tFolder <info>$path</info>"); |
| 132 | 132 | $this->foldersCounter += 1; |
| 133 | 133 | if ($this->hasBeenInterrupted()) { |
| 134 | 134 | throw new InterruptedException(); |
| 135 | 135 | } |
| 136 | 136 | }); |
| 137 | - $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { |
|
| 138 | - $output->writeln("Error while scanning, storage not available (" . $e->getMessage() . ")"); |
|
| 137 | + $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function(StorageNotAvailableException $e) use ($output) { |
|
| 138 | + $output->writeln("Error while scanning, storage not available (".$e->getMessage().")"); |
|
| 139 | 139 | }); |
| 140 | 140 | # count only |
| 141 | 141 | } else { |
| 142 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function () use ($output) { |
|
| 142 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function() use ($output) { |
|
| 143 | 143 | $this->filesCounter += 1; |
| 144 | 144 | if ($this->hasBeenInterrupted()) { |
| 145 | 145 | throw new InterruptedException(); |
| 146 | 146 | } |
| 147 | 147 | }); |
| 148 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function () use ($output) { |
|
| 148 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function() use ($output) { |
|
| 149 | 149 | $this->foldersCounter += 1; |
| 150 | 150 | if ($this->hasBeenInterrupted()) { |
| 151 | 151 | throw new InterruptedException(); |
| 152 | 152 | } |
| 153 | 153 | }); |
| 154 | 154 | } |
| 155 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
| 155 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
| 156 | 156 | $this->checkScanWarning($path, $output); |
| 157 | 157 | }); |
| 158 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
| 158 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
| 159 | 159 | $this->checkScanWarning($path, $output); |
| 160 | 160 | }); |
| 161 | 161 | |
@@ -172,10 +172,10 @@ discard block |
||
| 172 | 172 | # exit the function if ctrl-c has been pressed |
| 173 | 173 | $output->writeln('Interrupted by user'); |
| 174 | 174 | } catch (NotFoundException $e) { |
| 175 | - $output->writeln('<error>Path not found: ' . $e->getMessage() . '</error>'); |
|
| 175 | + $output->writeln('<error>Path not found: '.$e->getMessage().'</error>'); |
|
| 176 | 176 | } catch (\Exception $e) { |
| 177 | - $output->writeln('<error>Exception during scan: ' . $e->getMessage() . '</error>'); |
|
| 178 | - $output->writeln('<error>' . $e->getTraceAsString() . '</error>'); |
|
| 177 | + $output->writeln('<error>Exception during scan: '.$e->getMessage().'</error>'); |
|
| 178 | + $output->writeln('<error>'.$e->getTraceAsString().'</error>'); |
|
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | protected function execute(InputInterface $input, OutputInterface $output) { |
| 184 | 184 | $inputPath = $input->getOption('path'); |
| 185 | 185 | if ($inputPath) { |
| 186 | - $inputPath = '/' . trim($inputPath, '/'); |
|
| 186 | + $inputPath = '/'.trim($inputPath, '/'); |
|
| 187 | 187 | list (, $user,) = explode('/', $inputPath, 3); |
| 188 | 188 | $users = array($user); |
| 189 | 189 | } else if ($input->getOption('all')) { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | if (is_object($user)) { |
| 228 | 228 | $user = $user->getUID(); |
| 229 | 229 | } |
| 230 | - $path = $inputPath ? $inputPath : '/' . $user; |
|
| 230 | + $path = $inputPath ? $inputPath : '/'.$user; |
|
| 231 | 231 | $user_count += 1; |
| 232 | 232 | if ($this->userManager->userExists($user)) { |
| 233 | 233 | # add an extra line when verbose is set to optical separate users |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } |
| 237 | 237 | $output->writeln("Starting scan for user $user_count out of $users_total ($user)"); |
| 238 | 238 | # full: printout data if $verbose was set |
| 239 | - $this->scanFiles($user, $path, $verbose, $output, $input->getOption('unscanned'), ! $input->getOption('shallow')); |
|
| 239 | + $this->scanFiles($user, $path, $verbose, $output, $input->getOption('unscanned'), !$input->getOption('shallow')); |
|
| 240 | 240 | } else { |
| 241 | 241 | $output->writeln("<error>Unknown user $user_count $user</error>"); |
| 242 | 242 | } |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | * @return string |
| 328 | 328 | */ |
| 329 | 329 | protected function formatExecTime() { |
| 330 | - list($secs, ) = explode('.', sprintf("%.1f", $this->execTime)); |
|
| 330 | + list($secs,) = explode('.', sprintf("%.1f", $this->execTime)); |
|
| 331 | 331 | |
| 332 | 332 | # if you want to have microseconds add this: . '.' . $tens; |
| 333 | 333 | return date('H:i:s', $secs); |