Passed
Push — master ( a9f91b...39332f )
by Php Easy Api
03:03
created
src/resta/Foundation/Bootstrapper/KernelManifestManager.php 1 patch
Spacing   +11 added lines, -11 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
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                     // if the maker is present on a method basis, then the maker list values ​​must be true or false.
91 91
                     // if one of the maker classes is false will not load this maker class.
92 92
                     foreach ($kernelMakers as $kernelMakerAbstract=>$kernelMaker) {
93
-                        if($kernelMaker){
93
+                        if ($kernelMaker) {
94 94
                             $kernelMakers[$kernelMakerAbstract] = $appMaker[$kernelMakerAbstract];
95 95
                         }
96 96
                     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
             // revision maker
104 104
             // group name to boot
105
-            if(isset($this->revision)){
105
+            if (isset($this->revision)) {
106 106
                 $app->revisionMaker($this->revision);
107 107
             }
108 108
 
@@ -118,19 +118,19 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function revisionMaker($revision)
120 120
     {
121
-        if(is_array($revision) && count($this->makerList)){
121
+        if (is_array($revision) && count($this->makerList)) {
122 122
 
123 123
             //We return to the boot list and perform a revision check.
124
-            foreach ($this->makerList as $makerKey=>$makerValue){
124
+            foreach ($this->makerList as $makerKey=>$makerValue) {
125 125
 
126 126
                 // the revision list is presented as a helper method to prevent
127 127
                 // the listener application being booted from taking the entire listener individually.
128
-                if(count($revision) && isset($revision[$makerKey]) && Utils::isNamespaceExists($revision[$makerKey])){
128
+                if (count($revision) && isset($revision[$makerKey]) && Utils::isNamespaceExists($revision[$makerKey])) {
129 129
                     $this->makerList[$makerKey] = $revision[$makerKey];
130 130
 
131 131
                     // if a kernel group key that is changed to revision is an actual class,
132 132
                     // we will save this class to the container object.
133
-                    $this->app->register('revision',$makerValue,$revision[$makerKey]);
133
+                    $this->app->register('revision', $makerValue, $revision[$makerKey]);
134 134
                 }
135 135
             }
136 136
         }
Please login to merge, or discard this patch.
src/resta/Request/RequestAnnotationAbstract.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      * @param $key
23 23
      * @return mixed
24 24
      */
25
-    abstract function annotation($method,$key);
25
+    abstract function annotation($method, $key);
26 26
 
27 27
     /**
28 28
      * get input values from request object
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @param $reflection
54 54
      */
55
-    public function setReflection($reflection){
55
+    public function setReflection($reflection) {
56 56
 
57 57
         $this->request = ClosureDispatcher::bind($reflection);
58 58
     }
Please login to merge, or discard this patch.
src/resta/Request/RequestAnnotationManager.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@  discard block
 block discarded – undo
69 69
             //catch exception
70 70
             exception($this->exceptionParams[$key]['name'],$keyParams)
71 71
                 ->unexpectedValue($key.' input value is not valid as format ('.$data.')');
72
-        }
73
-        else{
72
+        } else{
74 73
             //catch exception
75 74
             exception()->unexpectedValue($key.' input value is not valid as format ('.$data.')');
76 75
         }
@@ -128,8 +127,7 @@  discard block
 block discarded – undo
128 127
                             $this->catchException($key,$regex[1]);
129 128
                         }
130 129
                     }
131
-                }
132
-                else{
130
+                } else{
133 131
 
134 132
                     // we control the regex rule that evaluates when only string arrives.
135 133
                     if(!preg_match('@'.$regex[1].'@is',$this->inputs[$key])){
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * @param ApplicationContracts $app
22 22
      * @param $request
23 23
      */
24
-    public function __construct(ApplicationContracts $app,$request)
24
+    public function __construct(ApplicationContracts $app, $request)
25 25
     {
26 26
         parent::__construct($app);
27 27
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @param $key
38 38
      * @return mixed|void
39 39
      */
40
-    public function annotation($method,$key)
40
+    public function annotation($method, $key)
41 41
     {
42 42
         //set annotation value with getting reflection
43 43
         $reflection = $this->getReflection('reflection')->reflectionMethodParams($method);
@@ -62,18 +62,18 @@  discard block
 block discarded – undo
62 62
      * @param string $key
63 63
      * @param null|string $data
64 64
      */
65
-    private function catchException($key,$data)
65
+    private function catchException($key, $data)
66 66
     {
67
-        if(isset($this->exceptionParams[$key])){
67
+        if (isset($this->exceptionParams[$key])) {
68 68
 
69 69
             //get key params for exception params
70 70
             $keyParams = ($this->exceptionParams[$key]['params']) ?? [];
71 71
 
72 72
             //catch exception
73
-            exception($this->exceptionParams[$key]['name'],$keyParams)
73
+            exception($this->exceptionParams[$key]['name'], $keyParams)
74 74
                 ->unexpectedValue($key.' input value is not valid as format ('.$data.')');
75 75
         }
76
-        else{
76
+        else {
77 77
             //catch exception
78 78
             exception()->unexpectedValue($key.' input value is not valid as format ('.$data.')');
79 79
         }
@@ -86,23 +86,23 @@  discard block
 block discarded – undo
86 86
      */
87 87
     private function getException($key)
88 88
     {
89
-        if(preg_match('@exception\((.*?)\)\r\n@is',$this->annotation,$exception)){
89
+        if (preg_match('@exception\((.*?)\)\r\n@is', $this->annotation, $exception)) {
90 90
 
91
-            $exceptionSpaceExplode = explode(" ",$exception[1]);
91
+            $exceptionSpaceExplode = explode(" ", $exception[1]);
92 92
 
93
-            foreach ($exceptionSpaceExplode as $exceptions){
94
-                $exceptionsDotExplode = explode(":",$exceptions);
93
+            foreach ($exceptionSpaceExplode as $exceptions) {
94
+                $exceptionsDotExplode = explode(":", $exceptions);
95 95
                 $this->exceptionParams[$key][$exceptionsDotExplode[0]] = $exceptionsDotExplode[1];
96 96
             }
97 97
 
98
-            if(isset($this->exceptionParams[$key]['params'])){
98
+            if (isset($this->exceptionParams[$key]['params'])) {
99 99
 
100
-                $paramsCommaExplode = explode(",",$this->exceptionParams[$key]['params']);
100
+                $paramsCommaExplode = explode(",", $this->exceptionParams[$key]['params']);
101 101
                 unset($this->exceptionParams[$key]['params']);
102 102
 
103
-                foreach ($paramsCommaExplode as $params){
104
-                    $paramsEqualExplode = explode("=",$params);
105
-                    if(isset($paramsEqualExplode[0]) && isset($paramsEqualExplode[1])){
103
+                foreach ($paramsCommaExplode as $params) {
104
+                    $paramsEqualExplode = explode("=", $params);
105
+                    if (isset($paramsEqualExplode[0]) && isset($paramsEqualExplode[1])) {
106 106
                         $this->exceptionParams[$key]['params'][$paramsEqualExplode[0]] = $paramsEqualExplode[1];
107 107
                     }
108 108
                 }
@@ -119,24 +119,24 @@  discard block
 block discarded – undo
119 119
     {
120 120
         // with the method based regex annotation,
121 121
         // we check the rule definition for our requests.
122
-        if(preg_match('@regex\((.*?)\)\r\n@is',$this->annotation,$regex)){
123
-            if(isset($this->inputs[$key])){
122
+        if (preg_match('@regex\((.*?)\)\r\n@is', $this->annotation, $regex)) {
123
+            if (isset($this->inputs[$key])) {
124 124
 
125 125
                 // for the definition of rules,
126 126
                 // our inputs can be array and in this case we offer array option for user comfort.
127
-                if(is_array($this->inputs[$key])){
127
+                if (is_array($this->inputs[$key])) {
128 128
 
129
-                    foreach ($this->inputs[$key] as $this->inputsKey => $this->inputsValue){
130
-                        if(!preg_match('@'.$regex[1].'@is',$this->inputsValue)){
131
-                            $this->catchException($key,$regex[1]);
129
+                    foreach ($this->inputs[$key] as $this->inputsKey => $this->inputsValue) {
130
+                        if (!preg_match('@'.$regex[1].'@is', $this->inputsValue)) {
131
+                            $this->catchException($key, $regex[1]);
132 132
                         }
133 133
                     }
134 134
                 }
135
-                else{
135
+                else {
136 136
 
137 137
                     // we control the regex rule that evaluates when only string arrives.
138
-                    if(!preg_match('@'.$regex[1].'@is',$this->inputs[$key])){
139
-                        $this->catchException($key,$regex[1]);
138
+                    if (!preg_match('@'.$regex[1].'@is', $this->inputs[$key])) {
139
+                        $this->catchException($key, $regex[1]);
140 140
                     }
141 141
                 }
142 142
             }
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
      */
152 152
     private function getRemove($key)
153 153
     {
154
-        if(preg_match('@remove\((.*?)\)\r\n@is',$this->annotation,$remove)){
155
-            if(isset($this->inputs[$key])){
156
-                if(preg_match('@'.$remove[1].'@is',$this->inputs[$key])){
154
+        if (preg_match('@remove\((.*?)\)\r\n@is', $this->annotation, $remove)) {
155
+            if (isset($this->inputs[$key])) {
156
+                if (preg_match('@'.$remove[1].'@is', $this->inputs[$key])) {
157 157
                     unset($this->inputs[$key]);
158 158
                 }
159 159
             }
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
      */
168 168
     private function getRules($key)
169 169
     {
170
-        if(preg_match('@rule\((.*?)\)\r\n@is',$this->annotation,$rule)){
170
+        if (preg_match('@rule\((.*?)\)\r\n@is', $this->annotation, $rule)) {
171 171
 
172 172
             $requestRules = $this->getReflection('rules');
173 173
 
174
-            $rules = explode(":",$rule[1]);
175
-            if(isset($this->inputs[$key])){
176
-                foreach($rules as $rule){
177
-                    if(isset($requestRules[$rule])){
178
-                        if(!preg_match('@'.$requestRules[$rule].'@',$this->inputs[$key])){
179
-                            exception($rule,['key'=>$key])
174
+            $rules = explode(":", $rule[1]);
175
+            if (isset($this->inputs[$key])) {
176
+                foreach ($rules as $rule) {
177
+                    if (isset($requestRules[$rule])) {
178
+                        if (!preg_match('@'.$requestRules[$rule].'@', $this->inputs[$key])) {
179
+                            exception($rule, ['key'=>$key])
180 180
                                 ->invalidArgument($key.' input value is not valid for '.$rule.' request rule');
181 181
                         }
182 182
                     }
Please login to merge, or discard this patch.
src/resta/Request/Request.php 2 patches
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -54,25 +54,25 @@  discard block
 block discarded – undo
54 54
     private function autoValidate($validate)
55 55
     {
56 56
         //we get the values ​​to auto-validate.
57
-        foreach ($this->{$validate} as $object=>$datas){
57
+        foreach ($this->{$validate} as $object=>$datas) {
58 58
 
59 59
             // the auto-validate value must necessarily represent a class.
60 60
             // otherwise auto-validate is not used.
61
-            if(Utils::isNamespaceExists($object)){
61
+            if (Utils::isNamespaceExists($object)) {
62 62
                 $getObjectInstance = app()->resolve($object);
63 63
 
64 64
                 // we get the index values,
65 65
                 // which are called methods of the auto-validate value that represents the class.
66
-                foreach ($datas as $dataKey=>$data){
66
+                foreach ($datas as $dataKey=>$data) {
67 67
 
68 68
                     // if the methods of the auto-validate class resolved by the container resolve method apply,
69 69
                     // the process of auto-validate automatic implementation will be completed.
70
-                    if(is_numeric($dataKey) && method_exists($getObjectInstance,$data)){
71
-                        if(isset($this->origin[$data])){
72
-                            if(!is_array($this->origin[$data])){
70
+                    if (is_numeric($dataKey) && method_exists($getObjectInstance, $data)) {
71
+                        if (isset($this->origin[$data])) {
72
+                            if (!is_array($this->origin[$data])) {
73 73
                                 $this->origin[$data] = array($this->origin[$data]);
74 74
                             }
75
-                            foreach ($this->origin[$data] as $originData){
75
+                            foreach ($this->origin[$data] as $originData) {
76 76
                                 $getObjectInstance->{$data}($originData);
77 77
                             }
78 78
                         }
@@ -94,16 +94,16 @@  discard block
 block discarded – undo
94 94
 
95 95
         // Determines which HTTP method
96 96
         // the request object will be exposed to.
97
-        if($this->checkProperties('http')){
97
+        if ($this->checkProperties('http')) {
98 98
 
99 99
             // if the current http method does not exist
100 100
             // in the http object, the exception will be thrown.
101
-            if(!in_array($method,$this->http)){
101
+            if (!in_array($method, $this->http)) {
102 102
 
103 103
                 //exception batMethodCall
104 104
                 exception()->badMethodCall(
105 105
                     'Invalid http method process for 
106
-                    '.class_basename($this).'.That is accepted http methods ['.implode(",",$this->http).'] ');
106
+                    '.class_basename($this).'.That is accepted http methods ['.implode(",", $this->http).'] ');
107 107
             }
108 108
         }
109 109
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     {
119 119
         // from the properties of the object properties to
120 120
         // the existing variables, control the array and at least one element.
121
-        return (property_exists($this,$properties)
121
+        return (property_exists($this, $properties)
122 122
             && is_array($this->{$properties}) && count($this->{$properties})) ? true : false;
123 123
     }
124 124
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     {
132 132
         // we are saving the expected values ​​for the request in container.
133 133
         // this record can be returned in exception information.
134
-        app()->register('requestExpected',$this->expected);
134
+        app()->register('requestExpected', $this->expected);
135 135
     }
136 136
 
137 137
     /**
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
     public function except($except)
144 144
     {
145 145
         // the except parameter is a callable value.
146
-        if(is_callable($except)){
147
-            $call = call_user_func_array($except,[$this]);
146
+        if (is_callable($except)) {
147
+            $call = call_user_func_array($except, [$this]);
148 148
             $except = $call;
149 149
         }
150 150
 
151 151
         // except with the except exceptions property
152 152
         // and then assigning them to the inputs property.
153
-        $this->except = array_merge($this->except,$except);
154
-        $this->inputs = array_diff_key($this->inputs,array_flip($this->except));
153
+        $this->except = array_merge($this->except, $except);
154
+        $this->inputs = array_diff_key($this->inputs, array_flip($this->except));
155 155
 
156 156
         return $this;
157 157
     }
@@ -165,28 +165,28 @@  discard block
 block discarded – undo
165 165
     {
166 166
         // expected method is executed.
167 167
         // this method is a must for http method values to be found in this property.
168
-        if($this->checkProperties('expected')){
168
+        if ($this->checkProperties('expected')) {
169 169
 
170 170
             // if the expected values are not found in the inputs array,
171 171
             // the exception will be thrown.
172
-            foreach ($this->expected as $expected){
172
+            foreach ($this->expected as $expected) {
173 173
 
174 174
                 $expectedValues = [];
175 175
 
176 176
                 // mandatory expected data for each key can be separated by | operator.
177 177
                 // this is evaluated as "or".
178
-                foreach($expectedData = explode("|",$expected) as $inputs){
179
-                    if(!isset($this->inputs[$inputs])){
178
+                foreach ($expectedData = explode("|", $expected) as $inputs) {
179
+                    if (!isset($this->inputs[$inputs])) {
180 180
                         $expectedValues[] = $inputs;
181 181
                     }
182 182
                 }
183 183
 
184 184
                 // if the expectedData and expectedValues ​​
185 185
                 // array are numerically equal to the expected key, the exception is thrown.
186
-                if(count($expectedData)===count($expectedValues)){
186
+                if (count($expectedData)===count($expectedValues)) {
187 187
                     exception()
188 188
                         ->unexpectedValue('You absolutely have to send the value 
189
-                        '.implode(" or ",$expectedValues).' for request object');
189
+                        '.implode(" or ", $expectedValues).' for request object');
190 190
                 }
191 191
             }
192 192
         }
@@ -201,17 +201,17 @@  discard block
 block discarded – undo
201 201
     {
202 202
         // check the presence of the generator object
203 203
         // and operate the generator over this object.
204
-        if($this->checkProperties('auto_generators')){
204
+        if ($this->checkProperties('auto_generators')) {
205 205
             $generators = $this->getAutoGenerators();
206 206
         }
207 207
 
208 208
         // check the presence of the generator object
209 209
         // and operate the generator over this object.
210
-        if($this->checkProperties('generators')){
211
-            $generators = array_merge(isset($generators) ? $generators: [],$this->getGenerators());
210
+        if ($this->checkProperties('generators')) {
211
+            $generators = array_merge(isset($generators) ? $generators : [], $this->getGenerators());
212 212
         }
213 213
 
214
-        if(isset($generators)){
214
+        if (isset($generators)) {
215 215
             $this->generatorMethod($generators);
216 216
         }
217 217
     }
@@ -224,30 +224,30 @@  discard block
 block discarded – undo
224 224
     private function generatorMethod($generators)
225 225
     {
226 226
         //generator array object
227
-        foreach ($generators as $generator){
227
+        foreach ($generators as $generator) {
228 228
 
229 229
             //generator method name
230 230
             $generatorMethodName = $generator.'Generator';
231 231
 
232 232
             // if the generator method is present,
233 233
             // the fake value is assigned.
234
-            if(method_exists($this,$generatorMethodName)){
234
+            if (method_exists($this, $generatorMethodName)) {
235 235
 
236 236
                 //fake registration
237
-                if(!isset($this->inputs[$generator])){
237
+                if (!isset($this->inputs[$generator])) {
238 238
                     $this->{$generator} = $this->{$generatorMethodName}();
239 239
                     $this->inputs[$generator] = $this->{$generatorMethodName}();
240 240
                 }
241 241
                 else {
242 242
 
243
-                    if($this->checkProperties('auto_generators_dont_overwrite')
244
-                        && in_array($generator,$this->getAutoGeneratorsDontOverwrite())){
243
+                    if ($this->checkProperties('auto_generators_dont_overwrite')
244
+                        && in_array($generator, $this->getAutoGeneratorsDontOverwrite())) {
245 245
                         $this->{$generator} = $this->{$generatorMethodName}();
246 246
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
247 247
                     }
248 248
 
249
-                    if($this->checkProperties('generators_dont_overwrite')
250
-                        && in_array($generator,$this->getGeneratorsDontOverwrite())){
249
+                    if ($this->checkProperties('generators_dont_overwrite')
250
+                        && in_array($generator, $this->getGeneratorsDontOverwrite())) {
251 251
                         $this->{$generator} = $this->{$generatorMethodName}();
252 252
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
253 253
                     }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     {
293 293
         // we use the http method to write
294 294
         // the values to the inputs and origin properties.
295
-        foreach($this->requestHttp->resolve() as $key=>$value){
295
+        foreach ($this->requestHttp->resolve() as $key=>$value) {
296 296
 
297 297
             //inputs and origin properties
298 298
             $this->inputs[$key] = $value;
@@ -336,9 +336,9 @@  discard block
 block discarded – undo
336 336
 
337 337
         // we update the input values ​​after
338 338
         // we receive and check the saved objects.
339
-        foreach ($clientObjects as $key=>$value){
339
+        foreach ($clientObjects as $key=>$value) {
340 340
 
341
-            if(isset($clientObjects['origin'][$key])){
341
+            if (isset($clientObjects['origin'][$key])) {
342 342
 
343 343
                 $this->{$key} = $clientObjects['origin'][$key];
344 344
                 $this->inputs[$key] = $this->{$key};
@@ -363,11 +363,11 @@  discard block
 block discarded – undo
363 363
 
364 364
         // the request update to be performed using
365 365
         // the method name to be used with the http method.
366
-        $this->setRequestInputs($requestMethod,$key);
366
+        $this->setRequestInputs($requestMethod, $key);
367 367
 
368 368
         // the request update to be performed using
369 369
         // the method name to be used without the http method.
370
-        $this->setRequestInputs($key,$key);
370
+        $this->setRequestInputs($key, $key);
371 371
     }
372 372
 
373 373
     /**
@@ -376,28 +376,28 @@  discard block
 block discarded – undo
376 376
      * @param $method
377 377
      * @param $key
378 378
      */
379
-    private function setRequestInputs($method,$key)
379
+    private function setRequestInputs($method, $key)
380 380
     {
381
-        if(method_exists($this,$method) && $this->reflection->reflectionMethodParams($method)->isProtected){
381
+        if (method_exists($this, $method) && $this->reflection->reflectionMethodParams($method)->isProtected) {
382 382
 
383 383
             //check annotations for method
384
-            $annotation = app()->resolve(RequestAnnotationManager::class,['request'=>$this]);
385
-            $annotation->annotation($method,$key);
384
+            $annotation = app()->resolve(RequestAnnotationManager::class, ['request'=>$this]);
385
+            $annotation->annotation($method, $key);
386 386
 
387
-            if(isset($this->inputs[$key]) && is_array($this->inputs[$key])){
387
+            if (isset($this->inputs[$key]) && is_array($this->inputs[$key])) {
388 388
 
389 389
                 $inputKeys = $this->inputs[$key];
390 390
 
391 391
                 $this->inputs[$key] = [];
392
-                foreach ($inputKeys as $input){
392
+                foreach ($inputKeys as $input) {
393 393
 
394 394
                     $this->{$key}           = $input;
395 395
                     $keyMethod              = $this->{$method}();
396 396
                     $this->inputs[$key][]   = $keyMethod;
397 397
                 }
398 398
             }
399
-            else{
400
-                if(isset($this->inputs[$key])){
399
+            else {
400
+                if (isset($this->inputs[$key])) {
401 401
                     $keyMethod = $this->{$method}();
402 402
                     $this->inputs[$key] = $keyMethod;
403 403
                 }
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
     {
416 416
         // the auto object validate property is the property
417 417
         // where all of your request values ​​are automatically validated.
418
-        if(property_exists($this,'autoObjectValidate')
419
-            && is_array($this->autoObjectValidate) && count($this->autoObjectValidate)){
418
+        if (property_exists($this, 'autoObjectValidate')
419
+            && is_array($this->autoObjectValidate) && count($this->autoObjectValidate)) {
420 420
             $this->autoValidate('autoObjectValidate');
421 421
         }
422 422
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -237,8 +237,7 @@  discard block
 block discarded – undo
237 237
                 if(!isset($this->inputs[$generator])){
238 238
                     $this->{$generator} = $this->{$generatorMethodName}();
239 239
                     $this->inputs[$generator] = $this->{$generatorMethodName}();
240
-                }
241
-                else {
240
+                } else {
242 241
 
243 242
                     if($this->checkProperties('auto_generators_dont_overwrite')
244 243
                         && in_array($generator,$this->getAutoGeneratorsDontOverwrite())){
@@ -395,8 +394,7 @@  discard block
 block discarded – undo
395 394
                     $keyMethod              = $this->{$method}();
396 395
                     $this->inputs[$key][]   = $keyMethod;
397 396
                 }
398
-            }
399
-            else{
397
+            } else{
400 398
                 if(isset($this->inputs[$key])){
401 399
                     $keyMethod = $this->{$method}();
402 400
                     $this->inputs[$key] = $keyMethod;
Please login to merge, or discard this patch.
src/resta/Request/RequestAbstract.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     protected function getAutoGenerators()
33 33
     {
34
-        if(property_exists($this,'auto_generators')){
34
+        if (property_exists($this, 'auto_generators')) {
35 35
             return $this->auto_generators;
36 36
         }
37 37
         return [];
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     protected function getAutoGeneratorsDontOverwrite()
47 47
     {
48
-        if(property_exists($this,'auto_generators_dont_overwrite')){
48
+        if (property_exists($this, 'auto_generators_dont_overwrite')) {
49 49
             return $this->auto_generators_dont_overwrite;
50 50
         }
51 51
         return [];
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function getClientObjects()
61 61
     {
62
-        return array_diff_key($this->getObjects(),['inputs'=>[]]);
62
+        return array_diff_key($this->getObjects(), ['inputs'=>[]]);
63 63
     }
64 64
 
65 65
     /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     protected function getGenerators()
71 71
     {
72
-        if(property_exists($this,'generators')){
72
+        if (property_exists($this, 'generators')) {
73 73
             return $this->generators;
74 74
         }
75 75
         return [];
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     protected function getGeneratorsDontOverwrite()
85 85
     {
86
-        if(property_exists($this,'generators_dont_overwrite')){
86
+        if (property_exists($this, 'generators_dont_overwrite')) {
87 87
             return $this->generators_dont_overwrite;
88 88
         }
89 89
         return [];
Please login to merge, or discard this patch.
src/resta/Foundation/PathManager/StaticPathRepository.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
      * @param null $app
13 13
      * @return string
14 14
      */
15
-    public function app($app=null)
15
+    public function app($app = null)
16 16
     {
17
-        $app=($app===null) ? $this->appDetector() : $app;
17
+        $app = ($app===null) ? $this->appDetector() : $app;
18 18
         return StaticPathModel::appPath().''.DIRECTORY_SEPARATOR.''.Str::slashToBackSlash($app);
19 19
     }
20 20
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param null $app
39 39
      * @return string
40 40
      */
41
-    public function appCall($app=null)
41
+    public function appCall($app = null)
42 42
     {
43 43
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$controller;
44 44
     }
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      * @param null $app
57 57
      * @return string
58 58
      */
59
-    public function appConfig($app=null)
59
+    public function appConfig($app = null)
60 60
     {
61
-        if(isset(core()->paths['config'])){
61
+        if (isset(core()->paths['config'])) {
62 62
             return core()->paths['config'];
63 63
         }
64 64
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$config;
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
      * @param null $app
69 69
      * @return string
70 70
      */
71
-    public function appHelpers($app=null)
71
+    public function appHelpers($app = null)
72 72
     {
73
-        if(isset(core()->paths['config'])){
73
+        if (isset(core()->paths['config'])) {
74 74
             return core()->paths['config'];
75 75
         }
76 76
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$helpers;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @param null $app
89 89
      * @return mixed
90 90
      */
91
-    public function appFactory($app=null)
91
+    public function appFactory($app = null)
92 92
     {
93 93
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$factory;
94 94
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function appKernel()
100 100
     {
101
-        $kernel     = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel;
101
+        $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel;
102 102
 
103 103
         return $kernel;
104 104
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function appProvider()
110 110
     {
111
-        $kernel     = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel.''.DIRECTORY_SEPARATOR.''.StaticPathList::$provider;
111
+        $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel.''.DIRECTORY_SEPARATOR.''.StaticPathList::$provider;
112 112
 
113 113
         return $kernel;
114 114
     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      * @param null $app
134 134
      * @return mixed
135 135
      */
136
-    public function appLogger($app=null)
136
+    public function appLogger($app = null)
137 137
     {
138 138
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceLogManager';
139 139
     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @param null $app
143 143
      * @return mixed
144 144
      */
145
-    public function appMiddleware($app=null)
145
+    public function appMiddleware($app = null)
146 146
     {
147 147
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$middleware;
148 148
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      * @param null $app
152 152
      * @return mixed
153 153
      */
154
-    public function appMigration($app=null)
154
+    public function appMigration($app = null)
155 155
     {
156 156
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$migration;
157 157
     }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param null $app
161 161
      * @return mixed
162 162
      */
163
-    public function appModel($app=null)
163
+    public function appModel($app = null)
164 164
     {
165 165
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$model;
166 166
     }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * @param null $app
170 170
      * @return mixed
171 171
      */
172
-    public function appException($app=null)
172
+    public function appException($app = null)
173 173
     {
174 174
         return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$exception;
175 175
     }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      * @param null $app
179 179
      * @return mixed
180 180
      */
181
-    public function appOptionalEvents($app=null)
181
+    public function appOptionalEvents($app = null)
182 182
     {
183 183
         return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$events;
184 184
     }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      * @param null $app
188 188
      * @return mixed
189 189
      */
190
-    public function appOptionalJob($app=null)
190
+    public function appOptionalJob($app = null)
191 191
     {
192 192
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$job;
193 193
     }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * @param null $app
197 197
      * @return mixed
198 198
      */
199
-    public function appOptionalListeners($app=null)
199
+    public function appOptionalListeners($app = null)
200 200
     {
201 201
         return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$listeners;
202 202
     }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      * @param null $app
206 206
      * @return mixed
207 207
      */
208
-    public function appOptionalSubscribers($app=null)
208
+    public function appOptionalSubscribers($app = null)
209 209
     {
210 210
         return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$listeners.''.DIRECTORY_SEPARATOR.''.StaticPathList::$subscribers;
211 211
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      */
224 224
     public function appRepository()
225 225
     {
226
-        $repository     = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$repository;
226
+        $repository = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$repository;
227 227
 
228 228
         return $repository;
229 229
     }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      * @param null $app
241 241
      * @return mixed
242 242
      */
243
-    public function appOptionalSource($app=null)
243
+    public function appOptionalSource($app = null)
244 244
     {
245 245
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$sourcePath;
246 246
     }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * @param null $app
250 250
      * @return mixed
251 251
      */
252
-    public function appOptionalWebservice($app=null)
252
+    public function appOptionalWebservice($app = null)
253 253
     {
254 254
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$webservice;
255 255
     }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      * @param null $app
267 267
      * @return mixed
268 268
      */
269
-    public function appServiceAnnotations($app=null)
269
+    public function appServiceAnnotations($app = null)
270 270
     {
271 271
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$serviceAnnotations;
272 272
     }
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      * @param null $app
276 276
      * @return mixed
277 277
      */
278
-    public function appServiceContainer($app=null)
278
+    public function appServiceContainer($app = null)
279 279
     {
280 280
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceContainerController';
281 281
     }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      * @param null $app
285 285
      * @return mixed
286 286
      */
287
-    public function appServiceEventDispatcher($app=null)
287
+    public function appServiceEventDispatcher($app = null)
288 288
     {
289 289
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceEventDispatcherManager';
290 290
     }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
      * @param null $app
294 294
      * @return mixed
295 295
      */
296
-    public function appServiceMiddleware($app=null)
296
+    public function appServiceMiddleware($app = null)
297 297
     {
298 298
         return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$serviceMiddleware;
299 299
     }
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
      * @param null $app
321 321
      * @return mixed
322 322
      */
323
-    public function appVersion($app=null)
323
+    public function appVersion($app = null)
324 324
     {
325
-        if(defined('app')){
325
+        if (defined('app')) {
326 326
 
327 327
             $prefixGroup = Str::slashToBackSlash(StaticPathList::$projectPrefixGroup);
328 328
 
@@ -366,19 +366,19 @@  discard block
 block discarded – undo
366 366
      * @param bool $bool
367 367
      * @return mixed
368 368
      */
369
-    public function controller($controller=null,$bool=false)
369
+    public function controller($controller = null, $bool = false)
370 370
     {
371 371
         $namespaceController = ($controller===null) ? app()->namespace()->controller()
372
-            : app()->namespace()->controller($controller,true);
372
+            : app()->namespace()->controller($controller, true);
373 373
 
374
-        if($bool){
375
-            $namespaceControllerExplode = explode("\\",$namespaceController);
374
+        if ($bool) {
375
+            $namespaceControllerExplode = explode("\\", $namespaceController);
376 376
             array_pop($namespaceControllerExplode);
377 377
 
378
-            $namespaceController = implode("\\",$namespaceControllerExplode);
378
+            $namespaceController = implode("\\", $namespaceControllerExplode);
379 379
         }
380 380
 
381
-        return Utils::getPathFromNamespace($namespaceController,false);
381
+        return Utils::getPathFromNamespace($namespaceController, false);
382 382
     }
383 383
 
384 384
     /**
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
      * @param $arg
403 403
      * @return mixed
404 404
      */
405
-    public function __call($name,$arg)
405
+    public function __call($name, $arg)
406 406
     {
407
-        $appCall='app'.ucfirst($name);
407
+        $appCall = 'app'.ucfirst($name);
408 408
         return $this->{$appCall}();
409 409
     }
410 410
 
Please login to merge, or discard this patch.
src/resta/Foundation/PathManager/StaticPathList.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -7,247 +7,247 @@
 block discarded – undo
7 7
     /**
8 8
      * @var string
9 9
      */
10
-    public static $appDefine='src';
10
+    public static $appDefine = 'src';
11 11
 
12 12
     /**
13 13
      * @var string
14 14
      */
15
-    public static $autoloadNamespace='App';
15
+    public static $autoloadNamespace = 'App';
16 16
 
17 17
     /**
18 18
      * @var string
19 19
      */
20
-    public static $projectPrefixGroup='Api';
20
+    public static $projectPrefixGroup = 'Api';
21 21
 
22 22
     /**
23 23
      * @var string
24 24
      */
25
-    public static $methodPrefix='Action';
25
+    public static $methodPrefix = 'Action';
26 26
 
27 27
     /**
28 28
      * @var string
29 29
      */
30
-    public static $callClassPrefix='Controller';
30
+    public static $callClassPrefix = 'Controller';
31 31
 
32 32
     /**
33 33
      * @var string
34 34
      */
35
-    public static $controllerBundleName='';
35
+    public static $controllerBundleName = '';
36 36
 
37 37
     /**
38 38
      * @var string
39 39
      */
40
-    public static $resourceInController='Resource';
40
+    public static $resourceInController = 'Resource';
41 41
 
42 42
     /**
43 43
      * @var string
44 44
      */
45
-    public static $configurationInController='Config';
45
+    public static $configurationInController = 'Config';
46 46
 
47 47
     /**
48 48
      * @var null
49 49
      */
50
-    public static $appPath=null;
50
+    public static $appPath = null;
51 51
 
52 52
     /**
53 53
      * @var $kernel
54 54
      */
55
-    public static $kernel='Kernel';
55
+    public static $kernel = 'Kernel';
56 56
 
57 57
     /**
58 58
      * @var $repository
59 59
      */
60
-    public static $repository='Repository';
60
+    public static $repository = 'Repository';
61 61
 
62 62
     /**
63 63
      * @var $listener
64 64
      */
65
-    public static $listener='Listener';
65
+    public static $listener = 'Listener';
66 66
 
67 67
     /**
68 68
      * @var $repository
69 69
      */
70
-    public static $serviceAnnotations='ServiceAnnotationsManager';
70
+    public static $serviceAnnotations = 'ServiceAnnotationsManager';
71 71
 
72 72
     /**
73 73
      * @var $repository
74 74
      */
75
-    public static $serviceMiddleware='ServiceMiddlewareManager';
75
+    public static $serviceMiddleware = 'ServiceMiddlewareManager';
76 76
 
77 77
     /**
78 78
      * @var $storage
79 79
      */
80
-    public static $storage='Storage';
80
+    public static $storage = 'Storage';
81 81
 
82 82
     /**
83 83
      * @var $controller
84 84
      */
85
-    public static $controller='Controllers';
85
+    public static $controller = 'Controllers';
86 86
 
87 87
     /**
88 88
      * @var $platform
89 89
      */
90
-    public static $platform='__Platform';
90
+    public static $platform = '__Platform';
91 91
 
92 92
     /**
93 93
      * @var $sourcePath
94 94
      */
95
-    public static $sourcePath='Source';
95
+    public static $sourcePath = 'Source';
96 96
 
97 97
     /**
98 98
      * @var $sourceRequest
99 99
      */
100
-    public static $sourceRequest='Request';
100
+    public static $sourceRequest = 'Request';
101 101
 
102 102
     /**
103 103
      * @var $model
104 104
      */
105
-    public static $model='Model';
105
+    public static $model = 'Model';
106 106
 
107 107
     /**
108 108
      * @var $builder
109 109
      */
110
-    public static $builder='Builder';
110
+    public static $builder = 'Builder';
111 111
 
112 112
     /**
113 113
      * @var $migration
114 114
      */
115
-    public static $migration='Migrations';
115
+    public static $migration = 'Migrations';
116 116
 
117 117
     /**
118 118
      * @var $config
119 119
      */
120
-    public static $config='Config';
120
+    public static $config = 'Config';
121 121
 
122 122
     /**
123 123
      * @var string $helpers
124 124
      */
125
-    public static $helpers='Helpers';
125
+    public static $helpers = 'Helpers';
126 126
 
127 127
     /**
128 128
      * @var $config
129 129
      */
130
-    public static $test='Tests';
130
+    public static $test = 'Tests';
131 131
 
132 132
 
133 133
     /**
134 134
      * @var $optional
135 135
      */
136
-    public static $optional='Optional';
136
+    public static $optional = 'Optional';
137 137
 
138 138
     /**
139 139
      * @var $events
140 140
      */
141
-    public static $events='Events';
141
+    public static $events = 'Events';
142 142
 
143 143
     /**
144 144
      * @var $listeners
145 145
      */
146
-    public static $listeners='Listeners';
146
+    public static $listeners = 'Listeners';
147 147
 
148 148
     /**
149 149
      * @var $subscribers
150 150
      */
151
-    public static $subscribers='Subscribers';
151
+    public static $subscribers = 'Subscribers';
152 152
 
153 153
     /**
154 154
      * @var $exception
155 155
      */
156
-    public static $exception='Exceptions';
156
+    public static $exception = 'Exceptions';
157 157
 
158 158
     /**
159 159
      * @var $job
160 160
      */
161
-    public static $job='Job';
161
+    public static $job = 'Job';
162 162
 
163 163
 
164 164
     /**
165 165
      * @var $webservice
166 166
      */
167
-    public static $webservice='Webservice';
167
+    public static $webservice = 'Webservice';
168 168
 
169 169
     /**
170 170
      * @var $log
171 171
      */
172
-    public static $log='Log';
172
+    public static $log = 'Log';
173 173
 
174 174
 
175 175
     /**
176 176
      * @var $resource
177 177
      */
178
-    public static $resource='Resource';
178
+    public static $resource = 'Resource';
179 179
 
180 180
     /**
181 181
      * @var $cache
182 182
      */
183
-    public static $cache='Cache';
183
+    public static $cache = 'Cache';
184 184
 
185 185
     /**
186 186
      * @var $language
187 187
      */
188
-    public static $language='Language';
188
+    public static $language = 'Language';
189 189
     /**
190 190
      * @var $session
191 191
      */
192
-    public static $session='Session';
192
+    public static $session = 'Session';
193 193
 
194 194
     /**
195 195
      * @var $middleware
196 196
      */
197
-    public static $middleware='Middleware';
197
+    public static $middleware = 'Middleware';
198 198
 
199 199
     /**
200 200
      * @var string $route
201 201
      */
202
-    public static $route='Routes';
202
+    public static $route = 'Routes';
203 203
 
204 204
     /**
205 205
      * @var string
206 206
      */
207
-    public static $request='Request';
207
+    public static $request = 'Request';
208 208
 
209 209
     /**
210 210
      * @var $factory
211 211
      */
212
-    public static $factory='Factory';
212
+    public static $factory = 'Factory';
213 213
 
214 214
     /**
215 215
      * @var $node
216 216
      */
217
-    public static $node='Node';
217
+    public static $node = 'Node';
218 218
 
219 219
     /**
220 220
      * @var $node
221 221
      */
222
-    public static $provider='Providers';
222
+    public static $provider = 'Providers';
223 223
 
224 224
     /**
225 225
      * @var $once
226 226
      */
227
-    public static $once='Once';
227
+    public static $once = 'Once';
228 228
 
229 229
     /**
230 230
      * @var $command
231 231
      */
232
-    public static $command='Command';
232
+    public static $command = 'Command';
233 233
 
234 234
     /**
235 235
      * @var $stub
236 236
      */
237
-    public static $stub='Stub';
237
+    public static $stub = 'Stub';
238 238
 
239 239
     /**
240 240
      * @var $store
241 241
      */
242
-    public static $store='Store';
242
+    public static $store = 'Store';
243 243
 
244 244
     /**
245 245
      * @var $boot
246 246
      */
247
-    public static $boot='Boot';
247
+    public static $boot = 'Boot';
248 248
 
249 249
     /**
250 250
      * @var $store
251 251
      */
252
-    public static $autoService='Autoservice';
252
+    public static $autoService = 'Autoservice';
253 253
 }
254 254
\ No newline at end of file
Please login to merge, or discard this patch.
src/resta/Console/Source/Helper/Helper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * @var array
34 34
      */
35
-    public $commandRule=['helper'];
35
+    public $commandRule = ['helper'];
36 36
 
37 37
     /**
38 38
      * @return mixed
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
     public function create()
41 41
     {
42 42
 
43
-        if(!file_exists(app()->path()->helpers())){
44
-            $this->directory['helper']          = app()->path()->helpers();
43
+        if (!file_exists(app()->path()->helpers())) {
44
+            $this->directory['helper'] = app()->path()->helpers();
45 45
             $this->file->makeDirectory($this);
46 46
         }
47 47
 
48
-        $this->touch['helpers/general']= app()->path()->helpers().'/'.ucfirst($this->argument['helper']).'.php';
48
+        $this->touch['helpers/general'] = app()->path()->helpers().'/'.ucfirst($this->argument['helper']).'.php';
49 49
 
50 50
 
51 51
         $this->file->touch($this);
Please login to merge, or discard this patch.
src/resta/Container/ContainerInstanceResolver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,20 +25,20 @@
 block discarded – undo
25 25
      * @param null|string $name
26 26
      * @return array
27 27
      */
28
-    public function container($name=null)
28
+    public function container($name = null)
29 29
     {
30 30
         //check container value for kernel
31
-        if(isset($this->instances['container'])){
31
+        if (isset($this->instances['container'])) {
32 32
 
33 33
             // if methoda is a null parameter,
34 34
             // then we send direct container values.
35
-            if(is_null($name)){
35
+            if (is_null($name)) {
36 36
                 return (array)$this->instances['container'];
37 37
             }
38 38
 
39 39
             // if there is an existing value in the container as the method parameter,
40 40
             // we send this value directly in the container.
41
-            if(isset($this->container()[$name])){
41
+            if (isset($this->container()[$name])) {
42 42
                 return $this->container()[$name];
43 43
             }
44 44
 
Please login to merge, or discard this patch.