@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function setPolicy($key, Policy $policy) |
| 71 | 71 | { |
| 72 | - $this->policies[(string)$key] = $policy; |
|
| 72 | + $this->policies[(string) $key] = $policy; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function setCollector($key, Collector $collector) |
| 99 | 99 | { |
| 100 | - $this->collectors[(string)$key] = $collector; |
|
| 100 | + $this->collectors[(string) $key] = $collector; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function getCollector($key) |
| 110 | 110 | { |
| 111 | - return isset($this->collectors[(string)$key]) |
|
| 112 | - ? $this->collectors[(string)$key] |
|
| 111 | + return isset($this->collectors[(string) $key]) |
|
| 112 | + ? $this->collectors[(string) $key] |
|
| 113 | 113 | : null; |
| 114 | 114 | } |
| 115 | 115 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | { |
| 141 | 141 | /** @var Policy $policy */ |
| 142 | 142 | foreach ($this->policies as $key => $policy) { |
| 143 | - if (! $policy->shouldVisit($url)) { |
|
| 143 | + if (!$policy->shouldVisit($url)) { |
|
| 144 | 144 | return false; |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | public function crawl($maxDeep = 1) |
| 196 | 196 | { |
| 197 | 197 | $deepness = 0; |
| 198 | - $maxDeep = abs((int)$maxDeep); |
|
| 198 | + $maxDeep = abs((int) $maxDeep); |
|
| 199 | 199 | $linksCollection = array_fill(0, $maxDeep+1, []); |
| 200 | 200 | |
| 201 | 201 | $linksCollection[0] = array($this->baseUrl->getWebUrl()); |
@@ -55,13 +55,13 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public function collect() |
| 57 | 57 | { |
| 58 | - if(! isset($this->data[$this->url->getWebUrl()])) { |
|
| 58 | + if (!isset($this->data[$this->url->getWebUrl()])) { |
|
| 59 | 59 | $this->data[$this->url->getWebUrl()] = []; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | preg_match_all(self::REGEX, $this->content, $media); |
| 63 | 63 | $data = preg_replace(self::REGEX2, "$3", $media[0]); |
| 64 | - foreach($data as $url) { |
|
| 64 | + foreach ($data as $url) { |
|
| 65 | 65 | $this->data[$this->url->getWebUrl()][] = |
| 66 | 66 | UrlUtil::getAbsoluteLink($this->url, $url); |
| 67 | 67 | } |