| @@ -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 | } | 
| @@ -179,6 +179,9 @@ | ||
| 179 | 179 | return new static($outputParser, $manager, $inflator, $deflator); | 
| 180 | 180 | } | 
| 181 | 181 | |
| 182 | + /** | |
| 183 | + * @param string|null $wish | |
| 184 | + */ | |
| 182 | 185 | private static function findABinary($wish, array $defaults, ExecutableFinder $finder) | 
| 183 | 186 |      { | 
| 184 | 187 | $possibles = $wish ? (array) $wish : $defaults; | 
| @@ -100,6 +100,10 @@ | ||
| 100 | 100 | return $this->getInflatorVersion(); | 
| 101 | 101 | } | 
| 102 | 102 | |
| 103 | + /** | |
| 104 | + * @param string $path | |
| 105 | + * @param string $files | |
| 106 | + */ | |
| 103 | 107 | protected function doTarCreate($options, $path, $files = null, $recursive = true) | 
| 104 | 108 |      { | 
| 105 | 109 | $files = (array) $files; | 
| @@ -226,6 +226,9 @@ discard block | ||
| 226 | 226 | return $this->getResource($path, \ZipArchive::CHECKCONS); | 
| 227 | 227 | } | 
| 228 | 228 | |
| 229 | + /** | |
| 230 | + * @param string $path | |
| 231 | + */ | |
| 229 | 232 | private function getResource($path, $mode) | 
| 230 | 233 |      { | 
| 231 | 234 | $zip = new \ZipArchive(); | 
| @@ -238,6 +241,9 @@ discard block | ||
| 238 | 241 | return new ZipArchiveResource($zip); | 
| 239 | 242 | } | 
| 240 | 243 | |
| 244 | + /** | |
| 245 | + * @param boolean $recursive | |
| 246 | + */ | |
| 241 | 247 | private function addEntries(ResourceInterface $zipResource, array $files, $recursive) | 
| 242 | 248 |      { | 
| 243 | 249 | $stack = new \SplStack(); | 
| @@ -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 |              )) { |