@@ -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; |
@@ -71,6 +71,9 @@ |
||
| 71 | 71 | return [$tokens, $changes]; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | + /** |
|
| 75 | + * @return string |
|
| 76 | + */ |
|
| 74 | 77 | private static function getKeyword($token) |
| 75 | 78 | { |
| 76 | 79 | return self::scopeKeywords[$token]; |
@@ -60,6 +60,9 @@ |
||
| 60 | 60 | return 'Error on route '.$msg; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | + /** |
|
| 64 | + * @param ErrorPrinter $errorPrinter |
|
| 65 | + */ |
|
| 63 | 66 | private function checkRouteDefinitions($errorPrinter, $routes) |
| 64 | 67 | { |
| 65 | 68 | foreach ($routes as $route) { |
@@ -56,6 +56,9 @@ discard block |
||
| 56 | 56 | return app(ErrorPrinter::class)->hasErrors() ? 1 : 0; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param integer $tries |
|
| 61 | + */ |
|
| 59 | 62 | private function fix($filePath, $tokens, $tries) |
| 60 | 63 | { |
| 61 | 64 | Refactor::saveTokens($filePath, $tokens, $this->option('test')); |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | return [$fixes, $tokens]; |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @param integer $fixed |
|
| 81 | + */ |
|
| 76 | 82 | private function printFinalMsg($fixed) |
| 77 | 83 | { |
| 78 | 84 | if ($fixed > 0) { |
@@ -59,6 +59,9 @@ discard block |
||
| 59 | 59 | return class_exists($eventName, false) ? $this->addOriginInterfaceListeners($eventName, $listeners) : $listeners; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $string |
|
| 64 | + */ |
|
| 62 | 65 | private function error($string) |
| 63 | 66 | { |
| 64 | 67 | $len = strlen($string); |
@@ -95,6 +98,9 @@ discard block |
||
| 95 | 98 | } |
| 96 | 99 | } |
| 97 | 100 | |
| 101 | + /** |
|
| 102 | + * @return string |
|
| 103 | + */ |
|
| 98 | 104 | private function stringify($event) |
| 99 | 105 | { |
| 100 | 106 | return is_object($event) ? get_class($event) : $event; |
@@ -116,6 +122,9 @@ discard block |
||
| 116 | 122 | return 'The method of '.$at.' is not callable as an event listener for "'.$e.'" event'; |
| 117 | 123 | } |
| 118 | 124 | |
| 125 | + /** |
|
| 126 | + * @return string |
|
| 127 | + */ |
|
| 119 | 128 | protected function getTypeHintedClass($listenerObj, $methodName) |
| 120 | 129 | { |
| 121 | 130 | try { |
@@ -141,6 +150,9 @@ discard block |
||
| 141 | 150 | return $listeners; |
| 142 | 151 | } |
| 143 | 152 | |
| 153 | + /** |
|
| 154 | + * @param \Closure $listener |
|
| 155 | + */ |
|
| 144 | 156 | private function stringifyClosure($listener) |
| 145 | 157 | { |
| 146 | 158 | try { |
@@ -28,6 +28,9 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param string $fullNamespace |
|
| 33 | + */ |
|
| 31 | 34 | protected static function checkActions($tokens, $fullNamespace, $path) |
| 32 | 35 | { |
| 33 | 36 | $class = ClassMethods::read($tokens); |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | return $routelessActions; |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @param \Illuminate\Routing\Route $route |
|
| 81 | + */ |
|
| 76 | 82 | protected static function getMsg($methods, $route) |
| 77 | 83 | { |
| 78 | 84 | $msg = '/**'."\n"; |
@@ -16,6 +16,9 @@ discard block |
||
| 16 | 16 | return [$token, $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 = [ |
@@ -37,6 +37,10 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | + /** |
|
| 41 | + * @param integer $level |
|
| 42 | + * @param integer $i |
|
| 43 | + */ |
|
| 40 | 44 | private static function openCurly($token, $level, $tokens, $i, $classFilePath) |
| 41 | 45 | { |
| 42 | 46 | if ($token == '{' && ! \in_array($tokens[$i - 1][0], [T_DOUBLE_COLON, T_OBJECT_OPERATOR])) { |
@@ -54,6 +58,11 @@ discard block |
||
| 54 | 58 | } |
| 55 | 59 | } |
| 56 | 60 | |
| 61 | + /** |
|
| 62 | + * @param integer $level |
|
| 63 | + * @param boolean $isInClass |
|
| 64 | + * @param integer $i |
|
| 65 | + */ |
|
| 57 | 66 | private static function writePublic($level, $token, $isInClass, $i, $tokens, $classFilePath) |
| 58 | 67 | { |
| 59 | 68 | if (($level != 1) || ($token[0] != T_FUNCTION) || ! $isInClass) { |