@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Alchemy\Zippy\Adapter\Guzzle; |
| 4 | 4 | |
| 5 | -use Alchemy\Zippy\Resource\Resource; |
|
| 6 | 5 | use Alchemy\Zippy\Resource\ResourceReader; |
| 7 | 6 | use Alchemy\Zippy\Resource\ResourceUri; |
| 8 | 7 | use Guzzle\Http\Client; |
@@ -72,8 +72,8 @@ |
||
| 72 | 72 | $this->packagedResourceIteratorResolver |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | - if (! is_array($files) && ! $files instanceof \Traversable) { |
|
| 76 | - $files = [ $files ]; |
|
| 75 | + if (!is_array($files) && !$files instanceof \Traversable) { |
|
| 76 | + $files = [$files]; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | foreach ($files as $file) { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public function addWriter(ResourceWriter $writer, $protocols) |
| 26 | 26 | { |
| 27 | - $protocols = is_array($protocols) ? $protocols : [ $protocols ]; |
|
| 27 | + $protocols = is_array($protocols) ? $protocols : [$protocols]; |
|
| 28 | 28 | $index = count($this->writers); |
| 29 | 29 | |
| 30 | 30 | $this->writers[$index] = $writer; |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function resolveWriter(ResourceUri $resource) |
| 44 | 44 | { |
| 45 | - if (! array_key_exists($resource->getProtocol(), $this->protocolWriterIndexes)) { |
|
| 46 | - throw new \RuntimeException('Unsupported protocol: ' . $resource->getProtocol() . '( ' . $resource . ')'); |
|
| 45 | + if (!array_key_exists($resource->getProtocol(), $this->protocolWriterIndexes)) { |
|
| 46 | + throw new \RuntimeException('Unsupported protocol: ' . $resource->getProtocol() . '( ' . $resource . ')'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $index = $this->protocolWriterIndexes[$resource->getProtocol()]; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | public function __construct($resource) |
| 13 | 13 | { |
| 14 | - if (! is_resource($resource)) { |
|
| 14 | + if (!is_resource($resource)) { |
|
| 15 | 15 | throw new \InvalidArgumentException('Invalid resource.'); |
| 16 | 16 | } |
| 17 | 17 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function addFactory(ResourceReaderFactory $factory, $protocols) |
| 27 | 27 | { |
| 28 | - $protocols = is_array($protocols) ? $protocols : [ $protocols ]; |
|
| 28 | + $protocols = is_array($protocols) ? $protocols : [$protocols]; |
|
| 29 | 29 | $index = count($this->factories); |
| 30 | 30 | |
| 31 | 31 | $this->factories[$index] = $factory; |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function resolveReader(ResourceUri $resource) |
| 45 | 45 | { |
| 46 | - if (! array_key_exists($resource->getProtocol(), $this->protocolFactoryIndexes)) { |
|
| 47 | - throw new \RuntimeException('Unsupported protocol: ' . $resource->getProtocol() . '( ' . $resource . ')'); |
|
| 46 | + if (!array_key_exists($resource->getProtocol(), $this->protocolFactoryIndexes)) { |
|
| 47 | + throw new \RuntimeException('Unsupported protocol: ' . $resource->getProtocol() . '( ' . $resource . ')'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | $index = $this->protocolFactoryIndexes[$resource->getProtocol()]; |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | */ |
| 133 | 133 | public function getChainedResource() |
| 134 | 134 | { |
| 135 | - return new self($this->resource); |
|
| 135 | + return new self($this->resource); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $parts = explode(self::PROTOCOL_SEPARATOR, $uri, 2); |
| 33 | 33 | |
| 34 | - if (count(array_filter($parts, function ($value) { return $value != ''; })) !== 2) { |
|
| 34 | + if (count(array_filter($parts, function($value) { return $value != ''; })) !== 2) { |
|
| 35 | 35 | return false; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function __construct($uri) |
| 85 | 85 | { |
| 86 | - if (! self::isValidUri($uri)) { |
|
| 86 | + if (!self::isValidUri($uri)) { |
|
| 87 | 87 | throw new \InvalidArgumentException(sprintf( |
| 88 | 88 | 'Malformed URI: required format is "protocol://resource", got "%s"', |
| 89 | 89 | $uri |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | protected function buildIterator() |
| 38 | 38 | { |
| 39 | - return new MappingArrayIterator($this->archive->getEntries(), function ($current) { |
|
| 39 | + return new MappingArrayIterator($this->archive->getEntries(), function($current) { |
|
| 40 | 40 | return ResourceUri::fromString($current->getName()); |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | ProtocolBasedReaderResolver $readerResolver, |
| 22 | 22 | ProtocolBasedWriterResolver $writerResolver |
| 23 | 23 | ) { |
| 24 | - $iteratorResolver->addFactory('rar', function ($container) { |
|
| 24 | + $iteratorResolver->addFactory('rar', function($container) { |
|
| 25 | 25 | return new RarResourceIterator($container); |
| 26 | 26 | }); |
| 27 | 27 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | ProtocolBasedReaderResolver $readerResolver, |
| 22 | 22 | ProtocolBasedWriterResolver $writerResolver |
| 23 | 23 | ) { |
| 24 | - $iteratorResolver->addFactory('zip', function ($container) { |
|
| 24 | + $iteratorResolver->addFactory('zip', function($container) { |
|
| 25 | 25 | return new ZipResourceIterator($container); |
| 26 | 26 | }); |
| 27 | 27 | } |