@@ -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; |
@@ -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']) { |
@@ -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]; |
@@ -20,6 +20,10 @@ |
||
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
23 | + /** |
|
24 | + * @param integer $elseCount |
|
25 | + * @param integer $ifBody |
|
26 | + */ |
|
23 | 27 | private static function shouldBeFlipped($elseCount, $ifBody) |
24 | 28 | { |
25 | 29 | $ifIsLonger = ($elseCount + 10) < $ifBody; |
@@ -58,6 +58,9 @@ |
||
58 | 58 | return $stringOutput; |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param \Closure $refactor |
|
63 | + */ |
|
61 | 64 | private static function recursiveRefactor($tokens, $refactor) |
62 | 65 | { |
63 | 66 | $i = $changes = 0; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * Get all of the listeners and their corresponding events. |
16 | 16 | * |
17 | - * @param iterable $paths |
|
17 | + * @param \Symfony\Component\Finder\Finder $paths |
|
18 | 18 | * @param $composerPath |
19 | 19 | * @param $composerNamespace |
20 | 20 | * @param FileCheckContractAlias $fileCheckContract |
@@ -70,6 +70,9 @@ discard block |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | + /** |
|
74 | + * @param string $relativePath |
|
75 | + */ |
|
73 | 76 | private static function warn($currentNamespace, $relativePath) |
74 | 77 | { |
75 | 78 | $p = app(ErrorPrinter::class); |
@@ -91,6 +94,9 @@ discard block |
||
91 | 94 | return Str::startsWith($buffer, '<?php'); |
92 | 95 | } |
93 | 96 | |
97 | + /** |
|
98 | + * @param string $correctNamespace |
|
99 | + */ |
|
94 | 100 | protected static function doNamespaceCorrection($absFilePath, $currentNamespace, $correctNamespace) |
95 | 101 | { |
96 | 102 | event('laravel_microscope.namespace_fixing', get_defined_vars()); |
@@ -110,6 +116,10 @@ discard block |
||
110 | 116 | return $migrationDirs; |
111 | 117 | } |
112 | 118 | |
119 | + /** |
|
120 | + * @param FileCheckContractAlias $fileCheckContract |
|
121 | + * @param string $correctNamespace |
|
122 | + */ |
|
113 | 123 | private static function ask($fileCheckContract, $correctNamespace) |
114 | 124 | { |
115 | 125 | return $fileCheckContract->getOutput()->confirm("Do you want to change it to: {$correctNamespace}", true); |
@@ -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 |