@@ -96,7 +96,7 @@ |
||
96 | 96 | } catch (ValidationFailedException $e) { |
97 | 97 | $result = new CheckResult(CheckResult::STATUS_FAILURE, $e->getMessage()); |
98 | 98 | } catch (\Exception $e) { |
99 | - $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: ' . $e->getMessage()); |
|
99 | + $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: '.$e->getMessage()); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $result->setResponse($response); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } else { |
50 | 50 | $uri = new Uri($url); |
51 | 51 | } |
52 | - $this->urls[(string)$uri] = ['url' => $uri, 'system' => $key]; |
|
52 | + $this->urls[(string) $uri] = ['url' => $uri, 'system' => $key]; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | $this->urlStack = $this->urls; |
@@ -109,20 +109,20 @@ discard block |
||
109 | 109 | if (strpos($corruptUrl, '/') === 0) { |
110 | 110 | |
111 | 111 | $mainUri = $request->getUri(); |
112 | - $this->redirects[(string)$mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl] = (string)$mainUri; |
|
112 | + $this->redirects[(string) $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl] = (string) $mainUri; |
|
113 | 113 | |
114 | - $this->urls[] = ['url' => $mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl, 'system' => $url['system']]; |
|
115 | - $this->urlStack[] = ['url' => $mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl, 'system' => $url['system']]; |
|
114 | + $this->urls[] = ['url' => $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl, 'system' => $url['system']]; |
|
115 | + $this->urlStack[] = ['url' => $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl, 'system' => $url['system']]; |
|
116 | 116 | |
117 | 117 | return $this->next(); |
118 | 118 | } |
119 | 119 | |
120 | 120 | // the error handling should be done withing the calling class |
121 | - echo "\n " . $exception->getMessage() . "\n"; |
|
121 | + echo "\n ".$exception->getMessage()."\n"; |
|
122 | 122 | |
123 | 123 | return $this->next(); |
124 | 124 | } else { |
125 | - $errorMessages .= $exception->getMessage() . "\n"; |
|
125 | + $errorMessages .= $exception->getMessage()."\n"; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | if ($errorMessages !== '') { |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | |
140 | 140 | public function getOriginUri(UriInterface $uri) |
141 | 141 | { |
142 | - if (array_key_exists((string)$uri, $this->redirects)) { |
|
143 | - return $this->urls[$this->redirects[(string)$uri]]['url']; |
|
142 | + if (array_key_exists((string) $uri, $this->redirects)) { |
|
143 | + return $this->urls[$this->redirects[(string) $uri]]['url']; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $uri; |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | |
154 | 154 | public function getSystem(UriInterface $uri) |
155 | 155 | { |
156 | - if (array_key_exists((string)$uri, $this->redirects)) { |
|
157 | - return $this->urls[$this->redirects[(string)$uri]]['system']; |
|
156 | + if (array_key_exists((string) $uri, $this->redirects)) { |
|
157 | + return $this->urls[$this->redirects[(string) $uri]]['system']; |
|
158 | 158 | } |
159 | 159 | |
160 | - return $this->urls[(string)$uri]['system']; |
|
160 | + return $this->urls[(string) $uri]['system']; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | public function getSystems() |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | public function init($filters = array(), $filterFile = '', $exclusive = array()) |
43 | 43 | { |
44 | 44 | if (count($exclusive) > 0 && (count($filters) > 0 || $filterFile !== '')) { |
45 | - throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: " . get_class($this) . '].'); |
|
45 | + throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: ".get_class($this).'].'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | if ($filterFile !== '') { |
49 | 49 | if (!file_exists($filterFile)) { |
50 | - throw new \RuntimeException('Filter file not found: ' . $filterFile); |
|
50 | + throw new \RuntimeException('Filter file not found: '.$filterFile); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $filterElements = EnvAwareYaml::parse(file_get_contents($filterFile)); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if (is_array($urls)) { |
73 | 73 | foreach ($urls as $url) { |
74 | 74 | $uri = new Uri($url); |
75 | - $this->exclusives[$rule][] = (string)$uri; |
|
75 | + $this->exclusives[$rule][] = (string) $uri; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function isFiltered(Event $event, $ruleName, UriAwareResponse $response) |
95 | 95 | { |
96 | - $uri = (string)$this->retriever->getOriginUri($response->getUri()); |
|
96 | + $uri = (string) $this->retriever->getOriginUri($response->getUri()); |
|
97 | 97 | |
98 | 98 | if ($this->currentModus === self::MODUS_FILTER) { |
99 | 99 | $isFiltered = $this->isFilteredByFilter($ruleName, $uri); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | private function isFilteredByFilter($ruleName, $uri) |
113 | 113 | { |
114 | 114 | foreach ($this->filters as $filter) { |
115 | - if ($ruleName === $filter['rule'] && 0 < preg_match('$' . $filter['uri'] . '$', $uri)) { |
|
115 | + if ($ruleName === $filter['rule'] && 0 < preg_match('$'.$filter['uri'].'$', $uri)) { |
|
116 | 116 | return true; |
117 | 117 | } |
118 | 118 | } |