Passed
Push — master ( f5f34d...397338 )
by Mohammad
02:50
created
src/Commands/Remover.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $file = preg_split(' (/|\\\\) ', (string) $this->argument('name')) ?? [];
55 55
 
56
-        if (! $file) {
56
+        if (!$file) {
57 57
             return 'Something wrong with the inputs !';
58 58
         }
59 59
 
@@ -62,32 +62,32 @@  discard block
 block discarded – undo
62 62
         unset($file[count($file) - 1]);
63 63
         $path = implode('\\', $file);
64 64
 
65
-        if (!$this->confirm('This will delete '.$this->repoName.' files and folder, Do you want to continue ?')) {
65
+        if (!$this->confirm('This will delete ' . $this->repoName . ' files and folder, Do you want to continue ?')) {
66 66
             return false;
67 67
         }
68 68
 
69 69
         $model = Str::plural(Config::get('repository.model'));
70 70
         $interface = Str::plural(Config::get('repository.interface'));
71 71
         $repository = Str::plural(Config::get('repository.repository'));
72
-        $controllerFolder =  Config::get('repository.controllers_folder');
72
+        $controllerFolder = Config::get('repository.controllers_folder');
73 73
         $requestFolder = Config::get('repository.requests_folder');
74 74
 
75
-        $this->remove('Entity',$model,$path);
76
-        $this->remove('Controller',$controllerFolder,$path);
77
-        $this->remove('Request',$requestFolder,$path);
78
-        $this->remove('Repository',$repository,$path);
79
-        $this->remove('Interface',$interface,$path);
75
+        $this->remove('Entity', $model, $path);
76
+        $this->remove('Controller', $controllerFolder, $path);
77
+        $this->remove('Request', $requestFolder, $path);
78
+        $this->remove('Repository', $repository, $path);
79
+        $this->remove('Interface', $interface, $path);
80 80
         return true;
81 81
     }
82 82
 
83
-    public function remove($type,$folder,$relativePath)
83
+    public function remove($type, $folder, $relativePath)
84 84
     {
85 85
         $folder = str_replace('\\', '/', $folder);
86 86
         $relativePath = str_replace('\\', '/', $relativePath);
87 87
 
88 88
         switch ($type) {
89 89
             case 'Entity':
90
-                $filePath = Config::get('repository.app_path')."/{$folder}/{$relativePath}/";
90
+                $filePath = Config::get('repository.app_path') . "/{$folder}/{$relativePath}/";
91 91
                 $fileName = "{$this->repoName}.php";
92 92
                 break;
93 93
             case 'Controller':
@@ -98,14 +98,14 @@  discard block
 block discarded – undo
98 98
                 $filePath = Config::get('repository.app_path') . "/{$folder}/{$relativePath}/";
99 99
                 $fileName = "{$this->repoName}{$type}.php";
100 100
         }
101
-        if(!is_file($filePath.$fileName))
101
+        if (!is_file($filePath . $fileName))
102 102
         {
103
-            $this->warn($filePath.' is not a valid file');
103
+            $this->warn($filePath . ' is not a valid file');
104 104
             return false;
105 105
         }
106 106
 
107
-        unlink($filePath.$fileName);
108
-        if(!(new \FilesystemIterator($filePath))->valid())
107
+        unlink($filePath . $fileName);
108
+        if (!(new \FilesystemIterator($filePath))->valid())
109 109
         {
110 110
             rmdir($filePath);
111 111
         }
Please login to merge, or discard this patch.