@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $paths = [$paths]; |
117 | 117 | } |
118 | 118 | foreach ($paths as $path) { |
119 | - $absPathRoot = $this->pathToProjectRoot . '/' . $path; |
|
119 | + $absPathRoot = $this->pathToProjectRoot.'/'.$path; |
|
120 | 120 | $realAbsPathRoot = \realpath($absPathRoot); |
121 | 121 | if ($realAbsPathRoot === false) { |
122 | 122 | $this->addMissingPathError($path, $namespaceRoot, $absPathRoot); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $realPath, |
166 | 166 | RecursiveDirectoryIterator::SKIP_DOTS |
167 | 167 | ); |
168 | - $iterator = new RecursiveIteratorIterator( |
|
168 | + $iterator = new RecursiveIteratorIterator( |
|
169 | 169 | $directoryIterator, |
170 | 170 | RecursiveIteratorIterator::SELF_FIRST |
171 | 171 | ); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | { |
214 | 214 | $contents = \file_get_contents($fileInfo->getPathname()); |
215 | 215 | if ($contents === false) { |
216 | - throw new RuntimeException('Failed getting file contents for ' . $fileInfo->getPathname()); |
|
216 | + throw new RuntimeException('Failed getting file contents for '.$fileInfo->getPathname()); |
|
217 | 217 | } |
218 | 218 | $matches = null; |
219 | 219 | \preg_match('%namespace\s+?([^;]+)%', $contents, $matches); |
@@ -239,6 +239,6 @@ discard block |
||
239 | 239 | ); |
240 | 240 | } |
241 | 241 | |
242 | - return rtrim($namespaceRoot . $relativeNs, '\\'); |
|
242 | + return rtrim($namespaceRoot.$relativeNs, '\\'); |
|
243 | 243 | } |
244 | 244 | } |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | $files = static::getFiles($projectRootDirectory); |
40 | 40 | foreach ($files as $file) { |
41 | 41 | $relativeFile = str_replace($projectRootDirectory, '', $file); |
42 | - $title = "\n{$relativeFile}\n" . str_repeat('-', strlen($relativeFile)) . "\n"; |
|
42 | + $title = "\n{$relativeFile}\n".str_repeat('-', strlen($relativeFile))."\n"; |
|
43 | 43 | $errors = []; |
44 | 44 | $links = static::getLinks($file); |
45 | 45 | foreach ($links as $link) { |
46 | 46 | static::checkLink($projectRootDirectory, $link, $file, $errors, $return); |
47 | 47 | } |
48 | 48 | if ([] !== $errors) { |
49 | - echo $title . implode('', $errors); |
|
49 | + echo $title.implode('', $errors); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | private static function getDocsFiles(string $projectRootDirectory): array |
74 | 74 | { |
75 | 75 | $files = []; |
76 | - $dir = $projectRootDirectory . '/docs'; |
|
76 | + $dir = $projectRootDirectory.'/docs'; |
|
77 | 77 | if (!is_dir($dir)) { |
78 | 78 | return $files; |
79 | 79 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | private static function getMainReadme(string $projectRootDirectory): string |
100 | 100 | { |
101 | - $path = $projectRootDirectory . '/README.md'; |
|
101 | + $path = $projectRootDirectory.'/README.md'; |
|
102 | 102 | if (!is_file($path)) { |
103 | 103 | throw new RuntimeException( |
104 | 104 | "\n\nYou have no README.md file in your project" |
@@ -160,15 +160,15 @@ discard block |
||
160 | 160 | $start = rtrim($projectRootDirectory, '/'); |
161 | 161 | if ($path[0] !== '/' || strpos($path, './') === 0) { |
162 | 162 | $relativeSubdirs = preg_replace( |
163 | - '%^' . $projectRootDirectory . '%', |
|
163 | + '%^'.$projectRootDirectory.'%', |
|
164 | 164 | '', |
165 | 165 | dirname($file) |
166 | 166 | ); |
167 | 167 | if ($relativeSubdirs !== null) { |
168 | - $start .= '/' . rtrim($relativeSubdirs, '/'); |
|
168 | + $start .= '/'.rtrim($relativeSubdirs, '/'); |
|
169 | 169 | } |
170 | 170 | } |
171 | - $realpath = realpath($start . '/' . $path); |
|
171 | + $realpath = realpath($start.'/'.$path); |
|
172 | 172 | if ($realpath === false) { |
173 | 173 | $errors[] = sprintf("\nBad link for \"%s\" to \"%s\"\n", $link[1], $link[2]); |
174 | 174 | $return = 1; |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | ], |
204 | 204 | ] |
205 | 205 | ); |
206 | - $result = null; |
|
206 | + $result = null; |
|
207 | 207 | try { |
208 | 208 | $headers = get_headers($href, 0, $context); |
209 | 209 | if ($headers === false) { |
210 | - throw new RuntimeException('Failed getting headers for href ' . $href); |
|
210 | + throw new RuntimeException('Failed getting headers for href '.$href); |
|
211 | 211 | } |
212 | 212 | foreach ($headers as $header) { |
213 | 213 | if (strpos($header, ' 200 ') !== false) { |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | } |
220 | 220 | } catch (Throwable $e) { |
221 | - throw new RuntimeException('Unexpected error ' . $e->getMessage(), $e->getCode(), $e); |
|
221 | + throw new RuntimeException('Unexpected error '.$e->getMessage(), $e->getCode(), $e); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | $errors[] = sprintf( |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $href, |
228 | 228 | var_export($result, true) |
229 | 229 | ); |
230 | - $return = 1; |
|
230 | + $return = 1; |
|
231 | 231 | //$time = round(microtime(true) - $start, 2); |
232 | 232 | //fwrite(STDERR, "\n".'Failed ('.$time.' seconds): '.$href); |
233 | 233 | } |