Completed
Push — master ( 9828b8...5fea6f )
by Iman
01:24
created
src/CheckNamespaces.php 2 patches
Doc Comments   +11 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
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
-     * @param  $command
20
+     * @param  Commands\CheckPsr4 $command
21 21
      *
22 22
      * @return void
23 23
      */
@@ -72,6 +72,9 @@  discard block
 block discarded – undo
72 72
         }
73 73
     }
74 74
 
75
+    /**
76
+     * @param string $relativePath
77
+     */
75 78
     private static function warn($currentNamespace, $relativePath)
76 79
     {
77 80
         $p = app(ErrorPrinter::class);
@@ -93,6 +96,9 @@  discard block
 block discarded – undo
93 96
         return Str::startsWith($buffer, '<?php');
94 97
     }
95 98
 
99
+    /**
100
+     * @param string $correctNamespace
101
+     */
96 102
     protected static function doNamespaceCorrection($absFilePath, $currentNamespace, $correctNamespace)
97 103
     {
98 104
         event('laravel_microscope.namespace_fixing', get_defined_vars());
@@ -100,6 +106,9 @@  discard block
 block discarded – undo
100 106
         event('laravel_microscope.namespace_fixed', get_defined_vars());
101 107
     }
102 108
 
109
+    /**
110
+     * @param string $correctNamespace
111
+     */
103 112
     private static function ask($command, $correctNamespace)
104 113
     {
105 114
         return $command->getOutput()->confirm('Do you want to change it to: '.$correctNamespace, true);
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Support\Str;
6 6
 use Imanghafoori\LaravelMicroscope\Analyzers\FilePath;
7
-use Imanghafoori\LaravelMicroscope\LaravelPaths\MigrationPaths;
8 7
 use Imanghafoori\LaravelMicroscope\Analyzers\GetClassProperties;
9 8
 use Imanghafoori\LaravelMicroscope\Analyzers\NamespaceCorrector;
10 9
 use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
10
+use Imanghafoori\LaravelMicroscope\LaravelPaths\MigrationPaths;
11 11
 
12 12
 class CheckNamespaces
13 13
 {
Please login to merge, or discard this patch.
src/Commands/CheckRoutes.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -67,6 +67,9 @@
 block discarded – undo
67 67
         }
68 68
     }
69 69
 
70
+    /**
71
+     * @param ErrorPrinter $errorPrinter
72
+     */
70 73
     private function checkRouteDefinitions($errorPrinter, $routes)
71 74
     {
72 75
         foreach ($routes as $route) {
Please login to merge, or discard this patch.
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.
src/CheckClasses.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -26,6 +26,9 @@
 block discarded – undo
26 26
         }
27 27
     }
28 28
 
29
+    /**
30
+     * @param string $msg
31
+     */
29 32
     public static function warnDumping($msg)
30 33
     {
31 34
         $p = resolve(ErrorPrinter::class)->printer;
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;
4 4
 
5
-use Illuminate\Support\Str;
6 5
 use Illuminate\Support\Composer;
6
+use Illuminate\Support\Str;
7 7
 use Imanghafoori\LaravelMicroscope\Analyzers\GetClassProperties;
8 8
 use Imanghafoori\LaravelMicroscope\Analyzers\ParseUseStatement;
9 9
 use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
Please login to merge, or discard this patch.
src/Checks/RoutelessActions.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Routing\Controller;
6 6
 use Imanghafoori\LaravelMicroscope\Analyzers\ClassMethods;
7
-use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
8 7
 use Imanghafoori\LaravelMicroscope\Analyzers\NamespaceCorrector;
8
+use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
9 9
 
10 10
 class RoutelessActions
11 11
 {
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -40,6 +40,9 @@  discard block
 block discarded – undo
40 40
         return $namespace.'\\'.$className;
41 41
     }
42 42
 
43
+    /**
44
+     * @param string $fullNamespace
45
+     */
43 46
     protected function isLaravelController($fullNamespace)
44 47
     {
45 48
         try {
@@ -58,6 +61,9 @@  discard block
 block discarded – undo
58 61
         return $fullNamespace;
59 62
     }
60 63
 
64
+    /**
65
+     * @param string $fullNamespace
66
+     */
61 67
     protected function checkActions($tokens, $fullNamespace, $path)
62 68
     {
63 69
         $class = ClassMethods::read($tokens);
Please login to merge, or discard this patch.
src/Commands/CheckViews.php 1 patch
Unused Use Statements   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
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\BladeFiles;
8
+use Imanghafoori\LaravelMicroscope\Analyzers\FilePath;
12 9
 use Imanghafoori\LaravelMicroscope\Analyzers\FunctionCall;
10
+use Imanghafoori\LaravelMicroscope\BladeFiles;
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
 {
Please login to merge, or discard this patch.
src/SpyClasses/SpyDispatcher.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -54,6 +54,9 @@  discard block
 block discarded – undo
54 54
         }
55 55
     }
56 56
 
57
+    /**
58
+     * @return string
59
+     */
57 60
     private function stringify($event)
58 61
     {
59 62
         return is_object($event) ? get_class($event) : $event;
@@ -75,6 +78,9 @@  discard block
 block discarded – undo
75 78
         return 'The method of '.$at.' is not callable as an event listener for "'.$e.'" event';
76 79
     }
77 80
 
81
+    /**
82
+     * @return string
83
+     */
78 84
     protected function getTypeHintedClass($listenerObj, $methodName)
79 85
     {
80 86
         $ref = new \ReflectionParameter([$listenerObj, $methodName], 0);
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 $r
81
+     */
76 82
     protected function getMsg($methods, $r)
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.