@@ -50,8 +50,8 @@ |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * @param $incorrectNamespace |
|
54 | - * @param $correctNamespace |
|
53 | + * @param string $incorrectNamespace |
|
54 | + * @param string $correctNamespace |
|
55 | 55 | * |
56 | 56 | * @return array |
57 | 57 | */ |
@@ -63,6 +63,9 @@ |
||
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | + /** |
|
67 | + * @return string |
|
68 | + */ |
|
66 | 69 | private function stringify($event) |
67 | 70 | { |
68 | 71 | return is_object($event) ? get_class($event) : $event; |
@@ -6,9 +6,9 @@ |
||
6 | 6 | use Illuminate\Console\Command; |
7 | 7 | use Illuminate\Routing\Router; |
8 | 8 | use Illuminate\Support\Str; |
9 | -use Imanghafoori\LaravelMicroscope\CheckBladeFiles; |
|
10 | -use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
11 | 9 | use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson; |
10 | +use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
11 | +use Imanghafoori\LaravelMicroscope\CheckBladeFiles; |
|
12 | 12 | use Imanghafoori\LaravelMicroscope\Checks\CheckRouteCalls; |
13 | 13 | use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter; |
14 | 14 | use Imanghafoori\LaravelMicroscope\Traits\LogsErrors; |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Console\Command; |
6 | 6 | use Illuminate\Support\Facades\View; |
7 | -use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
8 | -use Imanghafoori\LaravelMicroscope\SpyClasses\RoutePaths; |
|
9 | -use Imanghafoori\LaravelMicroscope\ErrorTypes\BladeFile; |
|
10 | 7 | use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson; |
11 | -use Imanghafoori\LaravelMicroscope\CheckBladeFiles; |
|
8 | +use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
12 | 9 | use Imanghafoori\LaravelMicroscope\Analyzers\FunctionCall; |
10 | +use Imanghafoori\LaravelMicroscope\CheckBladeFiles; |
|
13 | 11 | use Imanghafoori\LaravelMicroscope\Checks\CheckViewFilesExistence; |
12 | +use Imanghafoori\LaravelMicroscope\ErrorTypes\BladeFile; |
|
13 | +use Imanghafoori\LaravelMicroscope\SpyClasses\RoutePaths; |
|
14 | 14 | |
15 | 15 | class CheckViews extends Command |
16 | 16 | { |
@@ -55,6 +55,9 @@ |
||
55 | 55 | $this->composerDumpIfNeeded($errorPrinter); |
56 | 56 | } |
57 | 57 | |
58 | + /** |
|
59 | + * @param ErrorPrinter $errorPrinter |
|
60 | + */ |
|
58 | 61 | private function composerDumpIfNeeded($errorPrinter) |
59 | 62 | { |
60 | 63 | if ($errorPrinter->counts['badNamespace']) { |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Console\Command; |
6 | 6 | use Illuminate\Support\Composer; |
7 | -use Imanghafoori\LaravelMicroscope\CheckNamespaces; |
|
8 | -use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
9 | 7 | use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson; |
8 | +use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
|
9 | +use Imanghafoori\LaravelMicroscope\CheckNamespaces; |
|
10 | 10 | use Imanghafoori\LaravelMicroscope\Contracts\FileCheckContract; |
11 | 11 | use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter; |
12 | 12 | use Imanghafoori\LaravelMicroscope\Traits\LogsErrors; |
@@ -3,9 +3,9 @@ |
||
3 | 3 | namespace Imanghafoori\LaravelMicroscope\Commands; |
4 | 4 | |
5 | 5 | use Illuminate\Console\Command; |
6 | +use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson; |
|
6 | 7 | use Imanghafoori\LaravelMicroscope\Analyzers\FilePath; |
7 | 8 | use Imanghafoori\LaravelMicroscope\Analyzers\Refactor; |
8 | -use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson; |
|
9 | 9 | |
10 | 10 | class CheckEarlyReturns extends Command |
11 | 11 | { |
@@ -83,6 +83,9 @@ |
||
83 | 83 | return [$fixes, $tokens]; |
84 | 84 | } |
85 | 85 | |
86 | + /** |
|
87 | + * @param integer $fixed |
|
88 | + */ |
|
86 | 89 | private function printFinalMsg($fixed) |
87 | 90 | { |
88 | 91 | $msg = $fixed > 0 |
@@ -2,13 +2,14 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Imanghafoori\LaravelMicroscope; |
4 | 4 | |
5 | -use Imanghafoori\LaravelMicroscope\Commands\CheckDD; |
|
6 | 5 | use Illuminate\Contracts\Auth\Access\Gate as GateContract; |
7 | 6 | use Illuminate\Contracts\Queue\Factory as QueueFactoryContract; |
8 | 7 | use Illuminate\Support\Facades\Event; |
9 | 8 | use Illuminate\Support\Facades\Route; |
10 | 9 | use Illuminate\Support\ServiceProvider; |
11 | 10 | use Imanghafoori\LaravelMicroscope\Commands\CheckAll; |
11 | +use Imanghafoori\LaravelMicroscope\Commands\CheckDD; |
|
12 | +use Imanghafoori\LaravelMicroscope\Commands\CheckEarlyReturns; |
|
12 | 13 | use Imanghafoori\LaravelMicroscope\Commands\CheckEvents; |
13 | 14 | use Imanghafoori\LaravelMicroscope\Commands\CheckGates; |
14 | 15 | use Imanghafoori\LaravelMicroscope\Commands\CheckImports; |
@@ -16,12 +17,11 @@ discard block |
||
16 | 17 | use Imanghafoori\LaravelMicroscope\Commands\CheckRoutes; |
17 | 18 | use Imanghafoori\LaravelMicroscope\Commands\CheckViews; |
18 | 19 | use Imanghafoori\LaravelMicroscope\Commands\ClassifyStrings; |
19 | -use Imanghafoori\LaravelMicroscope\Commands\CheckEarlyReturns; |
|
20 | +use Imanghafoori\LaravelMicroscope\ErrorReporters\ConsolePrinterInstaller; |
|
20 | 21 | use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter; |
21 | 22 | use Imanghafoori\LaravelMicroscope\SpyClasses\SpyDispatcher; |
22 | 23 | use Imanghafoori\LaravelMicroscope\SpyClasses\SpyGate; |
23 | 24 | use Imanghafoori\LaravelMicroscope\SpyClasses\SpyRouter; |
24 | -use Imanghafoori\LaravelMicroscope\ErrorReporters\ConsolePrinterInstaller; |
|
25 | 25 | |
26 | 26 | class LaravelMicroscopeServiceProvider extends ServiceProvider |
27 | 27 | { |
@@ -16,6 +16,9 @@ discard block |
||
16 | 16 | return [$nextToken, $i]; |
17 | 17 | } |
18 | 18 | |
19 | + /** |
|
20 | + * @param string[] $tokenType |
|
21 | + */ |
|
19 | 22 | public static function forwardTo($tokens, $i, $tokenType) |
20 | 23 | { |
21 | 24 | $i++; |
@@ -46,6 +49,9 @@ discard block |
||
46 | 49 | return ($tokens[0][0] == T_CONSTANT_ENCAPSED_STRING) && ($nextToken !== '.'); |
47 | 50 | } |
48 | 51 | |
52 | + /** |
|
53 | + * @param string $funcName |
|
54 | + */ |
|
49 | 55 | public static function isGlobalCall($funcName, &$tokens, $i) |
50 | 56 | { |
51 | 57 | $expectedTokens = [ |
@@ -80,6 +86,9 @@ discard block |
||
80 | 86 | return self::checkTokens($expectedTokens, $tokens, $i); |
81 | 87 | } |
82 | 88 | |
89 | + /** |
|
90 | + * @param string $methodName |
|
91 | + */ |
|
83 | 92 | public static function isMethodCallOnThis($methodName, &$tokens, $i) |
84 | 93 | { |
85 | 94 | $expectedTokens = [ |
@@ -72,6 +72,9 @@ |
||
72 | 72 | return array($tokens, $changes); |
73 | 73 | } |
74 | 74 | |
75 | + /** |
|
76 | + * @return string |
|
77 | + */ |
|
75 | 78 | private static function getKeyword($token) |
76 | 79 | { |
77 | 80 | return self::scopeKeywords[$token]; |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Imanghafoori\LaravelMicroscope\Refactors; |
4 | 4 | |
5 | -use Imanghafoori\LaravelMicroscope\Analyzers\Refactor; |
|
6 | 5 | use Imanghafoori\LaravelMicroscope\Analyzers\FunctionCall; |
6 | +use Imanghafoori\LaravelMicroscope\Analyzers\Refactor; |
|
7 | 7 | |
8 | 8 | class EarlyReturns |
9 | 9 | { |