@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: Matthew |
|
5 | - * Date: 15/07/15 |
|
6 | - * Time: 4:20 PM |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: Matthew |
|
5 | + * Date: 15/07/15 |
|
6 | + * Time: 4:20 PM |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace Mpclarkson\IconScraper; |
10 | 10 |
@@ -64,7 +64,7 @@ |
||
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 | } |
@@ -72,14 +72,14 @@ discard block |
||
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 |
||
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 |
||
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(strtolower($attribute), 'icon') !== FALSE) { |
|
168 | + if (strpos(strtolower($attribute), '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 |
||
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)) { |
@@ -23,7 +23,7 @@ |
||
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 |