Test Setup Failed
Push — master ( 82e658...b20784 )
by Php Easy Api
03:44
created
src/resta/Foundation/ApplicationAutoLoadRegister.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     {
31 31
         // Use default autoload implementation
32 32
         // Register given function as __autoload() implementation
33
-        spl_autoload_register(function($class){
33
+        spl_autoload_register(function($class) {
34 34
             $this->getRegisterCallBackVar($class);
35 35
             $this->registerCallBackFormatter();
36 36
         });
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
      */
45 45
     private function getRegisterCallBackVar($class) :void
46 46
     {
47
-        if(defined('root')){
47
+        if (defined('root')) {
48 48
 
49 49
             $this->class = $class;
50 50
             $this->classPath = root.''.DIRECTORY_SEPARATOR.''.$this->class.''.self::FileExtension;
51
-            $this->classPath = str_replace("\\","/",$this->classPath);
51
+            $this->classPath = str_replace("\\", "/", $this->classPath);
52 52
         }
53 53
     }
54 54
 
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * return mixed
59 59
      */
60
-    private function registerCallBackFormatter ()
60
+    private function registerCallBackFormatter()
61 61
     {
62
-        $this->checkAliasClassFormatter($this->classPath,function() {
62
+        $this->checkAliasClassFormatter($this->classPath, function() {
63 63
             require($this->classPath);
64 64
         });
65 65
     }
@@ -71,16 +71,16 @@  discard block
 block discarded – undo
71 71
      * @param $callback
72 72
      * @return mixed
73 73
      */
74
-    private function checkAliasClassFormatter($class,$callback)
74
+    private function checkAliasClassFormatter($class, $callback)
75 75
     {
76 76
         $systemApp = [];
77 77
 
78
-        if(defined('app')){
78
+        if (defined('app')) {
79 79
             $systemApp = (new ClassAliasGroup())->handle();
80 80
         }
81 81
 
82
-        if(!file_exists($class)){
83
-            $this->getAliasClassFormatter($class,$systemApp);
82
+        if (!file_exists($class)) {
83
+            $this->getAliasClassFormatter($class, $systemApp);
84 84
             return false;
85 85
         }
86 86
 
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
      * @param $class
94 94
      * @param $systemApp
95 95
      */
96
-    private function getAliasClassFormatter($class,$systemApp)
96
+    private function getAliasClassFormatter($class, $systemApp)
97 97
     {
98
-        $this->setAliasClassGroup($class,$systemApp);
98
+        $this->setAliasClassGroup($class, $systemApp);
99 99
     }
100 100
 
101 101
     /**
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
      * @param $class
105 105
      * @param $systemApp
106 106
      */
107
-    private function setAliasClassGroup($class,$systemApp)
107
+    private function setAliasClassGroup($class, $systemApp)
108 108
     {
109
-        $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'','',$class);
110
-        $alias = str_replace(self::FileExtension,'',$alias);
109
+        $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'', '', $class);
110
+        $alias = str_replace(self::FileExtension, '', $alias);
111 111
 
112 112
         //set class_alias groups
113
-        if(array_key_exists($alias,$systemApp)){
114
-            class_alias($systemApp[$alias],$alias);
113
+        if (array_key_exists($alias, $systemApp)) {
114
+            class_alias($systemApp[$alias], $alias);
115 115
         }
116 116
     }
117 117
 }
Please login to merge, or discard this patch.
src/resta/Foundation/Application.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -247,8 +247,7 @@
 block discarded – undo
247 247
             tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
248 248
                 $config->setConfig(call_user_func($callback));
249 249
             });
250
-        }
251
-        else{
250
+        } else{
252 251
             //set config instance exception for application
253 252
             exception()->unexpectedValue('config instance is not loaded for application container');
254 253
         }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      *
40 40
      * @param bool $console
41 41
      */
42
-    public function __construct($console=false)
42
+    public function __construct($console = false)
43 43
     {
44 44
         // get console status for cli
45 45
         $this->console = $console;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         // the booted objects are saved to the kernel.
61 61
         // this method checks whether these objects are registered.
62
-        return (isset($this['bindings'],$this['bindings'][$object]));
62
+        return (isset($this['bindings'], $this['bindings'][$object]));
63 63
     }
64 64
 
65 65
     /**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         // taking care of the differences between operating system
79 79
         // and escaping arguments to prevent security issues.
80 80
         // It replaces PHP functions like exec, passthru, shell_exec and system
81
-        return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle();
81
+        return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle();
82 82
     }
83 83
 
84 84
     /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function config($config)
105 105
     {
106
-        if($this->checkBindings(__FUNCTION__)){
106
+        if ($this->checkBindings(__FUNCTION__)) {
107 107
 
108 108
             /** @var Macro $macro */
109 109
             $macro = $this['macro'];
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             // this includes the configuration macro class.
112 112
             // therefore, you can expand your configuration settings from
113 113
             // the application kernel identifier to the desired class.
114
-            return $macro->withStatic(Config::macro(),function() use($config){
114
+            return $macro->withStatic(Config::macro(), function() use($config){
115 115
                 return Config::make($config);
116 116
             })->get();
117 117
 
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
      * @param array $environment
155 155
      * @return mixed|string
156 156
      */
157
-    public function environment($environment=array())
157
+    public function environment($environment = array())
158 158
     {
159
-        if($this->checkBindings(__FUNCTION__)){
159
+        if ($this->checkBindings(__FUNCTION__)) {
160 160
 
161 161
             $arguments = (isset(func_get_args()[0]))
162 162
                 ? func_get_args()[0] : func_get_args();
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             $environmentContainer = $this['environment'];
166 166
 
167 167
             return $environmentContainer->environment(
168
-                $arguments,$this['environmentVariables']
168
+                $arguments, $this['environmentVariables']
169 169
             );
170 170
         }
171 171
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     public function isLocale() : bool
198 198
     {
199 199
         //check environment for local
200
-        return $this->environment() === 'local';
200
+        return $this->environment()==='local';
201 201
     }
202 202
 
203 203
     /**
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
 
212 212
         // with the help of reflection instance,
213 213
         // we get the kernel properties extended with the application object.
214
-        foreach ($this['reflection']($this)->getProperties() as $property){
214
+        foreach ($this['reflection']($this)->getProperties() as $property) {
215 215
             $properties[] = $property->getName();
216 216
         }
217 217
 
218 218
         // we get the names of
219 219
         // the kernel properties ended with groups through the Collection class.
220
-        [$groups] = Collection::make($properties)->partition(function($properties){
221
-            return Str::endsWith($properties,'Groups');
220
+        [$groups] = Collection::make($properties)->partition(function($properties) {
221
+            return Str::endsWith($properties, 'Groups');
222 222
         });
223 223
 
224 224
         //as a result, kernel groups are being returned.
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
         $list = [];
236 236
 
237 237
         //get kernel group names with manifest method
238
-        foreach ($this->kernelGroupKeys() as $groupKey){
239
-            $list = array_merge($list,$this->manifest($groupKey));
238
+        foreach ($this->kernelGroupKeys() as $groupKey) {
239
+            $list = array_merge($list, $this->manifest($groupKey));
240 240
         }
241 241
 
242 242
         return $list;
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
     {
253 253
         // it adds the values in path data specified
254 254
         // by callback to the configuration values.
255
-        if($this['config'] instanceof ConfigProviderContracts){
255
+        if ($this['config'] instanceof ConfigProviderContracts) {
256 256
 
257 257
             //set your path for config loader
258
-            tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
258
+            tap($this['config'], function(ConfigProviderContracts $config) use($callback) {
259 259
                 $config->setConfig(call_user_func($callback));
260 260
             });
261 261
         }
262
-        else{
262
+        else {
263 263
             //set config instance exception for application
264 264
             exception()->unexpectedValue('config instance is not loaded for application container');
265 265
         }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      * @param array $loaders
272 272
      * @return mixed|void
273 273
      */
274
-    public function loadIfNotExistBoot($loaders=array())
274
+    public function loadIfNotExistBoot($loaders = array())
275 275
     {
276 276
         //get kernel group list from application
277 277
         $kernelGroupList = $this->kernelGroupList();
@@ -279,14 +279,14 @@  discard block
 block discarded – undo
279 279
         /** @var ClosureDispatcherContracts $closureBootLoader */
280 280
         $closureBootLoader = $this['closureBootLoader'];
281 281
 
282
-        foreach ($loaders as $loader){
282
+        foreach ($loaders as $loader) {
283 283
 
284 284
             // if a service needs another boot service,
285 285
             // the service is directly installed here and the service needs are resolved.
286
-            if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){
286
+            if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) {
287 287
 
288 288
                 //with the boot loader kernel,we get the boot loader method.
289
-                $closureBootLoader->call(function() use($loader,$kernelGroupList) {
289
+                $closureBootLoader->call(function() use($loader, $kernelGroupList) {
290 290
 
291 291
                     /** @var BootLoader $bootLoader */
292 292
                     $bootLoader = $this;
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         $bootstrapper = $this['bootstrapper'];
310 310
 
311 311
         //kernel manifest bootstrapper
312
-        return $bootstrapper->bootFire(null,$maker);
312
+        return $bootstrapper->bootFire(null, $maker);
313 313
     }
314 314
 
315 315
     /**
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     public function runningInConsole() : bool
321 321
     {
322 322
         //Determine if the application is running in the console.
323
-        return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
323
+        return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg';
324 324
     }
325 325
 
326 326
     /**
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             : [];
337 337
 
338 338
         //core kernel providers and project providers have been merged
339
-        return array_merge($this->manifest('providers'),$providers);
339
+        return array_merge($this->manifest('providers'), $providers);
340 340
     }
341 341
 
342 342
     /**
@@ -346,12 +346,12 @@  discard block
 block discarded – undo
346 346
      * @param string $path
347 347
      * @return mixed|void
348 348
      */
349
-    public function setPaths($name,$path)
349
+    public function setPaths($name, $path)
350 350
     {
351 351
         // save the globally identified paths to
352 352
         // the global container object of the resta.
353
-        if(file_exists($path)){
354
-            $this->register('paths',$name,$path);
353
+        if (file_exists($path)) {
354
+            $this->register('paths', $name, $path);
355 355
         }
356 356
     }
357 357
 
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/BootLoader.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -240,11 +240,11 @@
 block discarded – undo
240 240
     {
241 241
         // we use the methodological context
242 242
         // for kernel group values that are replaced with revision.
243
-       $revisionBoot = array_search($name,app()->get('revision'));
244
-       if(is_string($revisionBoot) && method_exists($this,$revisionBoot)){
245
-           return $this->{$revisionBoot}();
246
-       }
243
+        $revisionBoot = array_search($name,app()->get('revision'));
244
+        if(is_string($revisionBoot) && method_exists($this,$revisionBoot)){
245
+            return $this->{$revisionBoot}();
246
+        }
247 247
 
248
-       exception()->badFunctionCall('There is no boot method named '.$name);
248
+        exception()->badFunctionCall('There is no boot method named '.$name);
249 249
     }
250 250
 }
251 251
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
     {
33 33
         //if the console is true
34 34
         //console app runner
35
-        if($this->app->runningInConsole()
36
-            && $this->app['isAvailableStore'] && $this->app->checkBindings('appConsole')===false){
35
+        if ($this->app->runningInConsole()
36
+            && $this->app['isAvailableStore'] && $this->app->checkBindings('appConsole')===false) {
37 37
 
38 38
             //If the second parameter is sent true to the application builder,
39 39
             //all operations are performed by the console and the custom booting are executed
40
-            $this->app->share('appConsole',ConsoleProvider::class);
40
+            $this->app->share('appConsole', ConsoleProvider::class);
41 41
         }
42 42
     }
43 43
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
     {
61 61
         // this is your application's config installer.
62 62
         // you can easily access the config variables with the config installer.
63
-        if($this->app->checkBindings('config')===false){
64
-            $this->app->share('config',function($app){
63
+        if ($this->app->checkBindings('config')===false) {
64
+            $this->app->share('config', function($app) {
65 65
                 return $app['revision']['config'] ?? ConfigProvider::class;
66 66
             });
67 67
         }
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
     {
77 77
         // the rest system will assign a random key to your application for you.
78 78
         // this application will single the advantages of using the rest system for your application in particular.
79
-        if(core()->isAvailableStore && $this->app->checkBindings('encrypter')===false){
80
-            $this->app->make('encrypter',function($app){
79
+        if (core()->isAvailableStore && $this->app->checkBindings('encrypter')===false) {
80
+            $this->app->make('encrypter', function($app) {
81 81
                 return $app['revision']['encrypter'] ?? EncrypterProvider::class;
82 82
             });
83 83
         }
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
         // it is often helpful to have different configuration values based onUrlParseApplication
94 94
         // the environment where the application is running.for example,
95 95
         // you may wish to use a different cache driver locally than you do on your production server.
96
-        if($this->app->checkBindings('environment')===false){
97
-            $this->app->share('environment',function($app){
96
+        if ($this->app->checkBindings('environment')===false) {
97
+            $this->app->share('environment', function($app) {
98 98
                 return $app['revision']['environment'] ?? EnvironmentProvider::class;
99 99
             });
100 100
         }
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
         // the eventDispatcher component provides tools
111 111
         // that allow your application components to communicate
112 112
         // with each other by dispatching events and listening to them.
113
-        if($this->app->checkBindings('eventDispatcher')===false){
114
-            $this->app->share('eventDispatcher',function($app){
115
-                if(Utils::isNamespaceExists(app()->namespace()->serviceEventDispatcher())){
113
+        if ($this->app->checkBindings('eventDispatcher')===false) {
114
+            $this->app->share('eventDispatcher', function($app) {
115
+                if (Utils::isNamespaceExists(app()->namespace()->serviceEventDispatcher())) {
116 116
                     return $app['revision']['eventDispatcher'] ?? app()->namespace()->serviceEventDispatcher();
117 117
                 }
118 118
             });
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
         // to help you learn more about what's happening within your application,
131 131
         // rest system provides robust logging services that allow you to log messages to files,
132 132
         // the system error log, and even to Slack to notify your entire team.
133
-        if($this->app->checkBindings('logger')===false){
134
-            $this->app->share('logger',function($app){
133
+        if ($this->app->checkBindings('logger')===false) {
134
+            $this->app->share('logger', function($app) {
135 135
                 return $app['revision']['logger'] ?? LoggerProvider::class;
136 136
             });
137 137
         }
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
         // when your application is requested, the middleware classes are running before all bootstrapper executables.
149 149
         // thus, if you make http request your application, you can verify with an intermediate middleware layer
150 150
         // and throw an exception.
151
-        if($this->app->checkBindings('middleware')===false){
152
-            $this->app->make('middleware',function($app){
151
+        if ($this->app->checkBindings('middleware')===false) {
152
+            $this->app->make('middleware', function($app) {
153 153
                 return $app['revision']['middleware'] ?? MiddlewareProvider::class;
154 154
             });
155 155
         }
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
     {
165 165
         // we determine kind of output with the response manager
166 166
         // json as default or [xml,wsdl]
167
-        if($this->app->checkBindings('response')===false){
168
-            $this->app->make('response',function($app){
167
+        if ($this->app->checkBindings('response')===false) {
168
+            $this->app->make('response', function($app) {
169 169
                 return $app['revision']['response'] ?? ResponseProvider::class;
170 170
             });
171 171
         }
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
         // route operations are the last part of the system run. In this section,
182 182
         // a route operation is passed through the url process and output is sent to the screen according to
183 183
         // the method file to be called by the application
184
-        if(core()->isAvailableStore && $this->app->checkBindings('router')===false){
185
-            $this->app->make('router',function($app){
184
+        if (core()->isAvailableStore && $this->app->checkBindings('router')===false) {
185
+            $this->app->make('router', function($app) {
186 186
                 return $app['revision']['router'] ?? RouteProvider::class;
187 187
             });
188 188
         }
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
      */
196 196
     private function serviceProvider()
197 197
     {
198
-        if($this->app->checkBindings('serviceProvider')===false){
199
-            $this->app->share('serviceProvider',function($app){
198
+        if ($this->app->checkBindings('serviceProvider')===false) {
199
+            $this->app->share('serviceProvider', function($app) {
200 200
                 return $app['revision']['serviceProvider'] ?? ServiceProvider::class;
201 201
             });
202 202
         }
@@ -221,9 +221,9 @@  discard block
 block discarded – undo
221 221
     {
222 222
         // with url parsing,the application route for
223 223
         // the rest project is determined after the route variables from the URL are assigned to the kernel url object.
224
-        if(count(array_filter(Utils::getRequestPathInfo(),'strlen'))
225
-            && $this->app->checkBindings('url')===false){
226
-            $this->app->make('url',function($app){
224
+        if (count(array_filter(Utils::getRequestPathInfo(), 'strlen'))
225
+            && $this->app->checkBindings('url')===false) {
226
+            $this->app->make('url', function($app) {
227 227
                 return $app['revision']['url'] ?? UrlProvider::class;
228 228
             });
229 229
         }
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
      * @param $arguments
237 237
      * @return mixed
238 238
      */
239
-    public function __call($name,$arguments)
239
+    public function __call($name, $arguments)
240 240
     {
241 241
         // we use the methodological context
242 242
         // for kernel group values that are replaced with revision.
243
-       $revisionBoot = array_search($name,app()->get('revision'));
244
-       if(is_string($revisionBoot) && method_exists($this,$revisionBoot)){
243
+       $revisionBoot = array_search($name, app()->get('revision'));
244
+       if (is_string($revisionBoot) && method_exists($this, $revisionBoot)) {
245 245
            return $this->{$revisionBoot}();
246 246
        }
247 247
 
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/Bootstrappers.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         (new BaseRegister($this->app))->handle();
42 42
 
43 43
         //we save the bootstrapper class in container.
44
-        $this->app->register('bootstrapper',$this);
44
+        $this->app->register('bootstrapper', $this);
45 45
 
46 46
         //call bootstrapper process
47 47
         $this->callBootstrapperProcess();
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
     {
60 60
         //The boot method to be executed can be specified by the user.
61 61
         //We use this method to know how to customize it.
62
-        BootFireCallback::setBootFire([$this->app,$bootstrapper],function($boot){
62
+        BootFireCallback::setBootFire([$this->app, $bootstrapper], function($boot) {
63 63
 
64 64
             //kernel boots run and service container
65 65
             //makeBuild for service Container
66
-            $this->bootFire($boot,null);
66
+            $this->bootFire($boot, null);
67 67
         });
68 68
     }
69 69
 
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
      * @param string $maker
75 75
      * @return mixed
76 76
      */
77
-    public function bootFire($boot,$maker)
77
+    public function bootFire($boot, $maker)
78 78
     {
79 79
         // we can refer to this method
80 80
         // because we can boot classes in the middleware or bootstrapper array.
81
-        if(is_null($boot) && !is_null($maker)){
81
+        if (is_null($boot) && !is_null($maker)) {
82 82
 
83 83
             /** @var KernelManifestManager $kernelManifestBind */
84 84
             $kernelManifestBind = $this->app->resolve(KernelManifestManager::class);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
         // the boot method to be executed can be specified by the user.
92 92
         // we use this method to know how to customize it.
93
-        return forward_static_call_array([array_pop($boot),self::LOADBOOTSTRAPPERS],[$boot]);
93
+        return forward_static_call_array([array_pop($boot), self::LOADBOOTSTRAPPERS], [$boot]);
94 94
     }
95 95
 
96 96
     /**
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
      */
102 102
     private function bootstrapper(...$params)
103 103
     {
104
-        [$group,$booting,$onion] = $params;
104
+        [$group, $booting, $onion] = $params;
105 105
 
106
-        if($onion){
106
+        if ($onion) {
107 107
 
108 108
             // we will implement a special onion method here and
109 109
             // pass our bootstraper classes through this method.
110 110
             // Our goal here is to implement the middleware layer correctly.
111
-            $this->app->resolve(MiddlewareKernelProvider::class)->onionBoot([$group,$booting],function() use($group){
111
+            $this->app->resolve(MiddlewareKernelProvider::class)->onionBoot([$group, $booting], function() use($group){
112 112
                 $this->boot($group);
113 113
             });
114 114
 
@@ -125,18 +125,18 @@  discard block
 block discarded – undo
125 125
      *
126 126
      * @param array $customBootstrapers
127 127
      */
128
-    public function callBootstrapperProcess($customBootstrapers=[])
128
+    public function callBootstrapperProcess($customBootstrapers = [])
129 129
     {
130 130
         // here we check that a special bootstrappers list will work and we identify the onion identifier.
131 131
         // we are peeling onion class by classifying onion class.
132 132
         $this->getBootstrappersStack($customBootstrapers);
133 133
 
134 134
         //We run the bootstrap list by callback with the object specified for the content respectively.
135
-        foreach($this->stack['getBootstrappers'] as $bootstrapper){
135
+        foreach ($this->stack['getBootstrappers'] as $bootstrapper) {
136 136
 
137 137
             // if the callback data is different from the application kernel,
138 138
             // we will pass it to the pusher control for a special use.
139
-            call_user_func_array([$this,'bootstrapper'],[$bootstrapper,$this,$this->stack['onionIdentifier']]);
139
+            call_user_func_array([$this, 'bootstrapper'], [$bootstrapper, $this, $this->stack['onionIdentifier']]);
140 140
         }
141 141
     }
142 142
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     private function peelings()
163 163
     {
164 164
         //if there are peelings
165
-        if(isset($this->app['peelings'])){
165
+        if (isset($this->app['peelings'])) {
166 166
 
167 167
             // We send the peelings property to
168 168
             // the bootstrapperPeelOnion class.
Please login to merge, or discard this patch.
src/resta/Foundation/Bootstrapper/FinalBooting.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      * @param ApplicationContracts $app
21 21
      * @param array $boot
22 22
      */
23
-    public function __construct($app,$boot=array())
23
+    public function __construct($app, $boot = array())
24 24
     {
25 25
         parent::__construct($app);
26 26
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
      * @param array $boots
36 36
      * @param bool $defaultBoot
37 37
      */
38
-    private function bootstrapper($boots=array(),$defaultBoot=true)
38
+    private function bootstrapper($boots = array(), $defaultBoot = true)
39 39
     {
40 40
         //boot loop make bind calling
41
-        foreach ($boots as $bootstrapper){
41
+        foreach ($boots as $bootstrapper) {
42 42
 
43 43
             // for the default boot, we overwrite the bootstrapper class's bootstrapper property
44 44
             // and load it with the boot method.
45
-            if($defaultBoot){
45
+            if ($defaultBoot) {
46 46
                 $this->app->loadIfNotExistBoot([$bootstrapper]);
47 47
             }
48 48
             // we will use the classical method for classes
49 49
             // that will not boot from the kernel.
50
-            else{
51
-                if(Utils::isNamespaceExists($bootstrapper)
52
-                    && false===isset($this->app['resolve'][$bootstrapper])){
50
+            else {
51
+                if (Utils::isNamespaceExists($bootstrapper)
52
+                    && false===isset($this->app['resolve'][$bootstrapper])) {
53 53
                     $this->app->resolve($bootstrapper)->boot();
54 54
                 }
55 55
             }
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
     private function customBootManifest(callable $callback)
66 66
     {
67 67
         //we make custom boot
68
-        if(isset($this->boot['custom'])){
69
-            return call_user_func_array($callback,[$this->boot['custom']]);
68
+        if (isset($this->boot['custom'])) {
69
+            return call_user_func_array($callback, [$this->boot['custom']]);
70 70
         }
71 71
     }
72 72
 
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
         $defaultBoot = Collection::make($this->boot)->except('custom')->all();
82 82
 
83 83
         //custom boot according to manifest bootManager
84
-        $this->customBootManifest(function($boot){
85
-            $this->bootstrapper((array)$boot,false);
84
+        $this->customBootManifest(function($boot) {
85
+            $this->bootstrapper((array)$boot, false);
86 86
         });
87 87
 
88 88
         // and as a result we now use
Please login to merge, or discard this patch.
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.