@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | private function initConfiguration($num_urls, $run_level, Uri $uri, Dispatcher $dispatcher) |
| 55 | 55 | { |
| 56 | - $configArray = $this->getConfigArray(__DIR__ . '/../../settings/' . self::CONFIG_FILE); |
|
| 56 | + $configArray = $this->getConfigArray(__DIR__.'/../../settings/'.self::CONFIG_FILE); |
|
| 57 | 57 | |
| 58 | 58 | $config = new Configuration($uri, $dispatcher, $configArray); |
| 59 | 59 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | private function initConfiguration(Uri $uri, Dispatcher $dispatcher) |
| 58 | 58 | { |
| 59 | - $configArray = $this->getConfigArray(__DIR__ . '/../../settings/warmup.yml'); |
|
| 59 | + $configArray = $this->getConfigArray(__DIR__.'/../../settings/warmup.yml'); |
|
| 60 | 60 | |
| 61 | 61 | $config = new Configuration($uri, $dispatcher, $configArray); |
| 62 | 62 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | private function initConfigArray(array $configArray, array $defaultSettings = null) |
| 47 | 47 | { |
| 48 | 48 | if ($defaultSettings === null) { |
| 49 | - $defaultSettings = Yaml::parse(file_get_contents(__DIR__ . '/../settings/' . self::DEFAULT_SETTINGS)); |
|
| 49 | + $defaultSettings = Yaml::parse(file_get_contents(__DIR__.'/../settings/'.self::DEFAULT_SETTINGS)); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | if (count($configArray) === 0) { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if ($this->hasSection($section)) { |
| 127 | 127 | return $this->configArray[$section]; |
| 128 | 128 | } else { |
| 129 | - throw new \RuntimeException('The section (' . $section . ') you are trying to access does not exist.'); |
|
| 129 | + throw new \RuntimeException('The section ('.$section.') you are trying to access does not exist.'); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if (array_key_exists($name, $this->extensions)) { |
| 136 | 136 | return $this->extensions[$name]; |
| 137 | 137 | } else { |
| 138 | - throw new \RuntimeException('The extension ("' . $name . '") you are trying to access does not exist. Registered extensions are: ' . implode(' ,', array_keys($this->extensions)) . '.'); |
|
| 138 | + throw new \RuntimeException('The extension ("'.$name.'") you are trying to access does not exist. Registered extensions are: '.implode(' ,', array_keys($this->extensions)).'.'); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
@@ -53,20 +53,20 @@ |
||
| 53 | 53 | /* @var \Ivory\HttpAdapter\HttpAdapterException $exception */ |
| 54 | 54 | |
| 55 | 55 | $mainUri = $request->getUri(); |
| 56 | - $this->redirects[(string) $mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl] = (string) $mainUri; |
|
| 56 | + $this->redirects[(string) $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl] = (string) $mainUri; |
|
| 57 | 57 | |
| 58 | - $this->urls[] = ['url' => $mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl, 'system' => $url['system']]; |
|
| 59 | - $this->urlStack[] = ['url' => $mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl, 'system' => $url['system']]; |
|
| 58 | + $this->urls[] = ['url' => $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl, 'system' => $url['system']]; |
|
| 59 | + $this->urlStack[] = ['url' => $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl, 'system' => $url['system']]; |
|
| 60 | 60 | |
| 61 | 61 | return $this->next(); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // the error handling should be done withing the calling class |
| 65 | - echo "\n " . $exception->getMessage() . "\n"; |
|
| 65 | + echo "\n ".$exception->getMessage()."\n"; |
|
| 66 | 66 | |
| 67 | 67 | return $this->next(); |
| 68 | 68 | } else { |
| 69 | - $errorMessages .= $exception->getMessage() . "\n"; |
|
| 69 | + $errorMessages .= $exception->getMessage()."\n"; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | if ($errorMessages !== '') { |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | if (array_key_exists($name, $this->stopStrategies)) { |
| 45 | 45 | return $this->stopStrategies[$name]; |
| 46 | 46 | } else { |
| 47 | - throw new \RuntimeException("Strategy ('" . $name . "') not found. Available strategies are " . implode(', ', array_keys($this->stopStrategies))); |
|
| 47 | + throw new \RuntimeException("Strategy ('".$name."') not found. Available strategies are ".implode(', ', array_keys($this->stopStrategies))); |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | public function init($filters = array(), $filterFile = '', $exclusive = array()) |
| 42 | 42 | { |
| 43 | 43 | if (count($exclusive) > 0 && (count($filters) > 0 || $filterFile !== '')) { |
| 44 | - throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: " . get_class($this) . '].'); |
|
| 44 | + throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: ".get_class($this).'].'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if ($filterFile !== '') { |
| 48 | 48 | if (!file_exists($filterFile)) { |
| 49 | - throw new \RuntimeException('Filter file not found: ' . $filterFile); |
|
| 49 | + throw new \RuntimeException('Filter file not found: '.$filterFile); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $filterElements = EnvAwareYaml::parse(file_get_contents($filterFile)); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | private function isFilteredByFilter($ruleName, $uri) |
| 106 | 106 | { |
| 107 | 107 | foreach ($this->filters as $filter) { |
| 108 | - if ($ruleName === $filter['rule'] && 0 < preg_match('$' . $filter['uri'] . '$', $uri)) { |
|
| 108 | + if ($ruleName === $filter['rule'] && 0 < preg_match('$'.$filter['uri'].'$', $uri)) { |
|
| 109 | 109 | return true; |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | if ($result->isFailure()) { |
| 56 | 56 | if (array_key_exists($ruleKey, $result->getMessages())) { |
| 57 | 57 | $messages = $result->getMessages(); |
| 58 | - $failedUrls[] = (string) $result->getUrl() . ' - ' . $messages[$ruleKey]; |
|
| 58 | + $failedUrls[] = (string) $result->getUrl().' - '.$messages[$ruleKey]; |
|
| 59 | 59 | ++$count; |
| 60 | 60 | } |
| 61 | 61 | if ($count > $this->maxResults) { |
| 62 | - $failedUrls[] = '... only the first ' . $this->maxResults . ' elements are shown.'; |
|
| 62 | + $failedUrls[] = '... only the first '.$this->maxResults.' elements are shown.'; |
|
| 63 | 63 | break; |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -77,15 +77,15 @@ discard block |
||
| 77 | 77 | $failedUrls = $this->getFailedUrls($ruleKey); |
| 78 | 78 | |
| 79 | 79 | if (count($failedUrls) > 0) { |
| 80 | - $this->output->writeln(' <error> ' . get_class($rule) . ' </error>'); |
|
| 80 | + $this->output->writeln(' <error> '.get_class($rule).' </error>'); |
|
| 81 | 81 | } else { |
| 82 | - $this->output->writeln(' <info> ' . get_class($rule) . ' </info>'); |
|
| 82 | + $this->output->writeln(' <info> '.get_class($rule).' </info>'); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $this->output->writeln(' ' . str_replace("\n", "\n ", $info['documentation']) . "\n"); |
|
| 85 | + $this->output->writeln(' '.str_replace("\n", "\n ", $info['documentation'])."\n"); |
|
| 86 | 86 | |
| 87 | 87 | foreach ($failedUrls as $failedUrl) { |
| 88 | - $this->output->writeln(' - ' . $failedUrl); |
|
| 88 | + $this->output->writeln(' - '.$failedUrl); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $this->output->writeln(''); |
@@ -18,13 +18,13 @@ |
||
| 18 | 18 | public function processResult(Result $result) |
| 19 | 19 | { |
| 20 | 20 | ++$this->urlCount; |
| 21 | - $this->output->writeln(' ' . $result->getUrl()); |
|
| 21 | + $this->output->writeln(' '.$result->getUrl()); |
|
| 22 | 22 | $this->output->writeln(''); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function finish() |
| 26 | 26 | { |
| 27 | - $this->output->writeln(' <comment>Warm up finished. ' . $this->urlCount . ' urls visited.</comment>'); |
|
| 27 | + $this->output->writeln(' <comment>Warm up finished. '.$this->urlCount.' urls visited.</comment>'); |
|
| 28 | 28 | $this->output->writeln(''); |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | $testCase->addFailure(new Failure($ruleName, $message)); |
| 83 | 83 | |
| 84 | 84 | if ($this->retriever instanceof CrawlingRetriever) { |
| 85 | - $stackTrace = $result->getUrl() . ' coming from ' . (string) $this->retriever->getComingFrom($result->getUrl()) . PHP_EOL; |
|
| 86 | - $stackTrace .= ' - ' . $message . " [rule: $ruleName]"; |
|
| 85 | + $stackTrace = $result->getUrl().' coming from '.(string) $this->retriever->getComingFrom($result->getUrl()).PHP_EOL; |
|
| 86 | + $stackTrace .= ' - '.$message." [rule: $ruleName]"; |
|
| 87 | 87 | $testCase->setSystemOut($stackTrace); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -94,6 +94,6 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | file_put_contents($this->filename, $xUnitReport->toXml()); |
| 96 | 96 | |
| 97 | - $this->output->writeln(' <info>Writing XUnit Output to file:</info> ' . $this->filename); |
|
| 97 | + $this->output->writeln(' <info>Writing XUnit Output to file:</info> '.$this->filename); |
|
| 98 | 98 | } |
| 99 | 99 | } |