Completed
Push — master ( ca53a0...88b32b )
by Nils
04:29
created
src/Rules/CheckResult.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * Result constructor.
27 27
      *
28 28
      * @param $status
29
-     * @param $value
29
+     * @param integer $value
30 30
      * @param $message
31 31
      */
32 32
     public function __construct($status, $message = '', $value = null)
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     /**
48
-     * @param array $attributes
48
+     * @param array $attribute
49 49
      */
50 50
     public function addAttribute(Attribute $attribute)
51 51
     {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     }
70 70
 
71 71
     /**
72
-     * @return mixed
72
+     * @return string
73 73
      */
74 74
     public function getMessage()
75 75
     {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     }
86 86
 
87 87
     /**
88
-     * @param Response $response
88
+     * @param ResponseInterface $response
89 89
      */
90 90
     public function setResponse(ResponseInterface $response)
91 91
     {
Please login to merge, or discard this patch.
src/Rules/Html/CssFileCountRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Psr\Http\Message\ResponseInterface;
6 6
 use whm\Html\Document;
7
-use whm\Smoke\Http\Response;
8 7
 
9 8
 /**
10 9
  * This rules counts the css files that are included in a document. If the number is higher
Please login to merge, or discard this patch.
src/Rules/Html/JsFileCountRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Psr\Http\Message\ResponseInterface;
6 6
 use whm\Html\Document;
7
-use whm\Smoke\Http\Response;
8 7
 
9 8
 /**
10 9
  * This rules counts the js files that are included in a document. If the number is higher
Please login to merge, or discard this patch.
src/Rules/Html/NoIndexRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Psr\Http\Message\ResponseInterface;
6 6
 use Symfony\Component\DomCrawler\Crawler;
7
-use whm\Smoke\Http\Response;
8 7
 use whm\Smoke\Rules\StandardRule;
9 8
 
10 9
 /**
Please login to merge, or discard this patch.
src/Rules/Seo/PageSpeedRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace whm\Smoke\Rules\Seo;
4 4
 
5 5
 use Psr\Http\Message\ResponseInterface;
6
-use whm\Smoke\Http\Response;
7 6
 use whm\Smoke\Rules\Rule;
8 7
 use whm\Smoke\Rules\ValidationFailedException;
9 8
 
Please login to merge, or discard this patch.
src/Rules/StandardRule.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -28,6 +28,10 @@
 block discarded – undo
28 28
 
29 29
     abstract protected function doValidation(ResponseInterface $response);
30 30
 
31
+    /**
32
+     * @param boolean $valueToBeTrue
33
+     * @param string $errorMessage
34
+     */
31 35
     protected function assert($valueToBeTrue, $errorMessage)
32 36
     {
33 37
         if (!$valueToBeTrue) {
Please login to merge, or discard this patch.
src/Extensions/SmokeFilter/FilterExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
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));
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function isFiltered(Event $event, $ruleName, UriAwareResponse $response)
87 87
     {
88
-        $uri = (string)$this->retriever->getOriginUri($response->getUri());
88
+        $uri = (string) $this->retriever->getOriginUri($response->getUri());
89 89
 
90 90
         if ($this->currentModus === self::MODUS_FILTER) {
91 91
             $isFiltered = $this->isFilteredByFilter($ruleName, $uri);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     private function isFilteredByFilter($ruleName, $uri)
105 105
     {
106 106
         foreach ($this->filters as $filter) {
107
-            if ($ruleName === $filter['rule'] && 0 < preg_match('$' . $filter['uri'] . '$', $uri)) {
107
+            if ($ruleName === $filter['rule'] && 0 < preg_match('$'.$filter['uri'].'$', $uri)) {
108 108
                 return true;
109 109
             }
110 110
         }
Please login to merge, or discard this patch.
src/Extensions/SmokeResponseRetriever/Retriever/ListRetriever/Retriever.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -109,20 +109,20 @@  discard block
 block discarded – undo
109 109
                         /* @var \Ivory\HttpAdapter\HttpAdapterException $exception */
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 !== '') {
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 
136 136
     public function getOriginUri(UriInterface $uri)
137 137
     {
138
-        if (array_key_exists((string)$uri, $this->redirects)) {
139
-            return $this->urls[$this->redirects[(string)$uri]]['url'];
138
+        if (array_key_exists((string) $uri, $this->redirects)) {
139
+            return $this->urls[$this->redirects[(string) $uri]]['url'];
140 140
         }
141 141
 
142 142
         return $uri;
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 
150 150
     public function getSystem(UriInterface $uri)
151 151
     {
152
-        if (array_key_exists((string)$uri, $this->redirects)) {
153
-            return $this->urls[$this->redirects[(string)$uri]]['system'];
152
+        if (array_key_exists((string) $uri, $this->redirects)) {
153
+            return $this->urls[$this->redirects[(string) $uri]]['system'];
154 154
         }
155 155
 
156
-        return $this->urls[(string)$uri]['system'];
156
+        return $this->urls[(string) $uri]['system'];
157 157
     }
158 158
 
159 159
     public function getSystems()
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/XUnitReporter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $failures = 0;
60 60
 
61 61
         if ($this->retriever instanceof CrawlingRetriever) {
62
-            $startPage = (string)$this->retriever->getStartPage();
62
+            $startPage = (string) $this->retriever->getStartPage();
63 63
         } else {
64 64
             $startPage = '';
65 65
         }
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
                     $testCase->addFailure(new Failure($ruleName, $message));
81 81
 
82 82
                     if ($this->retriever instanceof CrawlingRetriever) {
83
-                        $stackTrace = $result->getUrl() . ' coming from ' . (string)$this->retriever->getComingFrom($result->getUrl()) . PHP_EOL;
84
-                        $stackTrace .= '    - ' . $message . " [rule: $ruleName]";
83
+                        $stackTrace = $result->getUrl().' coming from '.(string) $this->retriever->getComingFrom($result->getUrl()).PHP_EOL;
84
+                        $stackTrace .= '    - '.$message." [rule: $ruleName]";
85 85
                         $testCase->setSystemOut($stackTrace);
86 86
                     }
87 87
                 }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
         file_put_contents($this->filename, $xUnitReport->toXml());
94 94
 
95
-        $this->output->writeln('    <info>Writing XUnit Output to file:</info> ' . $this->filename);
95
+        $this->output->writeln('    <info>Writing XUnit Output to file:</info> '.$this->filename);
96 96
     }
97 97
 
98 98
     public function processResults($results)
Please login to merge, or discard this patch.