@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $path = basename($fullPath); |
| 105 | 105 | |
| 106 | 106 | if ($normalizedPath !== $path) { |
| 107 | - $output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>'); |
|
| 107 | + $output->writeln("\t<error>Entry \"".$fullPath.'" will not be accessible due to incompatible encoding</error>'); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
@@ -114,27 +114,27 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | # check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception |
| 116 | 116 | |
| 117 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
| 117 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
| 118 | 118 | $output->writeln("\tFile\t<info>$path</info>", OutputInterface::VERBOSITY_VERBOSE); |
| 119 | 119 | ++$this->filesCounter; |
| 120 | 120 | $this->abortIfInterrupted(); |
| 121 | 121 | }); |
| 122 | 122 | |
| 123 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
| 123 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
| 124 | 124 | $output->writeln("\tFolder\t<info>$path</info>", OutputInterface::VERBOSITY_VERBOSE); |
| 125 | 125 | ++$this->foldersCounter; |
| 126 | 126 | $this->abortIfInterrupted(); |
| 127 | 127 | }); |
| 128 | 128 | |
| 129 | - $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { |
|
| 130 | - $output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')', OutputInterface::VERBOSITY_VERBOSE); |
|
| 129 | + $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function(StorageNotAvailableException $e) use ($output) { |
|
| 130 | + $output->writeln('Error while scanning, storage not available ('.$e->getMessage().')', OutputInterface::VERBOSITY_VERBOSE); |
|
| 131 | 131 | }); |
| 132 | 132 | |
| 133 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
| 133 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
| 134 | 134 | $this->checkScanWarning($path, $output); |
| 135 | 135 | }); |
| 136 | 136 | |
| 137 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
| 137 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
| 138 | 138 | $this->checkScanWarning($path, $output); |
| 139 | 139 | }); |
| 140 | 140 | |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | # exit the function if ctrl-c has been pressed |
| 152 | 152 | $output->writeln('Interrupted by user'); |
| 153 | 153 | } catch (NotFoundException $e) { |
| 154 | - $output->writeln('<error>Path not found: ' . $e->getMessage() . '</error>'); |
|
| 154 | + $output->writeln('<error>Path not found: '.$e->getMessage().'</error>'); |
|
| 155 | 155 | } catch (\Exception $e) { |
| 156 | - $output->writeln('<error>Exception during scan: ' . $e->getMessage() . '</error>'); |
|
| 157 | - $output->writeln('<error>' . $e->getTraceAsString() . '</error>'); |
|
| 156 | + $output->writeln('<error>Exception during scan: '.$e->getMessage().'</error>'); |
|
| 157 | + $output->writeln('<error>'.$e->getTraceAsString().'</error>'); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | protected function execute(InputInterface $input, OutputInterface $output) { |
| 167 | 167 | $inputPath = $input->getOption('path'); |
| 168 | 168 | if ($inputPath) { |
| 169 | - $inputPath = '/' . trim($inputPath, '/'); |
|
| 169 | + $inputPath = '/'.trim($inputPath, '/'); |
|
| 170 | 170 | list (, $user,) = explode('/', $inputPath, 3); |
| 171 | 171 | $users = array($user); |
| 172 | 172 | } else if ($input->getOption('all')) { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | if (is_object($user)) { |
| 195 | 195 | $user = $user->getUID(); |
| 196 | 196 | } |
| 197 | - $path = $inputPath ? $inputPath : '/' . $user; |
|
| 197 | + $path = $inputPath ? $inputPath : '/'.$user; |
|
| 198 | 198 | ++$user_count; |
| 199 | 199 | if ($this->userManager->userExists($user)) { |
| 200 | 200 | $output->writeln("Starting scan for user $user_count out of $users_total ($user)"); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | protected function formatExecTime() { |
| 292 | 292 | $secs = round($this->execTime); |
| 293 | 293 | # convert seconds into HH:MM:SS form |
| 294 | - return sprintf('%02d:%02d:%02d', ($secs/3600), ($secs/60%60), $secs%60); |
|
| 294 | + return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $path = basename($fullPath); |
| 70 | 70 | |
| 71 | 71 | if ($normalizedPath !== $path) { |
| 72 | - $output->writeln("\t<error>Entry \"" . $fullPath . '" will not be accessible due to incompatible encoding</error>'); |
|
| 72 | + $output->writeln("\t<error>Entry \"".$fullPath.'" will not be accessible due to incompatible encoding</error>'); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
@@ -85,27 +85,27 @@ discard block |
||
| 85 | 85 | $scanner = new \OC\Files\Utils\Scanner(null, $connection, \OC::$server->getLogger()); |
| 86 | 86 | |
| 87 | 87 | # check on each file/folder if there was a user interrupt (ctrl-c) and throw an exception |
| 88 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
| 88 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
| 89 | 89 | $output->writeln("\tFile <info>$path</info>", OutputInterface::VERBOSITY_VERBOSE); |
| 90 | 90 | ++$this->filesCounter; |
| 91 | 91 | $this->abortIfInterrupted(); |
| 92 | 92 | }); |
| 93 | 93 | |
| 94 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
| 94 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
| 95 | 95 | $output->writeln("\tFolder <info>$path</info>", OutputInterface::VERBOSITY_VERBOSE); |
| 96 | 96 | ++$this->foldersCounter; |
| 97 | 97 | $this->abortIfInterrupted(); |
| 98 | 98 | }); |
| 99 | 99 | |
| 100 | - $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function (StorageNotAvailableException $e) use ($output) { |
|
| 101 | - $output->writeln('Error while scanning, storage not available (' . $e->getMessage() . ')', OutputInterface::VERBOSITY_VERBOSE); |
|
| 100 | + $scanner->listen('\OC\Files\Utils\Scanner', 'StorageNotAvailable', function(StorageNotAvailableException $e) use ($output) { |
|
| 101 | + $output->writeln('Error while scanning, storage not available ('.$e->getMessage().')', OutputInterface::VERBOSITY_VERBOSE); |
|
| 102 | 102 | }); |
| 103 | 103 | |
| 104 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function ($path) use ($output) { |
|
| 104 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) { |
|
| 105 | 105 | $this->checkScanWarning($path, $output); |
| 106 | 106 | }); |
| 107 | 107 | |
| 108 | - $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function ($path) use ($output) { |
|
| 108 | + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) { |
|
| 109 | 109 | $this->checkScanWarning($path, $output); |
| 110 | 110 | }); |
| 111 | 111 | |
@@ -118,10 +118,10 @@ discard block |
||
| 118 | 118 | # exit the function if ctrl-c has been pressed |
| 119 | 119 | $output->writeln('Interrupted by user'); |
| 120 | 120 | } catch (NotFoundException $e) { |
| 121 | - $output->writeln('<error>Path not found: ' . $e->getMessage() . '</error>'); |
|
| 121 | + $output->writeln('<error>Path not found: '.$e->getMessage().'</error>'); |
|
| 122 | 122 | } catch (\Exception $e) { |
| 123 | - $output->writeln('<error>Exception during scan: ' . $e->getMessage() . '</error>'); |
|
| 124 | - $output->writeln('<error>' . $e->getTraceAsString() . '</error>'); |
|
| 123 | + $output->writeln('<error>Exception during scan: '.$e->getMessage().'</error>'); |
|
| 124 | + $output->writeln('<error>'.$e->getTraceAsString().'</error>'); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | protected function formatExecTime() { |
| 219 | 219 | $secs = round($this->execTime); |
| 220 | 220 | # convert seconds into HH:MM:SS form |
| 221 | - return sprintf('%02d:%02d:%02d', ($secs/3600), ($secs/60%60), $secs%60); |
|
| 221 | + return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |