@@ -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 | } |
@@ -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 | )) { |
@@ -87,16 +87,16 @@ discard block |
||
87 | 87 | { |
88 | 88 | $container = new static(); |
89 | 89 | |
90 | - $container->factories['stream-teleporter'] = function () { |
|
90 | + $container->factories['stream-teleporter'] = function() { |
|
91 | 91 | return new StreamTeleporter(); |
92 | 92 | }; |
93 | 93 | |
94 | - $container->factories['local-teleporter'] = function () { |
|
94 | + $container->factories['local-teleporter'] = function() { |
|
95 | 95 | return new LocalTeleporter(new Filesystem()); |
96 | 96 | }; |
97 | 97 | |
98 | 98 | if (class_exists('GuzzleHttp\Client')) { |
99 | - $container->factories['guzzle-teleporter'] = function () { |
|
99 | + $container->factories['guzzle-teleporter'] = function() { |
|
100 | 100 | return new GenericTeleporter( |
101 | 101 | new GuzzleReaderFactory(), |
102 | 102 | new FilesystemWriter(), |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | }; |
106 | 106 | } |
107 | 107 | elseif (class_exists('Guzzle\Http\Client')) { |
108 | - $container->factories['guzzle-teleporter'] = function () { |
|
108 | + $container->factories['guzzle-teleporter'] = function() { |
|
109 | 109 | return new GenericTeleporter( |
110 | 110 | new LegacyGuzzleReaderFactory(), |
111 | 111 | new FilesystemWriter(), |
@@ -103,8 +103,7 @@ |
||
103 | 103 | new ResourceLocator() |
104 | 104 | ); |
105 | 105 | }; |
106 | - } |
|
107 | - elseif (class_exists('Guzzle\Http\Client')) { |
|
106 | + } elseif (class_exists('Guzzle\Http\Client')) { |
|
108 | 107 | $container->factories['guzzle-teleporter'] = function () { |
109 | 108 | return new GenericTeleporter( |
110 | 109 | new LegacyGuzzleReaderFactory(), |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function getProcess() |
48 | 48 | { |
49 | - $process = new Process($this->command, $this->cwd); |
|
49 | + $process = new Process($this->command, $this->cwd); |
|
50 | 50 | $process->setTimeout(null); |
51 | 51 | |
52 | 52 | return $process; |