@@ -250,7 +250,7 @@ |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
| 253 | - * @param $path |
|
| 253 | + * @param string $path |
|
| 254 | 254 | * |
| 255 | 255 | * @return array | DeliveryEvent[] |
| 256 | 256 | */ |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $try = 0; |
| 132 | 132 | while ($try < $this->depth && !isset($this->events[$trackingNumber])) { |
| 133 | 133 | $this->retrieveOneMoreFile(); |
| 134 | - $try ++; |
|
| 134 | + $try++; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if ($try >= $this->depth && !isset($this->events[$trackingNumber])) { |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $try = 0; |
| 168 | 168 | while ($try < $this->depth && !isset($this->eventsByInternalNumber[$reference])) { |
| 169 | 169 | $this->retrieveOneMoreFile(); |
| 170 | - $try ++; |
|
| 170 | + $try++; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | if ($try >= $this->depth && !isset($this->eventsByInternalNumber[$reference])) { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | $chronopostFiles = $filteredFiles; |
| 233 | 233 | |
| 234 | - usort($chronopostFiles, function ($fileA, $fileB) { |
|
| 234 | + usort($chronopostFiles, function($fileA, $fileB) { |
|
| 235 | 235 | return ($fileA['date'] > $fileB['date']) ? -1 : 1; |
| 236 | 236 | }); |
| 237 | 237 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | public function setConfig(array $config) |
| 130 | 130 | { |
| 131 | 131 | foreach ($this->configurable as $setting) { |
| 132 | - if (! isset($config[$setting])) { |
|
| 132 | + if (!isset($config[$setting])) { |
|
| 133 | 133 | continue; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | if (!$this->connection) { |
| 156 | 156 | throw new \RuntimeException( |
| 157 | - 'Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort() |
|
| 157 | + 'Could not connect to host: '.$this->getHost().', port:'.$this->getPort() |
|
| 158 | 158 | ); |
| 159 | 159 | } |
| 160 | 160 | $this->login(); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | if (!ftp_pasv($this->connection, $this->passive)) { |
| 173 | 173 | throw new \RuntimeException( |
| 174 | - 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() |
|
| 174 | + 'Could not set passive mode for connection: '.$this->getHost().'::'.$this->getPort() |
|
| 175 | 175 | ); |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | $root = $this->getRoot(); |
| 184 | 184 | $connection = $this->connection; |
| 185 | - if (empty($root) === false && ! ftp_chdir($connection, $root)) { |
|
| 186 | - throw new \RuntimeException('Root is invalid or does not exist: ' . $this->getRoot()); |
|
| 185 | + if (empty($root) === false && !ftp_chdir($connection, $root)) { |
|
| 186 | + throw new \RuntimeException('Root is invalid or does not exist: '.$this->getRoot()); |
|
| 187 | 187 | } |
| 188 | 188 | // Store absolute path for further reference. |
| 189 | 189 | // This is needed when creating directories and |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | protected function login() |
| 200 | 200 | { |
| 201 | 201 | set_error_handler( |
| 202 | - function () { |
|
| 202 | + function() { |
|
| 203 | 203 | } |
| 204 | 204 | ); |
| 205 | 205 | $isLoggedIn = ftp_login($this->connection, $this->getUsername(), $this->getPassword()); |
@@ -207,8 +207,8 @@ discard block |
||
| 207 | 207 | if (!$isLoggedIn) { |
| 208 | 208 | $this->disconnect(); |
| 209 | 209 | throw new \RuntimeException( |
| 210 | - 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( |
|
| 211 | - ) . ', username: ' . $this->getUsername() |
|
| 210 | + 'Could not login with connection: '.$this->getHost().'::'.$this->getPort( |
|
| 211 | + ).', username: '.$this->getUsername() |
|
| 212 | 212 | ); |
| 213 | 213 | } |
| 214 | 214 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | */ |
| 260 | 260 | protected function listDirectoryContents($directory, $recursive = true) |
| 261 | 261 | { |
| 262 | - $listing = ftp_rawlist($this->getConnection(), '-lna ' . $directory, $recursive); |
|
| 262 | + $listing = ftp_rawlist($this->getConnection(), '-lna '.$directory, $recursive); |
|
| 263 | 263 | return $listing ? $this->normalizeListing($listing, $directory) : []; |
| 264 | 264 | } |
| 265 | 265 | /** |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | public function isConnected() |
| 271 | 271 | { |
| 272 | - return ! is_null($this->connection) && ftp_systype($this->connection) !== false; |
|
| 272 | + return !is_null($this->connection) && ftp_systype($this->connection) !== false; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | */ |
| 607 | 607 | protected function sortListing(array $result) |
| 608 | 608 | { |
| 609 | - $compare = function ($one, $two) { |
|
| 609 | + $compare = function($one, $two) { |
|
| 610 | 610 | return strnatcmp($one['path'], $two['path']); |
| 611 | 611 | }; |
| 612 | 612 | usort($result, $compare); |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | // split up the permission groups |
| 745 | 745 | $parts = str_split($permissions, 3); |
| 746 | 746 | // convert the groups |
| 747 | - $mapper = function ($part) { |
|
| 747 | + $mapper = function($part) { |
|
| 748 | 748 | return array_sum(str_split($part)); |
| 749 | 749 | }; |
| 750 | 750 | // get the sum of the groups |
@@ -760,8 +760,8 @@ discard block |
||
| 760 | 760 | */ |
| 761 | 761 | public function removeDotDirectories(array $list) |
| 762 | 762 | { |
| 763 | - $filter = function ($line) { |
|
| 764 | - if (! empty($line) && !preg_match('#.* \.(\.)?$|^total#', $line)) { |
|
| 763 | + $filter = function($line) { |
|
| 764 | + if (!empty($line) && !preg_match('#.* \.(\.)?$|^total#', $line)) { |
|
| 765 | 765 | return true; |
| 766 | 766 | } |
| 767 | 767 | return false; |