@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | /** |
17 | 17 | * Get all of the listeners and their corresponding events. |
18 | 18 | * |
19 | - * @param iterable $paths |
|
19 | + * @param \Symfony\Component\Finder\Finder $paths |
|
20 | 20 | * @param $composerPath |
21 | 21 | * @param $composerNamespace |
22 | - * @param $command |
|
22 | + * @param Commands\CheckPsr4 $command |
|
23 | 23 | * |
24 | 24 | * @return void |
25 | 25 | */ |
@@ -82,6 +82,9 @@ discard block |
||
82 | 82 | app(ErrorPrinter::class)->counts['total'] = 0; |
83 | 83 | } |
84 | 84 | |
85 | + /** |
|
86 | + * @param string $relativePath |
|
87 | + */ |
|
85 | 88 | private static function warn($currentNamespace, $relativePath) |
86 | 89 | { |
87 | 90 | $p = app(ErrorPrinter::class); |
@@ -103,6 +106,9 @@ discard block |
||
103 | 106 | return Str::startsWith($buffer, '<?php'); |
104 | 107 | } |
105 | 108 | |
109 | + /** |
|
110 | + * @param string $correctNamespace |
|
111 | + */ |
|
106 | 112 | protected static function doNamespaceCorrection($absFilePath, $currentNamespace, $correctNamespace) |
107 | 113 | { |
108 | 114 | event('laravel_microscope.namespace_fixing', get_defined_vars()); |
@@ -110,6 +116,9 @@ discard block |
||
110 | 116 | event('laravel_microscope.namespace_fixed', get_defined_vars()); |
111 | 117 | } |
112 | 118 | |
119 | + /** |
|
120 | + * @param string $correctNamespace |
|
121 | + */ |
|
113 | 122 | private static function ask($command, $correctNamespace) |
114 | 123 | { |
115 | 124 | return $command->getOutput()->confirm('Do you want to change it to: '.$correctNamespace, true); |
@@ -4,18 +4,18 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Console\Command; |
6 | 6 | use Illuminate\Support\Composer; |
7 | -use Symfony\Component\Finder\Finder; |
|
8 | 7 | use Illuminate\Support\Facades\View; |
9 | -use Imanghafoori\LaravelMicroscope\CheckNamespaces; |
|
10 | -use Imanghafoori\LaravelMicroscope\FileReaders\Paths; |
|
11 | -use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
12 | -use Imanghafoori\LaravelMicroscope\SpyClasses\RoutePaths; |
|
13 | 8 | use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson; |
9 | +use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
10 | +use Imanghafoori\LaravelMicroscope\CheckNamespaces; |
|
14 | 11 | use Imanghafoori\LaravelMicroscope\Contracts\FileCheckContract; |
15 | 12 | use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter; |
13 | +use Imanghafoori\LaravelMicroscope\FileReaders\Paths; |
|
14 | +use Imanghafoori\LaravelMicroscope\LaravelPaths\MigrationPaths; |
|
15 | +use Imanghafoori\LaravelMicroscope\SpyClasses\RoutePaths; |
|
16 | 16 | use Imanghafoori\LaravelMicroscope\Traits\LogsErrors; |
17 | 17 | use Imanghafoori\LaravelMicroscope\Traits\ScansFiles; |
18 | -use Imanghafoori\LaravelMicroscope\LaravelPaths\MigrationPaths; |
|
18 | +use Symfony\Component\Finder\Finder; |
|
19 | 19 | |
20 | 20 | class CheckPsr4 extends Command implements FileCheckContract |
21 | 21 | { |
@@ -62,6 +62,10 @@ discard block |
||
62 | 62 | $this->pendError($absPath, $lineNumber, $relatedModel, 'badRelation', $header); |
63 | 63 | } |
64 | 64 | |
65 | + /** |
|
66 | + * @param string $key |
|
67 | + * @param string $header |
|
68 | + */ |
|
65 | 69 | public function pendError($path, $lineNumber, $absent, $key, $header) |
66 | 70 | { |
67 | 71 | array_push($this->counts[$key], (new PendingError($key)) |
@@ -79,6 +83,11 @@ discard block |
||
79 | 83 | ->link($absPath, $lineNumber)); |
80 | 84 | } |
81 | 85 | |
86 | + /** |
|
87 | + * @param string $absent |
|
88 | + * @param string $key |
|
89 | + * @param string $header |
|
90 | + */ |
|
82 | 91 | public function simplePendError($path, $lineNumber, $absent, $key, $header) |
83 | 92 | { |
84 | 93 | array_push($this->counts[$key], (new PendingError($key)) |
@@ -165,6 +174,9 @@ discard block |
||
165 | 174 | ->link($absPath, $lineNumber)); |
166 | 175 | } |
167 | 176 | |
177 | + /** |
|
178 | + * @param integer $len |
|
179 | + */ |
|
168 | 180 | public function print($msg, $path = '| ', $len = null) |
169 | 181 | { |
170 | 182 | ! $len && $len = PendingError::$maxLength + 1; |
@@ -180,6 +192,9 @@ discard block |
||
180 | 192 | $this->printer->writeln($path.$msg.str_repeat(' ', $len).'|'); |
181 | 193 | } |
182 | 194 | |
195 | + /** |
|
196 | + * @param string $msg |
|
197 | + */ |
|
183 | 198 | public function printHeader($msg) |
184 | 199 | { |
185 | 200 | $this->print(''); |