Test Failed
Push — master ( ba32c2...afae9d )
by Php Easy Api
04:23
created
src/resta/Container/ContainerClosureResolver.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,34 +20,34 @@
 block discarded – undo
20 20
     {
21 21
         $serviceJson = app()->containerCacheFile();
22 22
         
23
-        if(file_exists($serviceJson)){
23
+        if (file_exists($serviceJson)) {
24 24
             JsonHandler::$file = $serviceJson;
25 25
             $serviceJson = JsonHandler::get();
26 26
 
27
-            $dottedKey = explode('.',$key);
27
+            $dottedKey = explode('.', $key);
28 28
 
29
-            if(count($dottedKey)==2){
29
+            if (count($dottedKey)==2) {
30 30
 
31
-                if(isset($serviceJson['container'][$dottedKey[0]][$dottedKey[1]])){
31
+                if (isset($serviceJson['container'][$dottedKey[0]][$dottedKey[1]])) {
32 32
                     $arrayData = $serviceJson['container'][$dottedKey[0]][$dottedKey[1]];
33 33
 
34
-                    if($serviceJson['container-format'][$dottedKey[0]][$dottedKey[1]]=='string'){
34
+                    if ($serviceJson['container-format'][$dottedKey[0]][$dottedKey[1]]=='string') {
35 35
                         return $arrayData;
36 36
                     }
37 37
 
38
-                    if($serviceJson['container-format'][$dottedKey[0]][$dottedKey[1]]=='closure'){
38
+                    if ($serviceJson['container-format'][$dottedKey[0]][$dottedKey[1]]=='closure') {
39 39
                         return SuperClosure::get($arrayData);
40 40
                     }
41 41
                 }
42 42
             }
43
-            else{
43
+            else {
44 44
 
45
-                if(isset($serviceJson['container'][$key])){
46
-                    if($serviceJson['container-format'][$key]=='string' || is_array($serviceJson['container-format'][$key])){
45
+                if (isset($serviceJson['container'][$key])) {
46
+                    if ($serviceJson['container-format'][$key]=='string' || is_array($serviceJson['container-format'][$key])) {
47 47
                         return $serviceJson['container'][$key];
48 48
                     }
49 49
 
50
-                    if($serviceJson['container-format'][$key]=='closure'){
50
+                    if ($serviceJson['container-format'][$key]=='closure') {
51 51
                         return SuperClosure::get($serviceJson['container'][$key]);
52 52
                     }
53 53
                 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@
 block discarded – undo
39 39
                         return SuperClosure::get($arrayData);
40 40
                     }
41 41
                 }
42
-            }
43
-            else{
42
+            } else{
44 43
 
45 44
                 if(isset($serviceJson['container'][$key])){
46 45
                     if($serviceJson['container-format'][$key]=='string' || is_array($serviceJson['container-format'][$key])){
Please login to merge, or discard this patch.
src/resta/Provider/ServiceProvider.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -27,23 +27,23 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @throws FileNotFoundException
29 29
      */
30
-    private function applyProvider($key,$provider,$method='register')
30
+    private function applyProvider($key, $provider, $method = 'register')
31 31
     {
32 32
         // If the provider classes are a real object
33 33
         // we will run them.
34
-        if(Utils::isNamespaceExists($provider)){
34
+        if (Utils::isNamespaceExists($provider)) {
35 35
 
36 36
             // after determining whether the register or boot methods
37 37
             // we are running the provider.
38 38
             $providerInstance = $this->app->resolve($provider);
39 39
 
40 40
             //we need to do method check for provider.
41
-            if(method_exists($providerInstance,$method)){
41
+            if (method_exists($providerInstance, $method)) {
42 42
                 $providerInstance->{$method}();
43 43
 
44
-                if($method=="register"){
45
-                    $this->app->register('loadedProviders',$key,$provider);
46
-                    $this->deferrableProvider($providerInstance,$provider);
44
+                if ($method=="register") {
45
+                    $this->app->register('loadedProviders', $key, $provider);
46
+                    $this->deferrableProvider($providerInstance, $provider);
47 47
                 }
48 48
             }
49 49
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * @throws FileNotFoundException
59 59
      */
60
-    private function deferrableProvider($providerInstance,$provider)
60
+    private function deferrableProvider($providerInstance, $provider)
61 61
     {
62 62
         // returns the file path value in
63 63
         // which container values ​​are cached.
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
         // if the provider container does not exist in the cache file,
68 68
         // the deferrable process will be executed.
69
-        if(!isset($serviceJson['providers'][$provider]) && $providerInstance instanceof DeferrableProvider && file_exists($serviceJson)) {
69
+        if (!isset($serviceJson['providers'][$provider]) && $providerInstance instanceof DeferrableProvider && file_exists($serviceJson)) {
70 70
             $deferrableProvides = $providerInstance->provides();
71 71
 
72 72
             JsonHandler::set('providers-deferrable-classes.'.$provider, 'cache-loaded');
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
                     } else {
87 87
                         foreach ($container as $containerKey => $containerItem) {
88 88
                             if ($containerItem instanceof Closure) {
89
-                                JsonHandler::set('container.' . $deferrableProvide . '.' . $containerKey . '', SuperClosure::set($containerItem));
90
-                                JsonHandler::set('container-format.' . $deferrableProvide . '.' . $containerKey, 'closure');
89
+                                JsonHandler::set('container.'.$deferrableProvide.'.'.$containerKey.'', SuperClosure::set($containerItem));
90
+                                JsonHandler::set('container-format.'.$deferrableProvide.'.'.$containerKey, 'closure');
91 91
                             } else {
92
-                                JsonHandler::set('container.' . $deferrableProvide . '.' . $containerKey . '', $containerItem);
93
-                                JsonHandler::set('container-format.' . $deferrableProvide . '.' . $containerKey, 'string');
92
+                                JsonHandler::set('container.'.$deferrableProvide.'.'.$containerKey.'', $containerItem);
93
+                                JsonHandler::set('container-format.'.$deferrableProvide.'.'.$containerKey, 'string');
94 94
                             }
95 95
 
96 96
                         }
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
      */
108 108
     private function assignerLoadedProvidersInitialCoreValue()
109 109
     {
110
-        if(!isset($this->app['loadedProviders'])){
110
+        if (!isset($this->app['loadedProviders'])) {
111 111
 
112 112
             // for loaded providers,
113 113
             // we register an empty array for the container object.
114
-            $this->app->register('loadedProviders',[]);
114
+            $this->app->register('loadedProviders', []);
115 115
         }
116 116
     }
117 117
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         //set service providers for providers property
126 126
         $providers = $this->app->serviceProviders();
127 127
 
128
-        if(count($providers)){
128
+        if (count($providers)) {
129 129
             $this->providers = $providers;
130 130
         }
131 131
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function handle()
141 141
     {
142
-        define ('serviceprovider',true);
142
+        define('serviceprovider', true);
143 143
 
144 144
         //check providers and resolve
145 145
         $this->resolveProviders($this->getServiceProviders());
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      *
153 153
      * @throws FileNotFoundException
154 154
      */
155
-    public function resolveProviders($providers=array())
155
+    public function resolveProviders($providers = array())
156 156
     {
157 157
         // for loaded providers,
158 158
         // we register an empty array for the container object.
@@ -160,27 +160,27 @@  discard block
 block discarded – undo
160 160
 
161 161
         $serviceJson = [];
162 162
 
163
-        if(file_exists($this->app->containerCacheFile())){
163
+        if (file_exists($this->app->containerCacheFile())) {
164 164
             JsonHandler::$file = $this->app->containerCacheFile();
165 165
             $serviceJson = JsonHandler::get();
166 166
         }
167 167
 
168 168
         //first we are running register methods of provider classes.
169
-        foreach($providers as $key=>$provider){
169
+        foreach ($providers as $key=>$provider) {
170 170
 
171 171
             // providers can only be installed once.
172 172
             // apply providers and register for kernel
173
-            if(!isset($this->app['loadedProviders'][$key])){
174
-                if(is_array($provider) && isset($provider['class']) && isset($provider['status']) && $provider['status']){
175
-                    if(!isset($serviceJson['providers-deferrable-classes'][$provider['class']])){
176
-                        $this->applyProvider($key,$provider['class']);
173
+            if (!isset($this->app['loadedProviders'][$key])) {
174
+                if (is_array($provider) && isset($provider['class']) && isset($provider['status']) && $provider['status']) {
175
+                    if (!isset($serviceJson['providers-deferrable-classes'][$provider['class']])) {
176
+                        $this->applyProvider($key, $provider['class']);
177 177
                     }
178 178
                 }
179 179
             }
180 180
 
181 181
             //if the providers register is already booted.
182
-            if(isset($this->app['loadedProviders'][$key])){
183
-                $this->applyProvider($key,$provider,'boot');
182
+            if (isset($this->app['loadedProviders'][$key])) {
183
+                $this->applyProvider($key, $provider, 'boot');
184 184
             }
185 185
         }
186 186
     }
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/KernelManifestManager.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
         // if there is manifest propery in the resta
36 36
         // in this case,manifest property is manifest class
37
-        if($app['isAvailableStore']){
37
+        if ($app['isAvailableStore']) {
38 38
             $this->manifest = $this->manifest->resolve("Src\Manifest");
39 39
         }
40 40
 
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $app = clone $this;
63 63
 
64
-        return $this->manifest->call(function() use ($maker,$app){
64
+        return $this->manifest->call(function() use ($maker, $app){
65 65
 
66 66
             // As a parameter, the maker variable comes as
67 67
             // the name of the list to be booted.
68
-            if(isset($this->{$maker})){
68
+            if (isset($this->{$maker})) {
69 69
 
70 70
                 //get default maker list
71 71
                 $app->setMakerList($this->{$maker});
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
                 // we set this condition for users to boot the classes they want in the kernel groups.
74 74
                 // in the manifesto, if the kernel groups method returns an class of arrays
75 75
                 // then these classes will automatically join the kernel groups installation.
76
-                if(isset($this->run) && isset($this->run[$maker]) && is_array($this->run[$maker])){
76
+                if (isset($this->run) && isset($this->run[$maker]) && is_array($this->run[$maker])) {
77 77
 
78 78
                     $appMaker = $this->run[$maker];
79 79
 
80 80
                     // if the makerExtend value in the manifest is a method,
81 81
                     // in this case, the method is executed instead of the object
82
-                    if(method_exists($this,$maker)){
82
+                    if (method_exists($this, $maker)) {
83 83
                         $this->{$maker}(app());
84 84
                     }
85 85
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
             // revision maker
95 95
             // group name to boot
96
-            if(isset($this->revision)){
96
+            if (isset($this->revision)) {
97 97
                 $app->revisionMaker($this->revision);
98 98
             }
99 99
 
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function revisionMaker($revision)
111 111
     {
112
-        if(is_array($revision) && count($this->makerList)){
112
+        if (is_array($revision) && count($this->makerList)) {
113 113
 
114 114
             //We return to the boot list and perform a revision check.
115
-            foreach ($this->makerList as $makerKey=>$makerValue){
115
+            foreach ($this->makerList as $makerKey=>$makerValue) {
116 116
 
117 117
                 // the revision list is presented as a helper method to prevent
118 118
                 // the listener application being booted from taking the entire listener individually.
119
-                if(count($revision) && isset($revision[$makerKey]) && Utils::isNamespaceExists($revision[$makerKey])){
119
+                if (count($revision) && isset($revision[$makerKey]) && Utils::isNamespaceExists($revision[$makerKey])) {
120 120
                     $this->makerList[$makerKey] = $revision[$makerKey];
121 121
 
122 122
                     // if a kernel group key that is changed to revision is an actual class,
123 123
                     // we will save this class to the container object.
124
-                    $this->app->register('revision',$makerValue,$revision[$makerKey]);
124
+                    $this->app->register('revision', $makerValue, $revision[$makerKey]);
125 125
                 }
126 126
             }
127 127
         }
Please login to merge, or discard this patch.
src/resta/Console/Source/Controller/Controller.php 2 patches
Spacing   +34 added lines, -34 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");');
106
-                files()->append($routePath,PHP_EOL.'Route::namespace(\''.$controller.'\')->delete("/'.strtolower($this->argument['file']).'","'.$this->argument['file'].'Controller@delete");');
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
+                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
             }
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
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 150
             $this->touch['service/readme']          = $this->directory['endpoint'].''.DIRECTORY_SEPARATOR.'README.md';
151
-            $this->touch['service/policy']          = $this->directory['policy'].''.DIRECTORY_SEPARATOR.''.$this->argument['serviceClass'].''. $this->argument['callClassPrefix'].'Policy.php';
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/Response/ResponseProvider.php 1 patch
Spacing   +11 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
         //the auto service to be called.
29 29
         return ClosureDispatcher::bind($controllerInstance)->call(function() use($controllerInstance){
30 30
 
31
-            if(property_exists($controllerInstance,'response')){
31
+            if (property_exists($controllerInstance, 'response')) {
32 32
                 return $controllerInstance->response;
33 33
             }
34 34
 
35 35
             // if the client wishes,
36 36
             // data can be returned in the supported format.
37
-            if(app()->has('clientResponseType')){
37
+            if (app()->has('clientResponseType')) {
38 38
                 return app()->get('clientResponseType');
39 39
             }
40 40
 
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
      * @param bool $return
50 50
      * @return void
51 51
      */
52
-    protected function fireEvent($event=null,$return=false)
52
+    protected function fireEvent($event = null, $return = false)
53 53
     {
54 54
         // if an array of response-events is registered
55 55
         // in the container system, the event will fire.
56
-        if($this->app->has('response-event.'.$event)){
56
+        if ($this->app->has('response-event.'.$event)) {
57 57
             $event = $this->app->get('response-event.'.$event);
58 58
 
59 59
             // the event to be fired must be
60 60
             // a closure instance.
61
-            if($event instanceof Closure){
61
+            if ($event instanceof Closure) {
62 62
                 $eventResolved = $event($this->app);
63 63
 
64
-                if($return){
64
+                if ($return) {
65 65
                     return $eventResolved;
66 66
                 }
67 67
             }
@@ -100,8 +100,7 @@  discard block
 block discarded – undo
100 100
     {
101 101
         //we get the response type by checking the instanceController object from the router.
102 102
         //Each type of response is in the base class in project directory.
103
-        return ($this->getControllerInstance()===null) ? core()->responseType :
104
-            $this->appResponseType();
103
+        return ($this->getControllerInstance()===null) ? core()->responseType : $this->appResponseType();
105 104
     }
106 105
 
107 106
     /**
@@ -112,13 +111,13 @@  discard block
 block discarded – undo
112 111
     public function handle()
113 112
     {
114 113
         //definition for singleton instance
115
-        define ('responseApp',true);
114
+        define('responseApp', true);
116 115
 
117 116
         //get out putter for response
118 117
         $formatter = $this->formatter();
119 118
 
120 119
         //if out putter is not null
121
-        if(Utils::isNamespaceExists($formatter)){
120
+        if (Utils::isNamespaceExists($formatter)) {
122 121
 
123 122
             //fire event before response output
124 123
             $this->fireEvent('before');
@@ -133,7 +132,7 @@  discard block
 block discarded – undo
133 132
             // and run the handle method.
134 133
             $result = app()->resolve($formatter)->{$this->getResponseKind()}($outPutter);
135 134
 
136
-            $this->app->register('result',$result);
135
+            $this->app->register('result', $result);
137 136
         }
138 137
     }
139 138
 
@@ -143,7 +142,7 @@  discard block
 block discarded – undo
143 142
      * @param array $data
144 143
      * @return array
145 144
      */
146
-    public function outputFormatter($data=array(),$outputter='json')
145
+    public function outputFormatter($data = array(), $outputter = 'json')
147 146
     {
148 147
         $dataCapsule = config('response.data');
149 148
 
Please login to merge, or discard this patch.
src/resta/Response/ResponseOutManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function __construct($app)
17 17
     {
18
-        $this->app=$app;
18
+        $this->app = $app;
19 19
     }
20 20
 
21 21
     /**
Please login to merge, or discard this patch.
src/resta/Response/ResponseOutput.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
      */
19 19
     private function dataIncludedForPrinter($printer)
20 20
     {
21
-        if(isset(core()->controllerWatch)){
21
+        if (isset(core()->controllerWatch)) {
22 22
 
23 23
             $watch = core()->controllerWatch;
24
-            return array_merge($printer,['watch'=>['memory'=>$watch['memory']]]);
24
+            return array_merge($printer, ['watch'=>['memory'=>$watch['memory']]]);
25 25
         }
26 26
 
27 27
         //return printer
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected function getOutPutter()
43 43
     {
44
-        $output = is_array($eventOutput = $this->fireEvent('output',true))
44
+        $output = is_array($eventOutput = $this->fireEvent('output', true))
45 45
             ? $eventOutput
46 46
             : $this->printer($this->getRouter());
47 47
 
48
-        app()->register('output',$output);
48
+        app()->register('output', $output);
49 49
 
50 50
         return $output;
51 51
     }
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
      * @param array $data
55 55
      * @return array
56 56
      */
57
-    private function hateoasCapsule($data=array())
57
+    private function hateoasCapsule($data = array())
58 58
     {
59
-        return (config('app.hateoas')) ? array_merge($data,config('hateoas')) : $data;
59
+        return (config('app.hateoas')) ? array_merge($data, config('hateoas')) : $data;
60 60
     }
61 61
 
62 62
     /**
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
      * @param callable $callback
73 73
      * @return mixed
74 74
      */
75
-    private function noInExceptionHateoas($output,callable $callback)
75
+    private function noInExceptionHateoas($output, callable $callback)
76 76
     {
77
-        if(isset($output['success']) && false===$output['success']){
77
+        if (isset($output['success']) && false===$output['success']) {
78 78
             return $output;
79 79
         }
80 80
         return call_user_func($callback);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     {
102 102
         //if the system throws an exception,
103 103
         //we subtract the hateoas extension from the output value.
104
-        $this->printer = $this->noInExceptionHateoas($output,function() use ($output){
104
+        $this->printer = $this->noInExceptionHateoas($output, function() use ($output){
105 105
 
106 106
             return array_merge(
107 107
                 $this->metaAdd(),
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
 
116 116
         // If the log feature is available on the kernel,
117 117
         // we run the logger process.
118
-        if(isset(core()->log)){
118
+        if (isset(core()->log)) {
119 119
 
120 120
             // we can run logging after checking
121 121
             // the configuration for the logger process in the LoggerService class
122 122
             // so that,If logging is not allowed in the main configuration file, we will not log.
123
-            return core()->loggerService->checkLoggerConfiguration($this->printer,function($printer){
123
+            return core()->loggerService->checkLoggerConfiguration($this->printer, function($printer) {
124 124
                 return $printer;
125 125
             });
126 126
         }
Please login to merge, or discard this patch.
src/resta/Console/Source/Project/Project.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * @var $type
16 16
      */
17
-    public $type='project';
17
+    public $type = 'project';
18 18
 
19 19
     /**
20 20
      * @var array
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     /**
32 32
      * @var $commandRule
33 33
      */
34
-    public $commandRule=[];
34
+    public $commandRule = [];
35 35
 
36 36
     /**
37 37
      * @method create
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
         $this->directory['projectDir']          = $this->projectPath();
47 47
         $this->argument['exceptionNamespace']   = app()->namespace()->exception();
48 48
         $this->argument['resourcePath']         = app()->path()->appResourche();
49
-        $this->argument['testNamespace']             = app()->namespace()->tests();
49
+        $this->argument['testNamespace'] = app()->namespace()->tests();
50 50
 
51
-        $recursiveDefaultDirectory = explode("\\",$this->argument['project']);
51
+        $recursiveDefaultDirectory = explode("\\", $this->argument['project']);
52 52
         $this->argument['applicationName'] = pos($recursiveDefaultDirectory);
53 53
         $recursiveDefaultDirectory[] = 'V1';
54 54
         $recursiveDefaultDirectoryList = [];
55 55
 
56
-        foreach (array_slice($recursiveDefaultDirectory,1) as $defaultDirectory){
56
+        foreach (array_slice($recursiveDefaultDirectory, 1) as $defaultDirectory) {
57 57
 
58
-            $recursiveDefaultDirectoryList[]=$defaultDirectory;
59
-            $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/",$recursiveDefaultDirectoryList);
58
+            $recursiveDefaultDirectoryList[] = $defaultDirectory;
59
+            $this->directory[$defaultDirectory.'Path'] = $this->projectPath().''.implode("/", $recursiveDefaultDirectoryList);
60 60
         }
61 61
 
62 62
         //$this->directory['optionalDir'] = $this->optional();
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         //$this->directory['sourceDir']               = $this->sourceDir();
83 83
         //$this->directory['sourceSupportDir']        = $this->sourceSupportDir();
84 84
         //$this->directory['sourceSupportTraitDir']   = $this->sourceSupportDir().'/Traits';
85
-        $this->directory['exceptionDir']            = app()->path()->exception();
85
+        $this->directory['exceptionDir'] = app()->path()->exception();
86 86
 
87 87
         //set project directory
88 88
         $this->file->makeDirectory($this);
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
         $this->touch['kernel/exception']            = $this->provider().'/ExceptionServiceProvider.php';
100 100
         $this->touch['kernel/response']             = $this->provider().'/ResponseServiceProvider.php';
101 101
         $this->touch['kernel/entity']               = $this->provider().'/EntityServiceProvider.php';
102
-        $this->touch['kernel/cache']               = $this->provider().'/CacheServiceProvider.php';
102
+        $this->touch['kernel/cache'] = $this->provider().'/CacheServiceProvider.php';
103 103
         $this->touch['kernel/authenticate']         = $this->provider().'/AuthenticateServiceProvider.php';
104 104
         $this->touch['kernel/role']                 = $this->provider().'/RoleServiceProvider.php';
105 105
         $this->touch['kernel/track']                = $this->provider().'/TrackServiceProvider.php';
106
-        $this->touch['test/testcase']              = $this->test().'/TestCase.php';
106
+        $this->touch['test/testcase'] = $this->test().'/TestCase.php';
107 107
         $this->touch['kernel/consoleevent']         = $this->provider().'/ConsoleEventServiceProvider.php';
108 108
         $this->touch['middleware/authenticate']     = $this->middleware().'/Authenticate.php';
109 109
         $this->touch['middleware/ratelimit']        = $this->middleware().'/RateLimit.php';
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $this->touch['app/gitignore']               = $this->projectPath().'/.gitignore';
145 145
         $this->touch['app/composer']                = $this->projectPath().'/composer.json';
146 146
         $this->touch['test/index']                  = $this->storage().'/index.html';
147
-        $this->touch['exception/authenticate']      = $this->directory['exceptionDir'] .'/AuthenticateException.php';
147
+        $this->touch['exception/authenticate']      = $this->directory['exceptionDir'].'/AuthenticateException.php';
148 148
 
149 149
         //set project touch
150 150
         $this->file->touch($this);
Please login to merge, or discard this patch.
src/resta/Console/Source/Model/Model.php 1 patch
Spacing   +20 added lines, -20 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='model';
18
+    public $type = 'model';
19 19
 
20 20
     /**
21 21
      * @var array
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * @var $commandRule
34 34
      */
35
-    public $commandRule=['model','?table'];
35
+    public $commandRule = ['model', '?table'];
36 36
 
37 37
     /**
38 38
      * @method create
39 39
      * @return mixed
40 40
      */
41
-    public function create(){
41
+    public function create() {
42 42
 
43 43
         $this->argument['file'] = $this->argument['model'];
44 44
 
45
-        if(!isset($this->argument['table'])){
45
+        if (!isset($this->argument['table'])) {
46 46
             $this->argument['table'] = $this->argument['file'].'s';
47 47
         }
48 48
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $this->directory['modelDir']    = app()->path()->model();
53 53
         $this->directory['builderDir']  = $this->directory['modelDir'].'/Builder';
54
-        $this->directory['builderAssistantDir']  = $this->directory['modelDir'].'/Builder/Assistant';
54
+        $this->directory['builderAssistantDir'] = $this->directory['modelDir'].'/Builder/Assistant';
55 55
         $this->directory['contract']    = $this->directory['modelDir'].'/Contract';
56 56
         $this->directory['helper']      = $this->directory['modelDir'].'/Helper';
57 57
 
@@ -66,22 +66,22 @@  discard block
 block discarded – undo
66 66
         //model set
67 67
         $this->touch['model/model']     = $this->directory['modelDir'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'.php';
68 68
         $this->touch['model/builder']   = $this->directory['builderDir'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'Builder.php';
69
-        $this->touch['model/builderasistant']   = $this->directory['builderAssistantDir'].''.DIRECTORY_SEPARATOR.'Builder.php';
69
+        $this->touch['model/builderasistant'] = $this->directory['builderAssistantDir'].''.DIRECTORY_SEPARATOR.'Builder.php';
70 70
         $this->touch['model/contract']  = $this->directory['contract'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'Contract.php';
71 71
 
72
-        if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php')){
72
+        if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php')) {
73 73
             $this->touch['model/scope'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php';
74 74
         }
75 75
 
76
-        if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php')){
76
+        if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php')) {
77 77
             $this->touch['model/event'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php';
78 78
         }
79 79
 
80
-        if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'TableChanges.php')){
80
+        if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'TableChanges.php')) {
81 81
             $this->touch['model/tablechanges'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'TableChanges.php';
82 82
         }
83 83
 
84
-        if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Constructor.php')){
84
+        if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Constructor.php')) {
85 85
             $this->touch['model/constructor'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'Constructor.php';
86 86
         }
87 87
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
         $entityDir = $this->directory['modelDir'].''.DIRECTORY_SEPARATOR.'Entity';
91 91
 
92
-        if(!file_exists($entityDir)){
92
+        if (!file_exists($entityDir)) {
93 93
             files()->makeDirectory($entityDir);
94 94
         }
95 95
 
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
         $entityClass = $entityDir.''.DIRECTORY_SEPARATOR.''.$entityTableName.''.DIRECTORY_SEPARATOR.''.$entityTableName;
99 99
 
100 100
 
101
-        $generator = new Generator($entityDir,'EntityMap');
101
+        $generator = new Generator($entityDir, 'EntityMap');
102 102
 
103
-        if(!file_exists($entityDir.''.DIRECTORY_SEPARATOR.'EntityMap.php')){
103
+        if (!file_exists($entityDir.''.DIRECTORY_SEPARATOR.'EntityMap.php')) {
104 104
 
105 105
             //$this->setAnnotations();
106 106
             $generator->createClass();
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         $entityMapNamespaceResolve = new $entityMapNamespace;
112 112
 
113
-        if(!method_exists($entityMapNamespaceResolve,strtolower($this->argument['table']))){
113
+        if (!method_exists($entityMapNamespaceResolve, strtolower($this->argument['table']))) {
114 114
 
115 115
             $generator->createClassUse([
116 116
                 Utils::getNamespace($entityClass)
@@ -140,15 +140,15 @@  discard block
 block discarded – undo
140 140
 
141 141
 
142 142
         //set builder map
143
-        $generator = new Generator($this->directory['builderDir'],'BuilderMap');
143
+        $generator = new Generator($this->directory['builderDir'], 'BuilderMap');
144 144
 
145
-        if(!file_exists($this->directory['builderDir'].''.DIRECTORY_SEPARATOR.'BuilderMap.php')){
145
+        if (!file_exists($this->directory['builderDir'].''.DIRECTORY_SEPARATOR.'BuilderMap.php')) {
146 146
 
147 147
             $this->setAnnotations();
148 148
             $generator->createClass();
149 149
         }
150 150
 
151
-        if(!file_exists($this->touch['model/model'])){
151
+        if (!file_exists($this->touch['model/model'])) {
152 152
 
153 153
             $generator->createMethod([
154 154
                 strtolower($this->argument['file'])
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         }
170 170
 
171 171
         //set project touch
172
-        $this->file->touch($this,[
172
+        $this->file->touch($this, [
173 173
             'stub'=>'Model_Create'
174 174
         ]);
175 175
 
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
     /**
181 181
      * @return bool
182 182
      */
183
-    private function setAnnotations(){
183
+    private function setAnnotations() {
184 184
 
185 185
         $entityMap = app()->path()->model().''.DIRECTORY_SEPARATOR.'Entity'.DIRECTORY_SEPARATOR.'EntityMap.php';
186 186
 
187
-        if(file_exists($entityMap)){
187
+        if (file_exists($entityMap)) {
188 188
 
189 189
             Utils::changeClass(path()->serviceAnnotations().'.php',
190 190
                 [
Please login to merge, or discard this patch.