@@ -2,12 +2,12 @@ |
||
2 | 2 | |
3 | 3 | /* Find bootstrap path */ |
4 | 4 | $rootPath = realpath(dirname(__FILE__)); |
5 | -while (!file_exists($rootPath . '/app/bootstrap.php') && $rootPath !== '/') { |
|
5 | +while (!file_exists($rootPath.'/app/bootstrap.php') && $rootPath !== '/') { |
|
6 | 6 | $rootPath = realpath(dirname($rootPath)); |
7 | 7 | } |
8 | 8 | |
9 | 9 | /* Include Magento bootstrap file */ |
10 | -require_once $rootPath . '/app/bootstrap.php'; |
|
10 | +require_once $rootPath.'/app/bootstrap.php'; |
|
11 | 11 | |
12 | 12 | /* Create git hook class autoloader */ |
13 | 13 | $_git_hook_loaded_class = []; |
@@ -175,14 +175,14 @@ |
||
175 | 175 | #$start = microtime(true); |
176 | 176 | #fwrite(STDERR, "\n".'Validating link: '.$href); |
177 | 177 | $context = stream_context_create([ |
178 | - 'http' => [ |
|
179 | - 'method' => 'HEAD', |
|
180 | - 'protocol_version' => 1.1, |
|
181 | - 'header' => [ |
|
182 | - 'Connection: close', |
|
183 | - ], |
|
184 | - ], |
|
185 | - ]); |
|
178 | + 'http' => [ |
|
179 | + 'method' => 'HEAD', |
|
180 | + 'protocol_version' => 1.1, |
|
181 | + 'header' => [ |
|
182 | + 'Connection: close', |
|
183 | + ], |
|
184 | + ], |
|
185 | + ]); |
|
186 | 186 | $result = null; |
187 | 187 | try { |
188 | 188 | $headers = get_headers($href, 0, $context); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | private static function getMainReadme(string $projectRootDirectory): string |
30 | 30 | { |
31 | - $path = $projectRootDirectory . '/README.md'; |
|
31 | + $path = $projectRootDirectory.'/README.md'; |
|
32 | 32 | if (!is_file($path)) { |
33 | 33 | throw new \RuntimeException( |
34 | 34 | "\n\nYou have no README.md file in your project" |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | private static function getDocsFiles(string $projectRootDirectory): array |
49 | 49 | { |
50 | 50 | $files = []; |
51 | - $dir = $projectRootDirectory . '/docs'; |
|
51 | + $dir = $projectRootDirectory.'/docs'; |
|
52 | 52 | if (!is_dir($dir)) { |
53 | 53 | return $files; |
54 | 54 | } |
@@ -120,15 +120,15 @@ discard block |
||
120 | 120 | $start = \rtrim($projectRootDirectory, '/'); |
121 | 121 | if ($path[0] !== '/' || 0 === \strpos($path, './')) { |
122 | 122 | $relativeSubdirs = \preg_replace( |
123 | - '%^' . $projectRootDirectory . '%', |
|
123 | + '%^'.$projectRootDirectory.'%', |
|
124 | 124 | '', |
125 | 125 | \dirname($file) |
126 | 126 | ); |
127 | 127 | if ($relativeSubdirs !== null) { |
128 | - $start .= '/' . \rtrim($relativeSubdirs, '/'); |
|
128 | + $start .= '/'.\rtrim($relativeSubdirs, '/'); |
|
129 | 129 | } |
130 | 130 | } |
131 | - $realpath = \realpath($start . '/' . $path); |
|
131 | + $realpath = \realpath($start.'/'.$path); |
|
132 | 132 | if (false === $realpath) { |
133 | 133 | $errors[] = \sprintf("\nBad link for \"%s\" to \"%s\"\n", $link[1], $link[2]); |
134 | 134 | $return = 1; |
@@ -150,14 +150,14 @@ discard block |
||
150 | 150 | $files = static::getFiles($projectRootDirectory); |
151 | 151 | foreach ($files as $file) { |
152 | 152 | $relativeFile = str_replace($projectRootDirectory, '', $file); |
153 | - $title = "\n$relativeFile\n" . str_repeat('-', strlen($relativeFile)) . "\n"; |
|
153 | + $title = "\n$relativeFile\n".str_repeat('-', strlen($relativeFile))."\n"; |
|
154 | 154 | $errors = []; |
155 | 155 | $links = static::getLinks($file); |
156 | 156 | foreach ($links as $link) { |
157 | 157 | static::checkLink($projectRootDirectory, $link, $file, $errors, $return); |
158 | 158 | } |
159 | 159 | if ([] !== $errors) { |
160 | - echo $title . implode('', $errors); |
|
160 | + echo $title.implode('', $errors); |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | ], |
188 | 188 | ], |
189 | 189 | ]); |
190 | - $result = null; |
|
190 | + $result = null; |
|
191 | 191 | try { |
192 | 192 | $headers = get_headers($href, 0, $context); |
193 | 193 | if (false === $headers) { |
194 | - throw new \RuntimeException('Failed getting headers for href ' . $href); |
|
194 | + throw new \RuntimeException('Failed getting headers for href '.$href); |
|
195 | 195 | } |
196 | 196 | foreach ($headers as $header) { |
197 | 197 | if (false !== strpos($header, ' 200 ')) { |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $href, |
211 | 211 | var_export($result, true) |
212 | 212 | ); |
213 | - $return = 1; |
|
213 | + $return = 1; |
|
214 | 214 | #$time = round(microtime(true) - $start, 2); |
215 | 215 | #fwrite(STDERR, "\n".'Failed ('.$time.' seconds): '.$href); |
216 | 216 | } |
@@ -38,14 +38,14 @@ |
||
38 | 38 | */ |
39 | 39 | public static function getComposerJsonDecoded(string $path = null): array |
40 | 40 | { |
41 | - $path = $path ?? self::getProjectRootDirectory() . '/composer.json'; |
|
41 | + $path = $path ?? self::getProjectRootDirectory().'/composer.json'; |
|
42 | 42 | $contents = (string)\file_get_contents($path); |
43 | 43 | if ('' === $contents) { |
44 | 44 | throw new \RuntimeException('composer.json is empty'); |
45 | 45 | } |
46 | 46 | $decoded = \json_decode($contents, true); |
47 | 47 | if (JSON_ERROR_NONE !== \json_last_error()) { |
48 | - throw new \RuntimeException('Failed loading composer.json: ' . \json_last_error_msg()); |
|
48 | + throw new \RuntimeException('Failed loading composer.json: '.\json_last_error_msg()); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | return $decoded; |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | { |
44 | 44 | if (!is_dir($pathToTestsDirectory)) { |
45 | 45 | throw new \InvalidArgumentException( |
46 | - '$pathToTestsDirectory "' . $pathToTestsDirectory . '" does not exist"' |
|
46 | + '$pathToTestsDirectory "'.$pathToTestsDirectory.'" does not exist"' |
|
47 | 47 | ); |
48 | 48 | } |
49 | - $this->largePath = $pathToTestsDirectory . '/Large'; |
|
50 | - $this->mediumPath = $pathToTestsDirectory . '/Medium'; |
|
51 | - $this->smallPath = $pathToTestsDirectory . '/Small'; |
|
49 | + $this->largePath = $pathToTestsDirectory.'/Large'; |
|
50 | + $this->mediumPath = $pathToTestsDirectory.'/Medium'; |
|
51 | + $this->smallPath = $pathToTestsDirectory.'/Small'; |
|
52 | 52 | $this->checkLarge(); |
53 | 53 | $this->checkMedium(); |
54 | 54 | $this->checkSmall(); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | return; |
103 | 103 | } |
104 | 104 | |
105 | - $matches = []; |
|
105 | + $matches = []; |
|
106 | 106 | preg_match_all( |
107 | 107 | <<<REGEXP |
108 | 108 | %(?<docblock>/\*(?:[^*]|\n|(?:\*(?:[^/]|\n)))*\*/|\n)\s+?public\s+?function\s+?(?<method>.+?)\(% |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | foreach ($matches['method'] as $key => $method) { |
120 | 120 | $docblock = $matches['docblock'][$key]; |
121 | 121 | /* Found the annotation - continue */ |
122 | - if (false !== \strpos($docblock, '@' . $annotation)) { |
|
122 | + if (false !== \strpos($docblock, '@'.$annotation)) { |
|
123 | 123 | continue; |
124 | 124 | } |
125 | 125 | /* No @test annotation found & method not beginning test = not a test, so continue */ |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | continue; |
128 | 128 | } |
129 | 129 | $this->errors[$fileInfo->getFilename()][] = |
130 | - 'Failed finding @' . $annotation . ' for method: ' . $method; |
|
130 | + 'Failed finding @'.$annotation.' for method: '.$method; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | return false; |
157 | 157 | } |
158 | 158 | $docBlock = array_shift($matches['docblock']); |
159 | - return strpos($docBlock, '@' . $annotation) !== false; |
|
159 | + return strpos($docBlock, '@'.$annotation) !== false; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 |
@@ -178,7 +178,7 @@ |
||
178 | 178 | $invalidPathMessage = "Namespace root '$namespaceRoot'\ncontains a path '$path'\nwhich doesn't exist\n"; |
179 | 179 | if (stripos($absPathRoot, "Magento") !== false) { |
180 | 180 | $invalidPathMessage .= 'Magento\'s composer includes this by default, ' |
181 | - . 'it should be removed from the psr-4 section'; |
|
181 | + . 'it should be removed from the psr-4 section'; |
|
182 | 182 | } |
183 | 183 | $this->missingPaths[$path] = $invalidPathMessage; |
184 | 184 | } |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | ); |
117 | 117 | } |
118 | 118 | |
119 | - return rtrim($namespaceRoot . $relativeNs, '\\'); |
|
119 | + return rtrim($namespaceRoot.$relativeNs, '\\'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | private function getActualNamespace(\SplFileInfo $fileInfo): string |
123 | 123 | { |
124 | 124 | $contents = \file_get_contents($fileInfo->getPathname()); |
125 | 125 | if (false === $contents) { |
126 | - throw new \RuntimeException('Failed getting file contents for ' . $fileInfo->getPathname()); |
|
126 | + throw new \RuntimeException('Failed getting file contents for '.$fileInfo->getPathname()); |
|
127 | 127 | } |
128 | 128 | \preg_match('%namespace\s+?([^;]+)%', $contents, $matches); |
129 | 129 | if ([] === $matches) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $realPath, |
147 | 147 | \RecursiveDirectoryIterator::SKIP_DOTS |
148 | 148 | ); |
149 | - $iterator = new \RecursiveIteratorIterator( |
|
149 | + $iterator = new \RecursiveIteratorIterator( |
|
150 | 150 | $directoryIterator, |
151 | 151 | \RecursiveIteratorIterator::SELF_FIRST |
152 | 152 | ); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $paths = [$paths]; |
203 | 203 | } |
204 | 204 | foreach ($paths as $path) { |
205 | - $absPathRoot = $this->pathToProjectRoot . '/' . $path; |
|
205 | + $absPathRoot = $this->pathToProjectRoot.'/'.$path; |
|
206 | 206 | $realAbsPathRoot = \realpath($absPathRoot); |
207 | 207 | if (false === $realAbsPathRoot) { |
208 | 208 | $this->addMissingPathError($path, $namespaceRoot, $absPathRoot); |