Completed
Push — master ( fd6351...3a087b )
by Iman
01:31
created
src/Commands/CheckRoutes.php 2 patches
Unused Use Statements   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@
 block discarded – undo
3 3
 namespace Imanghafoori\LaravelMicroscope\Commands;
4 4
 
5 5
 use Exception;
6
-use Illuminate\Support\Str;
7
-use Illuminate\Routing\Router;
8 6
 use Illuminate\Console\Command;
9
-use Imanghafoori\LaravelMicroscope\Psr4Classes;
7
+use Illuminate\Routing\Router;
8
+use Illuminate\Support\Str;
10 9
 use Imanghafoori\LaravelMicroscope\BladeFiles;
11
-use Imanghafoori\LaravelMicroscope\Traits\LogsErrors;
12 10
 use Imanghafoori\LaravelMicroscope\Checks\CheckRouteCalls;
13 11
 use Imanghafoori\LaravelMicroscope\Checks\RoutelessActions;
14 12
 use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
13
+use Imanghafoori\LaravelMicroscope\Psr4Classes;
14
+use Imanghafoori\LaravelMicroscope\Traits\LogsErrors;
15 15
 
16 16
 class CheckRoutes extends Command
17 17
 {
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -60,6 +60,9 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Checks/ActionsComments.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\Checks;
4 4
 
5
-use Imanghafoori\LaravelMicroscope\Analyzers\Refactor;
6 5
 use Imanghafoori\LaravelMicroscope\Analyzers\ClassMethods;
6
+use Imanghafoori\LaravelMicroscope\Analyzers\Refactor;
7 7
 
8 8
 class ActionsComments extends RoutelessActions
9 9
 {
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -28,6 +28,9 @@  discard block
 block discarded – undo
28 28
         }
29 29
     }
30 30
 
31
+    /**
32
+     * @param string $fullNamespace
33
+     */
31 34
     protected function checkActions($tokens, $fullNamespace, $path)
32 35
     {
33 36
         $class = ClassMethods::read($tokens);
@@ -73,6 +76,9 @@  discard block
 block discarded – undo
73 76
         return $routelessActions;
74 77
     }
75 78
 
79
+    /**
80
+     * @param \Illuminate\Routing\Route $route
81
+     */
76 82
     protected function getMsg($methods, $route)
77 83
     {
78 84
         $msg = '/** '."\n";
Please login to merge, or discard this patch.
src/Checks/ExtractBladePartial.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -45,6 +45,9 @@  discard block
 block discarded – undo
45 45
         return $tokens;
46 46
     }
47 47
 
48
+    /**
49
+     * @param string $name
50
+     */
48 51
     public static function find($name)
49 52
     {
50 53
         if (self::hasHintInformation($name = trim($name))) {
@@ -61,6 +64,9 @@  discard block
 block discarded – undo
61 64
         }, ['blade.php']);
62 65
     }
63 66
 
67
+    /**
68
+     * @param string $name
69
+     */
64 70
     protected static function findNamespacedView($name)
65 71
     {
66 72
         [$namespace, $view] = self::parseNamespaceSegments($name);
@@ -95,11 +101,17 @@  discard block
 block discarded – undo
95 101
         }
96 102
     }
97 103
 
104
+    /**
105
+     * @param string $name
106
+     */
98 107
     public static function hasHintInformation($name)
99 108
     {
100 109
         return strpos($name, '::') > 0;
101 110
     }
102 111
 
112
+    /**
113
+     * @param string $message
114
+     */
103 115
     public static function forceFilePutContents($filepath, $message){
104 116
         try {
105 117
             $isInFolder = preg_match("/^(.*)\/([^\/]+)$/", $filepath, $filepathMatches);
Please login to merge, or discard this 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\Checks;
4 4
 
5
-use Illuminate\Support\Str;
6 5
 use Illuminate\Support\Facades\View;
6
+use Illuminate\Support\Str;
7 7
 use Imanghafoori\LaravelMicroscope\Analyzers\FunctionCall;
8 8
 
9 9
 class ExtractBladePartial
Please login to merge, or discard this patch.
src/LaravelMicroscopeServiceProvider.php 1 patch
Unused Use Statements   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,21 +2,21 @@
 block discarded – undo
2 2
 
3 3
 namespace Imanghafoori\LaravelMicroscope;
4 4
 
5
-use Illuminate\View\View;
6
-use Illuminate\Support\Str;
5
+use Illuminate\Contracts\Auth\Access\Gate as GateContract;
6
+use Illuminate\Contracts\Queue\Factory as QueueFactoryContract;
7 7
 use Illuminate\Support\Facades\Event;
8 8
 use Illuminate\Support\Facades\Route;
9 9
 use Illuminate\Support\ServiceProvider;
10
+use Illuminate\Support\Str;
11
+use Illuminate\View\View;
10 12
 use Imanghafoori\LaravelMicroscope\Commands;
13
+use Imanghafoori\LaravelMicroscope\ErrorReporters\ConsolePrinterInstaller;
14
+use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
15
+use Imanghafoori\LaravelMicroscope\SpyClasses\SpyBladeCompiler;
16
+use Imanghafoori\LaravelMicroscope\SpyClasses\SpyDispatcher;
11 17
 use Imanghafoori\LaravelMicroscope\SpyClasses\SpyGate;
12 18
 use Imanghafoori\LaravelMicroscope\SpyClasses\SpyRouter;
13 19
 use Imanghafoori\LaravelMicroscope\SpyClasses\ViewsData;
14
-use Illuminate\Contracts\Auth\Access\Gate as GateContract;
15
-use Imanghafoori\LaravelMicroscope\SpyClasses\SpyDispatcher;
16
-use Imanghafoori\LaravelMicroscope\SpyClasses\SpyBladeCompiler;
17
-use Illuminate\Contracts\Queue\Factory as QueueFactoryContract;
18
-use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
19
-use Imanghafoori\LaravelMicroscope\ErrorReporters\ConsolePrinterInstaller;
20 20
 
21 21
 class LaravelMicroscopeServiceProvider extends ServiceProvider
22 22
 {
Please login to merge, or discard this patch.
src/Commands/PrettyPrintRoutes.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 namespace Imanghafoori\LaravelMicroscope\Commands;
4 4
 
5 5
 use Exception;
6
-use Illuminate\Support\Str;
7 6
 use Illuminate\Console\Command;
7
+use Illuminate\Support\Str;
8 8
 
9 9
 class PrettyPrintRoutes extends Command
10 10
 {
Please login to merge, or discard this patch.
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
         }
57 57
     }
58 58
 
59
+    /**
60
+     * @param string $value
61
+     */
59 62
     private function deduceRoute($value)
60 63
     {
61 64
         if (Str::containsAll($value, ['@', '\\'])) {
@@ -79,6 +82,9 @@  discard block
 block discarded – undo
79 82
         }
80 83
     }
81 84
 
85
+    /**
86
+     * @param string $action
87
+     */
82 88
     private function getMovableRoute($route, $methods, $action, $middlewares)
83 89
     {
84 90
         $nameSection = ($route->getName() ? ("->name('".$route->getName()."')") : '');
@@ -109,6 +115,9 @@  discard block
 block discarded – undo
109 115
         return $middlewares;
110 116
     }
111 117
 
118
+    /**
119
+     * @param Exception $e
120
+     */
112 121
     private function handleRouteProblem($e)
113 122
     {
114 123
         $this->info('The route has some problem.');
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,13 +3,13 @@
 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\ErrorReporters\ErrorPrinter;
12 11
 use Imanghafoori\LaravelMicroscope\ErrorTypes\CompactCall;
12
+use Imanghafoori\LaravelMicroscope\SpyClasses\RoutePaths;
13 13
 
14 14
 class CheckCompact extends Command
15 15
 {
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
 use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
10 10
 
11 11
 class CheckEarlyReturns extends Command
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Commands/CheckExpansions.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 namespace Imanghafoori\LaravelMicroscope\Commands;
4 4
 
5 5
 use Illuminate\Console\Command;
6
-use Imanghafoori\LaravelMicroscope\GenerateCode;
7
-use Imanghafoori\LaravelMicroscope\Analyzers\FilePath;
8 6
 use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson;
7
+use Imanghafoori\LaravelMicroscope\Analyzers\FilePath;
9 8
 use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
9
+use Imanghafoori\LaravelMicroscope\GenerateCode;
10 10
 
11 11
 class CheckExpansions extends Command
12 12
 {
Please login to merge, or discard this patch.
src/SpyClasses/SpyDispatcher.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -62,6 +62,9 @@  discard block
 block discarded – undo
62 62
         return class_exists($eventName, false) ? $this->addOriginInterfaceListeners($eventName, $listeners) : $listeners;
63 63
     }
64 64
 
65
+    /**
66
+     * @param string $string
67
+     */
65 68
     private function error($string)
66 69
     {
67 70
         app(ErrorPrinter::class)->pended[] = $string;
@@ -96,6 +99,9 @@  discard block
 block discarded – undo
96 99
         }
97 100
     }
98 101
 
102
+    /**
103
+     * @return string
104
+     */
99 105
     private function stringify($event)
100 106
     {
101 107
         return is_object($event) ? get_class($event) : $event;
@@ -117,6 +123,9 @@  discard block
 block discarded – undo
117 123
         return 'The method of '.$at.' is not callable as an event listener for "'.$e.'" event';
118 124
     }
119 125
 
126
+    /**
127
+     * @return string
128
+     */
120 129
     protected function getTypeHintedClass($listenerObj, $methodName)
121 130
     {
122 131
         try {
@@ -142,6 +151,9 @@  discard block
 block discarded – undo
142 151
         return $listeners;
143 152
     }
144 153
 
154
+    /**
155
+     * @param \Closure $listener
156
+     */
145 157
     private function stringifyClosure($listener)
146 158
     {
147 159
         try {
Please login to merge, or discard this patch.
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@
 block discarded – undo
2 2
 
3 3
 namespace Imanghafoori\LaravelMicroscope\SpyClasses;
4 4
 
5
-use ReflectionFunction;
6
-use ReflectionException;
7
-use Illuminate\Support\Str;
8 5
 use Illuminate\Events\Dispatcher;
6
+use Illuminate\Support\Str;
9 7
 use Imanghafoori\LaravelMicroscope\Analyzers\FilePath;
10 8
 use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
9
+use ReflectionException;
10
+use ReflectionFunction;
11 11
 
12 12
 class SpyDispatcher extends Dispatcher
13 13
 {
Please login to merge, or discard this patch.