Completed
Push — master ( d612da...6cfb36 )
by Jean-Baptiste
01:48
created
src/Version/Guzzle5.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -17,6 +17,7 @@
 block discarded – undo
17 17
 
18 18
     /**
19 19
      * {@InheritDoc}
20
+     * @param string $baseUri
20 21
      */
21 22
     public function __construct($baseUri)
22 23
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     /**
19 19
      * {@InheritDoc}
20 20
      */
21
-    public function __construct($baseUri, $options = [])
21
+    public function __construct($baseUri, $options = [ ])
22 22
     {
23 23
         $this->defaultOptions = array_merge([
24 24
             'base_url' => $baseUri,
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function setBaseUri($baseUri)
39 39
     {
40
-        $this->setDefaultOptions(array_merge($this->defaultOptions, ['base_url' => $baseUri]));
40
+        $this->setDefaultOptions(array_merge($this->defaultOptions, [ 'base_url' => $baseUri ]));
41 41
     }
42 42
 
43 43
     public function getBaseUri()
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         return $this->client->getBaseUrl();
46 46
     }
47 47
 
48
-    public function setDefaultOptions($options = [])
48
+    public function setDefaultOptions($options = [ ])
49 49
     {
50 50
         $this->__construct($this->getBaseUri(), $options);
51 51
     }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $guzzleRequest = $this->client->createRequest(
84 84
             $request->getMethod(),
85 85
             $request->getUri(),
86
-            ['headers' => $request->getHeaders()]
86
+            [ 'headers' => $request->getHeaders() ]
87 87
         );
88 88
 
89 89
         $guzzleRequest->setBody(Stream::factory($request->getBody()));
Please login to merge, or discard this patch.
src/Version/Guzzle3.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -17,6 +17,7 @@
 block discarded – undo
17 17
 
18 18
     /**
19 19
      * {@InheritDoc}
20
+     * @param string $baseUri
20 21
      */
21 22
     public function __construct($baseUri)
22 23
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
     /**
19 19
      * {@InheritDoc}
20 20
      */
21
-    public function __construct($baseUri, $options = [])
21
+    public function __construct($baseUri, $options = [ ])
22 22
     {
23 23
         $this->setConfig($options);
24 24
 
25 25
         $this->client = new Client($baseUri, $this->defaultOptions);
26 26
     }
27 27
 
28
-    private function setConfig($options = [])
28
+    private function setConfig($options = [ ])
29 29
     {
30 30
         $this->defaultOptions = array_merge([
31 31
             'request.options' => [
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         return $this->client->getBaseUrl();
45 45
     }
46 46
 
47
-    public function setDefaultOptions($options = [])
47
+    public function setDefaultOptions($options = [ ])
48 48
     {
49 49
         $this->setConfig($options);
50 50
     }
Please login to merge, or discard this patch.
src/Mock/Guzzle3Mock.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 class Guzzle3Mock
11 11
 {
12 12
     /**
13
-     * @param array $responseCollection
13
+     * @param Psr7Response[] $responseCollection
14 14
      * @return \CanalTP\AbstractGuzzle\Guzzle
15 15
      */
16 16
     public function getMock(array $responseCollection)
Please login to merge, or discard this patch.
src/Mock/Guzzle5Mock.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use CanalTP\AbstractGuzzle\GuzzleFactory;
6 6
 use GuzzleHttp\Message\Response;
7
-use GuzzleHttp\Psr7\Response as psr7Response;
8 7
 use GuzzleHttp\Stream\Stream;
9 8
 use GuzzleHttp\Subscriber\Mock;
10 9
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,18 +16,18 @@
 block discarded – undo
16 16
      */
17 17
     public function getMock(array $responseCollection)
18 18
     {
19
-        $version5ResponseCollection = [];
19
+        $version5ResponseCollection = [ ];
20 20
         $client = GuzzleFactory::createClient('');
21 21
 
22 22
         foreach ($responseCollection as $response) {
23 23
             if ($response instanceof Psr7Response) {
24
-                $version5ResponseCollection[] = new Response(
24
+                $version5ResponseCollection[ ] = new Response(
25 25
                     $response->getStatusCode(),
26 26
                     $response->getHeaders(),
27 27
                     Stream::factory($response->getBody()->getContents())
28 28
                 );
29 29
             } else {
30
-                $version5ResponseCollection[] = new Response();
30
+                $version5ResponseCollection[ ] = new Response();
31 31
             }
32 32
         }
33 33
         $mock = new Mock($version5ResponseCollection);
Please login to merge, or discard this patch.
src/GuzzleFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      *
15 15
      * @throws NotSupportedException when Guzzle vendor version is not supported.
16 16
      */
17
-    public static function createClient($baseUri, $options = [])
17
+    public static function createClient($baseUri, $options = [ ])
18 18
     {
19 19
         $guzzleVersion = self::detectGuzzleVersion();
20 20
 
Please login to merge, or discard this patch.
src/Mock/Guzzle6Mock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,6 +21,6 @@
 block discarded – undo
21 21
         $mock = new MockHandler($responseCollection);
22 22
         $handler = HandlerStack::create($mock);
23 23
 
24
-        return GuzzleFactory::createClient('', ['handler' => $handler]);
24
+        return GuzzleFactory::createClient('', [ 'handler' => $handler ]);
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
src/Guzzle.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      * @param $baseUri
24 24
      * @param array $option
25 25
      */
26
-    abstract public function __construct($baseUri, $option = []);
26
+    abstract public function __construct($baseUri, $option = [ ]);
27 27
 
28 28
     /**
29 29
      * @return string
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     abstract public function setBaseUri($baseUri);
39 39
 
40
-    abstract public function setDefaultOptions($options = []);
40
+    abstract public function setDefaultOptions($options = [ ]);
41 41
 
42 42
     abstract public function getDefaultOptions();
43 43
 
Please login to merge, or discard this patch.
src/Version/Guzzle6.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     /**
17 17
      * {@InheritDoc}
18 18
      */
19
-    public function __construct($baseUri, $options = [])
19
+    public function __construct($baseUri, $options = [ ])
20 20
     {
21 21
         $this->defaultOptions = array_merge([
22 22
             'base_uri' => $baseUri,
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function setBaseUri($baseUri)
30 30
     {
31
-        $this->setDefaultOptions(array_merge($this->defaultOptions, ['base_uri' => $baseUri]));
31
+        $this->setDefaultOptions(array_merge($this->defaultOptions, [ 'base_uri' => $baseUri ]));
32 32
     }
33 33
 
34 34
     public function getBaseUri()
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         return $this->client->getConfig('base_uri');
37 37
     }
38 38
 
39
-    public function setDefaultOptions($options = [])
39
+    public function setDefaultOptions($options = [ ])
40 40
     {
41 41
         $this->__construct($this->getBaseUri(), $options);
42 42
     }
Please login to merge, or discard this patch.