Completed
Branch full-rewrite (4754d3)
by Thibaud
03:13
created
src/Adapter/Guzzle/LegacyGuzzleReader.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Zippy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Resource/WriterResolver/ProtocolBasedWriterResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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()];
Please login to merge, or discard this patch.
src/Resource/Reader/RawStreamReader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Resource/ReaderResolver/ProtocolBasedReaderResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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()];
Please login to merge, or discard this patch.
src/Resource/ResourceUri.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Adapter/Pecl/Rar/RarResourceIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Adapter/Pecl/RarAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Adapter/Pecl/ZipAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.