Passed
Push — master ( 6caffc...88fbf0 )
by Radosław
02:35
created
src/SearchResult/Collection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     public function __construct(array $items = [], int $totalMatches = 0)
21 21
     {
22
-        foreach($items as $item) {
22
+        foreach ($items as $item) {
23 23
             if (!$item instanceof IItem) {
24 24
                 throw new InvalidArgumentException('Given items must implement Radowoj\Searcher\SearchResult\IItem interface');
25 25
             }
Please login to merge, or discard this patch.
src/SearchResult/Item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     protected function fromArray(array $data)
22 22
     {
23
-        foreach($data as $key => $value) {
23
+        foreach ($data as $key => $value) {
24 24
             if (!property_exists($this, $key)) {
25 25
                 throw new InvalidArgumentException("Invalid search result item property: {$key}");
26 26
             }
Please login to merge, or discard this patch.
examples/google.php 2 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 require_once(__DIR__ . '/../vendor/autoload.php');
4 4
 
5
-use GuzzleHttp\Client as GuzzleClient;
6
-use Radowoj\Searcher\SearchProvider\Google;
5
+use GuzzleHttp\Client as GuzzleClient;
6
+use Radowoj\Searcher\SearchProvider\Google;
7 7
 use Radowoj\Searcher\Searcher;
8 8
 
9 9
 $config = require_once('config.php');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     var_dump(($results[5])->toArray());
30 30
 
31 31
     //Traversable
32
-    foreach($results as $result){
32
+    foreach ($results as $result) {
33 33
         var_dump($result->toArray());
34 34
     }
35 35
 
Please login to merge, or discard this patch.
examples/bing.php 2 patches
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 require_once(__DIR__ . '/../vendor/autoload.php');
4 4
 
5
-use GuzzleHttp\Client as GuzzleClient;
6
-use Radowoj\Searcher\SearchProvider\Bing;
7
-use Radowoj\Searcher\Searcher;
5
+use GuzzleHttp\Client as GuzzleClient;
6
+use Radowoj\Searcher\SearchProvider\Bing;
7
+use Radowoj\Searcher\Searcher;
8 8
 use Radowoj\Searcher\Exceptions\Exception;
9 9
 
10 10
 $config = require_once('config.php');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
     var_dump(($results[5])->toArray());
30 30
 
31 31
     //Traversable
32
-    foreach($results as $result){
32
+    foreach ($results as $result) {
33 33
         var_dump($result->toArray());
34 34
     }
35 35
 
Please login to merge, or discard this patch.
src/SearchProvider/Google.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
      * On status == 200 it simply returns json-decoded response.
79 79
      *
80 80
      * @param  Psr7Response $result result from Guzzle
81
-     * @return array
81
+     * @return stdClass
82 82
      */
83 83
     protected function decodeResponse(Psr7Response $result) : stdClass
84 84
     {
Please login to merge, or discard this patch.
Unused Use Statements   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -2,19 +2,13 @@
 block discarded – undo
2 2
 
3 3
 namespace Radowoj\Searcher\SearchProvider;
4 4
 
5
-use stdClass;
6
-
7
-use GuzzleHttp\Client as GuzzleClient;
8
-use Psr\Http\Message\ResponseInterface as Psr7Response;
9
-
10
-use Radowoj\Searcher\SearchResult\Collection;
11
-use Radowoj\Searcher\SearchResult\ICollection;
12
-use Radowoj\Searcher\SearchResult\Item;
13
-use Radowoj\Searcher\SearchResult\IItem;
14
-
15
-use Radowoj\Searcher\Exceptions\Exception;
5
+use stdClass;
6
+use GuzzleHttp\Client as GuzzleClient;
7
+use Psr\Http\Message\ResponseInterface as Psr7Response;
8
+use Radowoj\Searcher\SearchResult\Item;
9
+use Radowoj\Searcher\SearchResult\IItem;
10
+use Radowoj\Searcher\Exceptions\Exception;
16 11
 use Radowoj\Searcher\Exceptions\QuotaExceededException;
17
-use Radowoj\Searcher\Exceptions\RateLimitExceededException;
18 12
 
19 13
 class Google extends SearchProvider implements ISearchProvider
20 14
 {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
         $paramsMerged = [];
50 50
 
51
-        foreach($params as $key => $value) {
51
+        foreach ($params as $key => $value) {
52 52
             $paramsMerged[] = "{$key}={$value}";
53 53
         }
54 54
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     protected function decodeResponse(Psr7Response $result) : stdClass
84 84
     {
85 85
         $decodedResult = json_decode($result->getBody());
86
-        switch($result->getStatusCode()) {
86
+        switch ($result->getStatusCode()) {
87 87
             case 200:
88 88
                 return $decodedResult;
89 89
             case 403:
Please login to merge, or discard this patch.
src/SearchProvider/Bing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
      */
70 70
     protected function decodeResponse(Psr7Response $result) : stdClass
71 71
     {
72
-        switch($result->getStatusCode()) {
72
+        switch ($result->getStatusCode()) {
73 73
             case 200:
74 74
                 return json_decode($result->getBody());
75 75
             case 403:   //Out of call volume quota
Please login to merge, or discard this patch.