Completed
Pull Request — master (#61)
by amir
01:36
created
src/ErrorReporters/ErrorPrinter.php 1 patch
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -53,6 +53,10 @@  discard block
 block discarded – undo
53 53
         $this->pendError($absPath, $lineNumber, $relatedModel, 'badRelation', $header);
54 54
     }
55 55
 
56
+    /**
57
+     * @param string $key
58
+     * @param string $header
59
+     */
56 60
     public function pendError($path, $lineNumber, $absent, $key, $header)
57 61
     {
58 62
         array_push($this->counts[$key], (new PendingError($key))
@@ -89,6 +93,9 @@  discard block
 block discarded – undo
89 93
             ->link($absPath, $lineNumber));
90 94
     }
91 95
 
96
+    /**
97
+     * @param integer $len
98
+     */
92 99
     public function print($msg, $path = '|  ', $len = null)
93 100
     {
94 101
         ! $len && $len = PendingError::$maxLength + 1;
@@ -104,6 +111,9 @@  discard block
 block discarded – undo
104 111
         $this->printer->writeln($path.$msg.str_repeat(' ', $len).'|');
105 112
     }
106 113
 
114
+    /**
115
+     * @param string $msg
116
+     */
107 117
     public function printHeader($msg)
108 118
     {
109 119
         $this->print('');
Please login to merge, or discard this patch.
src/Commands/CheckPsr4.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -55,6 +55,9 @@
 block discarded – undo
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']) {
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Commands/CheckEarlyReturns.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
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
 {
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -68,6 +68,9 @@  discard block
 block discarded – undo
68 68
         $this->printFinalMsg($fixedFilesCount);
69 69
     }
70 70
 
71
+    /**
72
+     * @param integer $tries
73
+     */
71 74
     private function fix($filePath, $tokens, $tries)
72 75
     {
73 76
         Refactor::saveTokens($filePath, $tokens, $this->option('test'));
@@ -85,6 +88,9 @@  discard block
 block discarded – undo
85 88
         return [$fixes, $tokens];
86 89
     }
87 90
 
91
+    /**
92
+     * @param integer $fixed
93
+     */
88 94
     private function printFinalMsg($fixed)
89 95
     {
90 96
         if ($fixed > 0) {
Please login to merge, or discard this patch.
src/Analyzers/FunctionCall.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -16,6 +16,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 = [
Please login to merge, or discard this patch.
src/Refactors/EarlyReturns.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
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
 {
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -71,6 +71,9 @@
 block discarded – undo
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];
Please login to merge, or discard this patch.
src/Refactors/IfElse.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -20,6 +20,10 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Refactors/SyntaxNormalizer.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace Imanghafoori\LaravelMicroscope\Refactors;
4 4
 
5
-use Imanghafoori\LaravelMicroscope\Analyzers\Ifs;
6 5
 use Imanghafoori\LaravelMicroscope\Analyzers\FunctionCall;
6
+use Imanghafoori\LaravelMicroscope\Analyzers\Ifs;
7 7
 
8 8
 class SyntaxNormalizer
9 9
 {
Please login to merge, or discard this patch.
src/Analyzers/Refactor.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -58,6 +58,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Commands/CheckCompact.php 1 patch
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
3 3
 namespace Imanghafoori\LaravelMicroscope\Commands;
4 4
 
5 5
 use Illuminate\Console\Command;
6
-use Imanghafoori\LaravelMicroscope\Analyzers\Ifs;
6
+use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson;
7 7
 use Imanghafoori\LaravelMicroscope\Analyzers\FilePath;
8
-use Imanghafoori\LaravelMicroscope\SpyClasses\RoutePaths;
9 8
 use Imanghafoori\LaravelMicroscope\Analyzers\FunctionCall;
10
-use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson;
9
+use Imanghafoori\LaravelMicroscope\Analyzers\Ifs;
11 10
 use Imanghafoori\LaravelMicroscope\ErrorTypes\CompactCall;
11
+use Imanghafoori\LaravelMicroscope\SpyClasses\RoutePaths;
12 12
 
13 13
 class CheckCompact extends Command
14 14
 {
Please login to merge, or discard this patch.