Test Failed
Push — master ( bba9ba...9913fe )
by Php Easy Api
18:46
created
src/resta/Console/Source/Controller/Controller.php 2 patches
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     /**
19 19
      * @var $type
20 20
      */
21
-    public $type='controller';
21
+    public $type = 'controller';
22 22
 
23 23
     /**
24 24
      * @var array
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
     /**
38 38
      * @var array
39 39
      */
40
-    protected $commandRule=[
40
+    protected $commandRule = [
41 41
         'create'    => ['controller'],
42
-        'rename'    => ['controller','rename'],
42
+        'rename'    => ['controller', 'rename'],
43 43
         'all'       => [],
44 44
     ];
45 45
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
         $this->argument['bundleName'] = $controller.''.StaticPathList::$controllerBundleName;
57 57
 
58
-        if(!file_exists(app()->path()->controller())){
58
+        if (!file_exists(app()->path()->controller())) {
59 59
             $this->directory['createController'] = app()->path()->controller();
60 60
         }
61 61
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         $fullNamespaceForController             = $this->argument['controllerNamespace'].'\\'.$this->argument['serviceClass'].''.$this->argument['callClassPrefix'];
75 75
 
76
-        $this->directory['routes']       = path()->route();
76
+        $this->directory['routes'] = path()->route();
77 77
 
78 78
         $routePath = $this->directory['routes'].''.DIRECTORY_SEPARATOR.''.$controller.'Route.php';
79 79
 
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
         // we get to the service directory, which is called the controller.
82 82
         $this->file->makeDirectory($this);
83 83
 
84
-        if(isset($this->argument['resource']) && file_exists($this->directory['endpoint'])){
84
+        if (isset($this->argument['resource']) && file_exists($this->directory['endpoint'])) {
85 85
 
86
-            $this->touch['service/resource']   = $this->directory['resource'].''.DIRECTORY_SEPARATOR.''.$this->argument['resource'].'.php';
86
+            $this->touch['service/resource'] = $this->directory['resource'].''.DIRECTORY_SEPARATOR.''.$this->argument['resource'].'.php';
87 87
 
88 88
             $this->file->touch($this);
89 89
 
@@ -91,30 +91,30 @@  discard block
 block discarded – undo
91 91
             echo $this->classical(' > Resource Controller called as "'.$this->argument['resource'].'" has been successfully created in the '.$this->directory['resource'].'');
92 92
 
93 93
         }
94
-        elseif(isset($this->argument['file']) && file_exists($this->directory['endpoint'])){
95
-            if(isset($this->argument['type']) && $this->argument['type']=='Crud'){
94
+        elseif (isset($this->argument['file']) && file_exists($this->directory['endpoint'])) {
95
+            if (isset($this->argument['type']) && $this->argument['type']=='Crud') {
96 96
 
97
-                $this->touch['service/controllerfilecrud']   = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].''. $this->argument['callClassPrefix'].'.php';
97
+                $this->touch['service/controllerfilecrud'] = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].''.$this->argument['callClassPrefix'].'.php';
98 98
 
99
-                $this->file->touch($this,[
99
+                $this->file->touch($this, [
100 100
                     'stub'=>'Controller_Create'
101 101
                 ]);
102 102
 
103
-                files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->get("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@get");');
104
-                files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->post("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@create");');
105
-                files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->put("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@update");');
103
+                files()->append($routePath, PHP_EOL.'Route::namespace(\''.$controller.'\')->get("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@get");');
104
+                files()->append($routePath, PHP_EOL.'Route::namespace(\''.$controller.'\')->post("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@create");');
105
+                files()->append($routePath, PHP_EOL.'Route::namespace(\''.$controller.'\')->put("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@update");');
106 106
                 //files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->delete("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@delete");');
107 107
 
108 108
             }
109
-            else{
109
+            else {
110 110
 
111
-                $this->touch['service/controllerfile']   = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].''. $this->argument['callClassPrefix'].'.php';
111
+                $this->touch['service/controllerfile'] = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].''.$this->argument['callClassPrefix'].'.php';
112 112
 
113
-                $this->file->touch($this,[
113
+                $this->file->touch($this, [
114 114
                     'stub'=>'Controller_Create'
115 115
                 ]);
116 116
 
117
-                files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->get("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@index");');
117
+                files()->append($routePath, PHP_EOL.'Route::namespace(\''.$controller.'\')->get("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@index");');
118 118
 
119 119
             }
120 120
 
@@ -122,21 +122,21 @@  discard block
 block discarded – undo
122 122
             echo $this->classical(' > Controller called as "'.$this->argument['file'].'" has been successfully created in the '.$this->directory['endpoint'].'');
123 123
 
124 124
         }
125
-        else{
125
+        else {
126 126
 
127 127
             // we process the processes related to file creation operations.
128 128
             // and then create files related to the touch method of the file object as it is in the directory process.
129 129
 
130
-            if(isset($this->argument['type']) && $this->argument['type']=='Crud'){
130
+            if (isset($this->argument['type']) && $this->argument['type']=='Crud') {
131 131
 
132 132
                 $this->argument['file'] = $this->argument['serviceClass'];
133 133
 
134
-                $this->touch['service/controllerfilecrud']  = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''. $this->argument['callClassPrefix'].'.php';
134
+                $this->touch['service/controllerfilecrud']  = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''.$this->argument['callClassPrefix'].'.php';
135 135
                 $this->touch['service/routecrud']           = $routePath;
136 136
 
137 137
             }
138
-            else{
139
-                $this->touch['service/endpoint']        = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''. $this->argument['callClassPrefix'].'.php';
138
+            else {
139
+                $this->touch['service/endpoint']        = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''.$this->argument['callClassPrefix'].'.php';
140 140
                 $this->touch['service/route']           = $routePath;
141 141
 
142 142
             }
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
             //$this->touch['service/conf']            = $this->directory['configuration'].''.DIRECTORY_SEPARATOR.'ServiceConf.php';
148 148
             //$this->touch['service/dummy']           = $this->directory['configuration'].''.DIRECTORY_SEPARATOR.'Dummy.yaml';
149 149
             //$this->touch['service/doc']             = $this->directory['configuration'].''.DIRECTORY_SEPARATOR.'Doc.yaml';
150
-            $this->touch['service/readme']          = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.'README.md';
150
+            $this->touch['service/readme'] = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.'README.md';
151 151
             //$this->touch['service/policy']          = $this->directory['policy'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''. $this->argument['callClassPrefix'].'Policy.php';
152 152
 
153
-            $this->file->touch($this,[
153
+            $this->file->touch($this, [
154 154
                 'stub'=>'Controller_Create'
155 155
             ]);
156 156
 
@@ -174,24 +174,24 @@  discard block
 block discarded – undo
174 174
     {
175 175
         $path = path()->controller().'/'.$this->argument['controller'].''.StaticPathList::$controllerBundleName;
176 176
 
177
-        if(file_exists($path)){
177
+        if (file_exists($path)) {
178 178
 
179
-            $newPathName = str_replace($this->argument['controller'],$this->argument['rename'],$path);
179
+            $newPathName = str_replace($this->argument['controller'], $this->argument['rename'], $path);
180 180
 
181 181
 
182
-            rename($path,$newPathName);
182
+            rename($path, $newPathName);
183 183
 
184 184
             $getAllFiles = files()->getAllFilesInDirectory($newPathName);
185 185
 
186
-            $getPathWithPhpExtensions = Utils::getPathWithPhpExtension($getAllFiles,$newPathName);
186
+            $getPathWithPhpExtensions = Utils::getPathWithPhpExtension($getAllFiles, $newPathName);
187 187
 
188
-            foreach ($getPathWithPhpExtensions as $getPathWithPhpExtension){
188
+            foreach ($getPathWithPhpExtensions as $getPathWithPhpExtension) {
189 189
 
190
-                $withoutFullPath = str_replace($newPathName,"",$getPathWithPhpExtension);
190
+                $withoutFullPath = str_replace($newPathName, "", $getPathWithPhpExtension);
191 191
 
192 192
                 $newName = $newPathName."".preg_replace("((.*)".$this->argument['controller'].")", "$1".$this->argument['rename'], $withoutFullPath);
193 193
 
194
-                rename($getPathWithPhpExtension,$newName);
194
+                rename($getPathWithPhpExtension, $newName);
195 195
 
196 196
                 Utils::changeClass($newName,
197 197
                     [
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      */
211 211
     private function docUpdate()
212 212
     {
213
-        $docPath = $this->directory['configuration'] .'/Doc.yaml';
213
+        $docPath = $this->directory['configuration'].'/Doc.yaml';
214 214
 
215 215
         $doc = Utils::yaml($docPath);
216 216
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -90,8 +90,7 @@  discard block
 block discarded – undo
90 90
             // and as a result we print the result on the console screen.
91 91
             echo $this->classical(' > Resource Controller called as "'.$this->argument['resource'].'" has been successfully created in the '.$this->directory['resource'].'');
92 92
 
93
-        }
94
-        elseif(isset($this->argument['file']) && file_exists($this->directory['endpoint'])){
93
+        } elseif(isset($this->argument['file']) && file_exists($this->directory['endpoint'])){
95 94
             if(isset($this->argument['type']) && $this->argument['type']=='Crud'){
96 95
 
97 96
                 $this->touch['service/controllerfilecrud']   = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].''. $this->argument['callClassPrefix'].'.php';
@@ -105,8 +104,7 @@  discard block
 block discarded – undo
105 104
                 files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->put("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@update");');
106 105
                 //files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->delete("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@delete");');
107 106
 
108
-            }
109
-            else{
107
+            } else{
110 108
 
111 109
                 $this->touch['service/controllerfile']   = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].''. $this->argument['callClassPrefix'].'.php';
112 110
 
@@ -121,8 +119,7 @@  discard block
 block discarded – undo
121 119
             // and as a result we print the result on the console screen.
122 120
             echo $this->classical(' > Controller called as "'.$this->argument['file'].'" has been successfully created in the '.$this->directory['endpoint'].'');
123 121
 
124
-        }
125
-        else{
122
+        } else{
126 123
 
127 124
             // we process the processes related to file creation operations.
128 125
             // and then create files related to the touch method of the file object as it is in the directory process.
@@ -134,8 +131,7 @@  discard block
 block discarded – undo
134 131
                 $this->touch['service/controllerfilecrud']  = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''. $this->argument['callClassPrefix'].'.php';
135 132
                 $this->touch['service/routecrud']           = $routePath;
136 133
 
137
-            }
138
-            else{
134
+            } else{
139 135
                 $this->touch['service/endpoint']        = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''. $this->argument['callClassPrefix'].'.php';
140 136
                 $this->touch['service/route']           = $routePath;
141 137
 
Please login to merge, or discard this patch.
src/resta/Console/Source/Project/Project.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     /**
16 16
      * @var $type
17 17
      */
18
-    public $type='project';
18
+    public $type = 'project';
19 19
 
20 20
     /**
21 21
      * @var array
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * @var $commandRule
34 34
      */
35
-    public $commandRule=[];
35
+    public $commandRule = [];
36 36
 
37 37
     /**
38 38
      * @method create
@@ -47,18 +47,18 @@  discard block
 block discarded – undo
47 47
         $this->directory['projectDir']          = $this->projectPath();
48 48
         $this->argument['exceptionNamespace']   = app()->namespace()->exception();
49 49
         $this->argument['resourcePath']         = app()->path()->appResourche();
50
-        $this->argument['commandNamespace']           = app()->namespace()->command();
51
-        $this->argument['testNamespace']             = app()->namespace()->tests();
50
+        $this->argument['commandNamespace'] = app()->namespace()->command();
51
+        $this->argument['testNamespace'] = app()->namespace()->tests();
52 52
 
53
-        $recursiveDefaultDirectory = explode("\\",$this->argument['project']);
53
+        $recursiveDefaultDirectory = explode("\\", $this->argument['project']);
54 54
         $this->argument['applicationName'] = pos($recursiveDefaultDirectory);
55 55
         $recursiveDefaultDirectory[] = 'V1';
56 56
         $recursiveDefaultDirectoryList = [];
57 57
 
58
-        foreach (array_slice($recursiveDefaultDirectory,1) as $defaultDirectory){
58
+        foreach (array_slice($recursiveDefaultDirectory, 1) as $defaultDirectory) {
59 59
 
60
-            $recursiveDefaultDirectoryList[]=$defaultDirectory;
61
-            $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/",$recursiveDefaultDirectoryList);
60
+            $recursiveDefaultDirectoryList[] = $defaultDirectory;
61
+            $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/", $recursiveDefaultDirectoryList);
62 62
         }
63 63
 
64 64
         //$this->directory['optionalDir'] = $this->optional();
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
         $this->touch['kernel/exception']            = $this->provider().'/ExceptionServiceProvider.php';
102 102
         $this->touch['kernel/response']             = $this->provider().'/ResponseServiceProvider.php';
103 103
         $this->touch['kernel/entity']               = $this->provider().'/EntityServiceProvider.php';
104
-        $this->touch['kernel/cache']               = $this->provider().'/CacheServiceProvider.php';
104
+        $this->touch['kernel/cache'] = $this->provider().'/CacheServiceProvider.php';
105 105
         $this->touch['kernel/authenticate']         = $this->provider().'/AuthenticateServiceProvider.php';
106 106
         $this->touch['kernel/role']                 = $this->provider().'/RoleServiceProvider.php';
107 107
         $this->touch['kernel/track']                = $this->provider().'/TrackServiceProvider.php';
108
-        $this->touch['test/testcase']              = $this->test().'/TestCase.php';
108
+        $this->touch['test/testcase'] = $this->test().'/TestCase.php';
109 109
         $this->touch['kernel/consoleevent']         = $this->provider().'/ConsoleEventServiceProvider.php';
110 110
         $this->touch['middleware/authenticate']     = $this->middleware().'/Authenticate.php';
111 111
         $this->touch['middleware/ratelimit']        = $this->middleware().'/RateLimit.php';
@@ -123,19 +123,19 @@  discard block
 block discarded – undo
123 123
         $this->touch['resource/index']              = $this->resource().'/index.html';
124 124
         $this->touch['resource/index']              = $this->resource().'/'.StaticPathModel::$cache.'/index.html';
125 125
         $this->touch['stub/index']                  = $this->stub().'/index.html';
126
-        $this->touch['stub/cccrudapp']              = $this->directory['stubControllerCreateCrudFileDir'] .'/app.stub';
127
-        $this->touch['stub/cccrudconf']              = $this->directory['stubControllerCreateCrudFileDir'] .'/conf.stub';
128
-        $this->touch['stub/cccrudcontrollerfilecrud']              = $this->directory['stubControllerCreateCrudFileDir'] .'/controllerfilecrud.stub';
129
-        $this->touch['stub/cccruddeveloper']              = $this->directory['stubControllerCreateCrudFileDir'] .'/developer.stub';
130
-        $this->touch['stub/cccruddoc']              = $this->directory['stubControllerCreateCrudFileDir'] .'/doc.stub';
131
-        $this->touch['stub/cccruddummy']              = $this->directory['stubControllerCreateCrudFileDir'] .'/dummy.stub';
132
-        $this->touch['stub/cccrudroute']              = $this->directory['stubControllerCreateCrudFileDir'] .'/routecrud.stub';
133
-        $this->touch['stub/cccrudpolicy']              = $this->directory['stubControllerCreateCrudFileDir'] .'/policy.stub';
134
-        $this->touch['stub/cccrudreadme']              = $this->directory['stubControllerCreateCrudFileDir'] .'/readme.stub';
135
-        $this->touch['stub/cccrudresourceindex']              = $this->directory['stubControllerCreateCrudFileDir'] .'/resourceIndex.stub';
126
+        $this->touch['stub/cccrudapp']              = $this->directory['stubControllerCreateCrudFileDir'].'/app.stub';
127
+        $this->touch['stub/cccrudconf'] = $this->directory['stubControllerCreateCrudFileDir'].'/conf.stub';
128
+        $this->touch['stub/cccrudcontrollerfilecrud'] = $this->directory['stubControllerCreateCrudFileDir'].'/controllerfilecrud.stub';
129
+        $this->touch['stub/cccruddeveloper'] = $this->directory['stubControllerCreateCrudFileDir'].'/developer.stub';
130
+        $this->touch['stub/cccruddoc'] = $this->directory['stubControllerCreateCrudFileDir'].'/doc.stub';
131
+        $this->touch['stub/cccruddummy']              = $this->directory['stubControllerCreateCrudFileDir'].'/dummy.stub';
132
+        $this->touch['stub/cccrudroute']              = $this->directory['stubControllerCreateCrudFileDir'].'/routecrud.stub';
133
+        $this->touch['stub/cccrudpolicy']              = $this->directory['stubControllerCreateCrudFileDir'].'/policy.stub';
134
+        $this->touch['stub/cccrudreadme']              = $this->directory['stubControllerCreateCrudFileDir'].'/readme.stub';
135
+        $this->touch['stub/cccrudresourceindex'] = $this->directory['stubControllerCreateCrudFileDir'].'/resourceIndex.stub';
136 136
         $this->touch['config/hateoas']              = $this->config().'/Hateoas.php';
137 137
         //$this->touch['config/response']             = $this->config().'/Response.php';
138
-        $this->touch['command/clientEntity']          = $this->directory['commandDir'].'/ClientEntity.php';
138
+        $this->touch['command/clientEntity'] = $this->directory['commandDir'].'/ClientEntity.php';
139 139
         $this->touch['config/redis']                = $this->config().'/Redis.php';
140 140
         $this->touch['config/app']                  = $this->config().'/App.php';
141 141
         $this->touch['config/autoservice']          = $this->config().'/AutoServices.php';
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
         $this->touch['app/gitignore']               = $this->projectPath().'/.gitignore';
158 158
         $this->touch['app/composer']                = $this->projectPath().'/composer.json';
159 159
         $this->touch['test/index']                  = $this->storage().'/index.html';
160
-        $this->touch['exception/authenticate']      = $this->directory['exceptionDir'] .'/AuthenticateException.php';
161
-        $this->touch['exception/noinput']           = $this->directory['exceptionDir'] .'/NoInputException.php';
162
-        $this->touch['helpers/general']              = $this->directory['helperDir'] .'/General.php';
160
+        $this->touch['exception/authenticate']      = $this->directory['exceptionDir'].'/AuthenticateException.php';
161
+        $this->touch['exception/noinput']           = $this->directory['exceptionDir'].'/NoInputException.php';
162
+        $this->touch['helpers/general'] = $this->directory['helperDir'].'/General.php';
163 163
 
164 164
         //set project touch
165 165
         $this->file->touch($this);
Please login to merge, or discard this patch.