Completed
Push — master ( e9de2d...c969d8 )
by Matthew
10s
created
src/IconScraper/Scraper.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
         return $return;
65 65
     }
66 66
 
67
-   public function info($url) {
67
+    public function info($url) {
68 68
         if (empty($url) || $url === false) {
69 69
             return false;
70 70
         }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
         $headers = $this->dataAccess->retrieveHeader($url);
73 73
 
74 74
         // leaves only numeric keys
75
-        $status_lines = array_filter($headers, function ($key) {
75
+        $status_lines = array_filter($headers, function($key) {
76 76
             return is_int($key);
77 77
         }, ARRAY_FILTER_USE_KEY);
78 78
 
79 79
         // uses last returned status line header
80 80
         $exploded = explode(' ', end($status_lines));
81 81
 
82
-        if (! array_key_exists(1, $exploded)) {
82
+        if (!array_key_exists(1, $exploded)) {
83 83
             return false;
84 84
         }
85 85
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
                     // Make sure the href is an absolute URL.
154 154
                     if ($href && filter_var($href, FILTER_VALIDATE_URL) === false) {
155
-                        $href = $url . '/' . $href; //Todo: Improve this
155
+                        $href = $url.'/'.$href; //Todo: Improve this
156 156
                     }
157 157
 
158 158
                     $size = $link->hasAttribute('sizes') ? $link->getAttribute('sizes') : [];
@@ -160,18 +160,18 @@  discard block
 block discarded – undo
160 160
 
161 161
                     $type = false;
162 162
 
163
-                    switch(strtolower($attribute)) {
163
+                    switch (strtolower($attribute)) {
164 164
                         case Icon::APPLE_TOUCH:
165 165
                             $type = Icon::APPLE_TOUCH;
166 166
                             break;
167 167
                         default:
168
-                            if(strpos($link->getAttribute('href'), 'icon') !== FALSE) {
168
+                            if (strpos($link->getAttribute('href'), 'icon') !== FALSE) {
169 169
                                 $type = Icon::FAVICON;
170 170
                                 $size = [];
171 171
                             }
172 172
                     };
173 173
 
174
-                    if(!empty($type) && filter_var($href, FILTER_VALIDATE_URL)) {
174
+                    if (!empty($type) && filter_var($href, FILTER_VALIDATE_URL)) {
175 175
                         $icons[] = new Icon($type, $href, $size);
176 176
                     }
177 177
                 }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         // Make sure the favicon is an absolute URL.
203 203
         if (isset($favicon) && filter_var($favicon, FILTER_VALIDATE_URL) === false) {
204
-            $favicon = $url . '/' . $favicon;
204
+            $favicon = $url.'/'.$favicon;
205 205
         }
206 206
 
207 207
         if (isset($favicon)) {
Please login to merge, or discard this patch.
src/IconScraper/DataAccess.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
         // if there were multiple redirects flatten down the location header
25 25
         if (isset($headers['location']) && is_array($headers['location'])) {
26
-            $headers['location'] = array_filter($headers['location'], function ($header) {
26
+            $headers['location'] = array_filter($headers['location'], function($header) {
27 27
                 return strpos($header, '://') !== false; // leave only absolute urls
28 28
             });
29 29
 
Please login to merge, or discard this patch.