| @@ -19,7 +19,7 @@ | ||
| 19 | 19 |      { | 
| 20 | 20 | $this->client = $client; | 
| 21 | 21 | |
| 22 | -        if (! $this->client) { | |
| 22 | +        if (!$this->client) { | |
| 23 | 23 | $this->client = new Client(); | 
| 24 | 24 | } | 
| 25 | 25 | } | 
| @@ -82,16 +82,16 @@ discard block | ||
| 82 | 82 |      { | 
| 83 | 83 | $container = new static(); | 
| 84 | 84 | |
| 85 | -        $container->factories['stream-teleporter'] = function () { | |
| 85 | +        $container->factories['stream-teleporter'] = function() { | |
| 86 | 86 | return StreamTeleporter::create(); | 
| 87 | 87 | }; | 
| 88 | 88 | |
| 89 | -        $container->factories['local-teleporter'] = function () { | |
| 89 | +        $container->factories['local-teleporter'] = function() { | |
| 90 | 90 | return LocalTeleporter::create(); | 
| 91 | 91 | }; | 
| 92 | 92 | |
| 93 | 93 |          if (class_exists('GuzzleHttp\Client')) { | 
| 94 | -            $container->factories['guzzle-teleporter'] = function () { | |
| 94 | +            $container->factories['guzzle-teleporter'] = function() { | |
| 95 | 95 | return new GuzzleTeleporter( | 
| 96 | 96 | null, | 
| 97 | 97 | new GuzzleReaderFactory(), | 
| @@ -100,7 +100,7 @@ discard block | ||
| 100 | 100 | }; | 
| 101 | 101 | } | 
| 102 | 102 |          elseif (class_exists('Guzzle\Http\Client')) { | 
| 103 | -            $container->factories['guzzle-teleporter'] = function () { | |
| 103 | +            $container->factories['guzzle-teleporter'] = function() { | |
| 104 | 104 | return new GuzzleTeleporter(); | 
| 105 | 105 | }; | 
| 106 | 106 | } | 
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | $this, | 
| 62 | 62 | $stat['name'], | 
| 63 | 63 | $stat['size'], | 
| 64 | -                new \DateTime('@' . $stat['mtime']), | |
| 64 | +                new \DateTime('@'.$stat['mtime']), | |
| 65 | 65 | 0 === strlen($resource->getResource()->getFromIndex($i, 1)) | 
| 66 | 66 | ); | 
| 67 | 67 | } | 
| @@ -129,7 +129,7 @@ discard block | ||
| 129 | 129 |                      if (file_exists($member)) { | 
| 130 | 130 | $resource->getResource()->close(); | 
| 131 | 131 | |
| 132 | -                        throw new RuntimeException('Target file ' . $member . ' already exists.'); | |
| 132 | +                        throw new RuntimeException('Target file '.$member.' already exists.'); | |
| 133 | 133 | } | 
| 134 | 134 | } | 
| 135 | 135 | |
| @@ -255,7 +255,7 @@ discard block | ||
| 255 | 255 | $adapter->checkReadability($zipResource->getResource(), $resource->getTarget()); | 
| 256 | 256 |                  if (is_dir($resource->getTarget())) { | 
| 257 | 257 |                      if ($recursive) { | 
| 258 | - $stack->push($resource->getTarget() . ((substr($resource->getTarget(), -1) === DIRECTORY_SEPARATOR) ? '' : DIRECTORY_SEPARATOR)); | |
| 258 | + $stack->push($resource->getTarget().((substr($resource->getTarget(), -1) === DIRECTORY_SEPARATOR) ? '' : DIRECTORY_SEPARATOR)); | |
| 259 | 259 |                      } else { | 
| 260 | 260 | $adapter->addEmptyDir($zipResource->getResource(), $resource->getTarget()); | 
| 261 | 261 | } | 
| @@ -273,10 +273,10 @@ discard block | ||
| 273 | 273 |                  $files = array_diff(scandir($dir), array(".", "..")); | 
| 274 | 274 |                  if (count($files) > 0) { | 
| 275 | 275 |                      foreach ($files as $file) { | 
| 276 | - $file = $dir . $file; | |
| 276 | + $file = $dir.$file; | |
| 277 | 277 | $this->checkReadability($zipResource->getResource(), $file); | 
| 278 | 278 |                          if (is_dir($file)) { | 
| 279 | - $stack->push($file . DIRECTORY_SEPARATOR); | |
| 279 | + $stack->push($file.DIRECTORY_SEPARATOR); | |
| 280 | 280 |                          } else { | 
| 281 | 281 | $this->addFileToZip($zipResource->getResource(), $file); | 
| 282 | 282 | } | 
| @@ -268,6 +268,6 @@ | ||
| 268 | 268 |              throw new InvalidArgumentException(sprintf('Target path %s is not writeable.', $directory)); | 
| 269 | 269 | } | 
| 270 | 270 | |
| 271 | - return realpath($directory) . '/' . PathUtil::basename($path); | |
| 271 | + return realpath($directory).'/'.PathUtil::basename($path); | |
| 272 | 272 | } | 
| 273 | 273 | } | 
| @@ -8,6 +8,6 @@ | ||
| 8 | 8 |  { | 
| 9 | 9 | public function mapResourcePath(ZippyResource $resource, $context) | 
| 10 | 10 |      { | 
| 11 | - return rtrim($context, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $resource->getTarget(); | |
| 11 | + return rtrim($context, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$resource->getTarget(); | |
| 12 | 12 | } | 
| 13 | 13 | } | 
| @@ -43,14 +43,14 @@ | ||
| 43 | 43 | |
| 44 | 44 | // drw-rw-r-- 0 toto titi 0 Jan 3 1980 practice/ | 
| 45 | 45 | // -rw-rw-r-- 0 toto titi 10240 Jan 22 13:31 practice/records | 
| 46 | -            if (!preg_match_all("#" . | |
| 47 | - self::PERMISSIONS . "\s+" . // match (drw-r--r--) | |
| 48 | - self::HARD_LINK . "\s+" . // match (1) | |
| 49 | - self::OWNER . "\s" . // match (toto) | |
| 50 | - self::GROUP . "\s+" . // match (titi) | |
| 51 | - self::FILESIZE . "\s+" . // match (0) | |
| 52 | - self::DATE . "\s+" . // match (Jan 3 1980) | |
| 53 | - self::FILENAME . // match (practice) | |
| 46 | +            if (!preg_match_all("#". | |
| 47 | + self::PERMISSIONS."\s+".// match (drw-r--r--) | |
| 48 | + self::HARD_LINK."\s+".// match (1) | |
| 49 | + self::OWNER."\s".// match (toto) | |
| 50 | + self::GROUP."\s+".// match (titi) | |
| 51 | + self::FILESIZE."\s+".// match (0) | |
| 52 | + self::DATE."\s+".// match (Jan 3 1980) | |
| 53 | + self::FILENAME.// match (practice) | |
| 54 | 54 | "#", $line, $matches, PREG_SET_ORDER | 
| 55 | 55 |              )) { | 
| 56 | 56 | continue; | 
| @@ -44,10 +44,10 @@ | ||
| 44 | 44 | $matches = array(); | 
| 45 | 45 | |
| 46 | 46 | // 785 2012-10-24 10:39 file | 
| 47 | -            if (!preg_match_all("#" . | |
| 48 | - self::LENGTH . "\s+" . // match (785) | |
| 49 | - self::ISO_DATE . "\s+" . // match (2012-10-24 10:39) | |
| 50 | - self::FILENAME . // match (file) | |
| 47 | +            if (!preg_match_all("#". | |
| 48 | + self::LENGTH."\s+".// match (785) | |
| 49 | + self::ISO_DATE."\s+".// match (2012-10-24 10:39) | |
| 50 | + self::FILENAME.// match (file) | |
| 51 | 51 | "#", | 
| 52 | 52 | $line, $matches, PREG_SET_ORDER | 
| 53 | 53 |              )) { | 
| @@ -37,12 +37,12 @@ | ||
| 37 | 37 | |
| 38 | 38 | // -rw-r--r-- gray/staff 62373 2006-06-09 12:06 apple | 
| 39 | 39 |              if (!preg_match_all("#". | 
| 40 | - self::PERMISSIONS . "\s+" . // match (-rw-r--r--) | |
| 41 | - self::OWNER . "/" . // match (gray) | |
| 42 | - self::GROUP . "\s+" . // match (staff) | |
| 43 | - self::FILESIZE . "\s+" . // match (62373) | |
| 44 | - self::ISO_DATE . "\s+" . // match (2006-06-09 12:06) | |
| 45 | - self::FILENAME . // match (apple) | |
| 40 | + self::PERMISSIONS."\s+".// match (-rw-r--r--) | |
| 41 | + self::OWNER."/".// match (gray) | |
| 42 | + self::GROUP."\s+".// match (staff) | |
| 43 | + self::FILESIZE."\s+".// match (62373) | |
| 44 | + self::ISO_DATE."\s+".// match (2006-06-09 12:06) | |
| 45 | + self::FILENAME.// match (apple) | |
| 46 | 46 | "#", | 
| 47 | 47 | $line, $matches, PREG_SET_ORDER | 
| 48 | 48 |              )) { |