Passed
Push — master ( 6255ce...a1a81a )
by Php Easy Api
02:56
created
src/resta/Url/UrlParseException.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
     /**
11 11
      * @param array $data
12 12
      */
13
-    public function exception($data=array())
13
+    public function exception($data = array())
14 14
     {
15
-        if(!isset($data['project']) and !isset($data['version'])){
15
+        if (!isset($data['project']) and !isset($data['version'])) {
16 16
             throw new DomainException('No Project or Version');
17 17
         }
18 18
 
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
 
22 22
         //If there is no project on the url
23 23
         //we throw an exception
24
-        if($data['project']===null OR !file_exists($appPath)){
24
+        if ($data['project']===null OR !file_exists($appPath)) {
25 25
             throw new DomainException('No Project');
26 26
         }
27 27
 
28
-        if(!in_array($data['version'],UrlVersionIdentifier::supportedVersions())){
28
+        if (!in_array($data['version'], UrlVersionIdentifier::supportedVersions())) {
29 29
             throw new DomainException('Version Number is not supported');
30 30
         }
31 31
 
32 32
         //If there is no endpoint on the url
33 33
         //we throw an exception
34
-        if($data['endpoint']===null){
34
+        if ($data['endpoint']===null) {
35 35
             throw new DomainException('No Endpoint');
36 36
         }
37 37
     }
Please login to merge, or discard this patch.
src/resta/Logger/LoggerHandler.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * LoggerHandler constructor.
27 27
      * @param null $file
28 28
      */
29
-    public function __construct($file=null)
29
+    public function __construct($file = null)
30 30
     {
31 31
         $this->file = $file;
32 32
         $this->logger = core()->loggerService;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function alert($message, array $context = [])
53 53
     {
54
-        $this->writeLog(__FUNCTION__,$message,$context);
54
+        $this->writeLog(__FUNCTION__, $message, $context);
55 55
     }
56 56
 
57 57
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function critical($message, array $context = [])
65 65
     {
66
-        $this->writeLog(__FUNCTION__,$message,$context);
66
+        $this->writeLog(__FUNCTION__, $message, $context);
67 67
     }
68 68
 
69 69
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function debug($message, array $context = [])
77 77
     {
78
-        $this->writeLog(__FUNCTION__,$message,$context);
78
+        $this->writeLog(__FUNCTION__, $message, $context);
79 79
     }
80 80
 
81 81
     /**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function emergency($message, array $context = [])
89 89
     {
90
-        $this->writeLog(__FUNCTION__,$message,$context);
90
+        $this->writeLog(__FUNCTION__, $message, $context);
91 91
     }
92 92
 
93 93
     /**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function error($message, array $context = [])
101 101
     {
102
-        $this->writeLog(__FUNCTION__,$message,$context);
102
+        $this->writeLog(__FUNCTION__, $message, $context);
103 103
     }
104 104
 
105 105
     /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function info($message, array $context = [])
113 113
     {
114
-        $this->writeLog(__FUNCTION__,$message,$context);
114
+        $this->writeLog(__FUNCTION__, $message, $context);
115 115
     }
116 116
 
117 117
     /**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function notice($message, array $context = [])
137 137
     {
138
-        $this->writeLog(__FUNCTION__,$message,$context);
138
+        $this->writeLog(__FUNCTION__, $message, $context);
139 139
     }
140 140
 
141 141
     /**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      */
148 148
     public function warning($message, array $context = [])
149 149
     {
150
-        $this->writeLog(__FUNCTION__,$message,$context);
150
+        $this->writeLog(__FUNCTION__, $message, $context);
151 151
     }
152 152
 
153 153
     /**
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
      * @param $context
159 159
      * @return void
160 160
      */
161
-    protected function writeLog($level, $message,$context)
161
+    protected function writeLog($level, $message, $context)
162 162
     {
163 163
         $file = ($this->file===null) ? $level : $this->file;
164 164
 
165
-        if($this->adapter!==null){
165
+        if ($this->adapter!==null) {
166 166
 
167 167
             $adapter = $this->adapter;
168 168
 
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
             });
172 172
         }
173 173
 
174
-        if($this->logger!==null){
175
-            $this->logger->logHandler($message,$file,$level);
174
+        if ($this->logger!==null) {
175
+            $this->logger->logHandler($message, $file, $level);
176 176
         }
177 177
 
178 178
         return $context;
Please login to merge, or discard this patch.
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
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @param bool $console
40 40
      */
41
-    public function __construct($console=false)
41
+    public function __construct($console = false)
42 42
     {
43 43
         // get console status for cli
44 44
         $this->console = $console;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         // the booted objects are saved to the kernel.
60 60
         // this method checks whether these objects are registered.
61
-        return (isset($this['bindings'],$this['bindings'][$object]));
61
+        return (isset($this['bindings'], $this['bindings'][$object]));
62 62
     }
63 63
 
64 64
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         // taking care of the differences between operating system
78 78
         // and escaping arguments to prevent security issues.
79 79
         // It replaces PHP functions like exec, passthru, shell_exec and system
80
-        return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle();
80
+        return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle();
81 81
     }
82 82
 
83 83
     /**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function config($config)
104 104
     {
105
-        if($this->checkBindings(__FUNCTION__)){
105
+        if ($this->checkBindings(__FUNCTION__)) {
106 106
             return Config::make($config)->get();
107 107
         }
108 108
 
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
      * @param array $environment
144 144
      * @return mixed|string
145 145
      */
146
-    public function environment($environment=array())
146
+    public function environment($environment = array())
147 147
     {
148
-        if($this->checkBindings(__FUNCTION__)){
148
+        if ($this->checkBindings(__FUNCTION__)) {
149 149
 
150 150
             $arguments = (isset(func_get_args()[0]))
151 151
                 ? func_get_args()[0] : func_get_args();
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $environmentContainer = $this['environment'];
155 155
 
156 156
             return $environmentContainer->environment(
157
-                $arguments,$this['environmentVariables']
157
+                $arguments, $this['environmentVariables']
158 158
             );
159 159
         }
160 160
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     public function isLocale() : bool
187 187
     {
188 188
         //check environment for local
189
-        return $this->environment() === 'local';
189
+        return $this->environment()==='local';
190 190
     }
191 191
 
192 192
     /**
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
 
201 201
         // with the help of reflection instance,
202 202
         // we get the kernel properties extended with the application object.
203
-        foreach ($this['reflection']($this)->getProperties() as $property){
203
+        foreach ($this['reflection']($this)->getProperties() as $property) {
204 204
             $properties[] = $property->getName();
205 205
         }
206 206
 
207 207
         // we get the names of
208 208
         // the kernel properties ended with groups through the Collection class.
209
-        [$groups] = Collection::make($properties)->partition(function($properties){
210
-            return Str::endsWith($properties,'Groups');
209
+        [$groups] = Collection::make($properties)->partition(function($properties) {
210
+            return Str::endsWith($properties, 'Groups');
211 211
         });
212 212
 
213 213
         //as a result, kernel groups are being returned.
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
         $list = [];
225 225
 
226 226
         //get kernel group names with manifest method
227
-        foreach ($this->kernelGroupKeys() as $groupKey){
228
-            $list = array_merge($list,$this->manifest($groupKey));
227
+        foreach ($this->kernelGroupKeys() as $groupKey) {
228
+            $list = array_merge($list, $this->manifest($groupKey));
229 229
         }
230 230
 
231 231
         return $list;
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
     {
242 242
         // it adds the values in path data specified
243 243
         // by callback to the configuration values.
244
-        if($this['config'] instanceof ConfigProviderContracts){
244
+        if ($this['config'] instanceof ConfigProviderContracts) {
245 245
 
246 246
             //set your path for config loader
247
-            tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
247
+            tap($this['config'], function(ConfigProviderContracts $config) use($callback) {
248 248
                 $config->setConfig(call_user_func($callback));
249 249
             });
250 250
         }
251
-        else{
251
+        else {
252 252
             //set config instance exception for application
253 253
             exception()->unexpectedValue('config instance is not loaded for application container');
254 254
         }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      * @param array $loaders
261 261
      * @return mixed|void
262 262
      */
263
-    public function loadIfNotExistBoot($loaders=array())
263
+    public function loadIfNotExistBoot($loaders = array())
264 264
     {
265 265
         //get kernel group list from application
266 266
         $kernelGroupList = $this->kernelGroupList();
@@ -268,14 +268,14 @@  discard block
 block discarded – undo
268 268
         /** @var ClosureDispatcherContracts $closureBootLoader */
269 269
         $closureBootLoader = $this['closureBootLoader'];
270 270
 
271
-        foreach ($loaders as $loader){
271
+        foreach ($loaders as $loader) {
272 272
 
273 273
             // if a service needs another boot service,
274 274
             // the service is directly installed here and the service needs are resolved.
275
-            if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){
275
+            if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) {
276 276
 
277 277
                 //with the boot loader kernel,we get the boot loader method.
278
-                $closureBootLoader->call(function() use($loader,$kernelGroupList) {
278
+                $closureBootLoader->call(function() use($loader, $kernelGroupList) {
279 279
 
280 280
                     /** @var BootLoader $bootLoader */
281 281
                     $bootLoader = $this;
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         $bootstrapper = $this['bootstrapper'];
299 299
 
300 300
         //kernel manifest bootstrapper
301
-        return $bootstrapper->bootFire(null,$maker);
301
+        return $bootstrapper->bootFire(null, $maker);
302 302
     }
303 303
 
304 304
     /**
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     public function runningInConsole() : bool
310 310
     {
311 311
         //Determine if the application is running in the console.
312
-        return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
312
+        return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg';
313 313
     }
314 314
 
315 315
     /**
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
             : [];
326 326
 
327 327
         //core kernel providers and project providers have been merged
328
-        return array_merge($this->manifest('providers'),$providers);
328
+        return array_merge($this->manifest('providers'), $providers);
329 329
     }
330 330
 
331 331
     /**
@@ -335,12 +335,12 @@  discard block
 block discarded – undo
335 335
      * @param string $path
336 336
      * @return mixed|void
337 337
      */
338
-    public function setPaths($name,$path)
338
+    public function setPaths($name, $path)
339 339
     {
340 340
         // save the globally identified paths to
341 341
         // the global container object of the resta.
342
-        if(file_exists($path)){
343
-            $this->register('paths',$name,$path);
342
+        if (file_exists($path)) {
343
+            $this->register('paths', $name, $path);
344 344
         }
345 345
     }
346 346
 
Please login to merge, or discard this patch.
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.
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/Request.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -226,8 +226,7 @@  discard block
 block discarded – undo
226 226
                 if(!isset($this->inputs[$generator])){
227 227
                     $this->{$generator} = $this->{$generatorMethodName}();
228 228
                     $this->inputs[$generator] = $this->{$generatorMethodName}();
229
-                }
230
-                else {
229
+                } else {
231 230
 
232 231
                     if($this->checkProperties('auto_generators_dont_overwrite')
233 232
                         && in_array($generator,$this->auto_generators_dont_overwrite)){
@@ -414,8 +413,7 @@  discard block
 block discarded – undo
414 413
                     $keyMethod              = $this->{$method}();
415 414
                     $this->inputs[$key][]   = $keyMethod;
416 415
                 }
417
-            }
418
-            else{
416
+            } else{
419 417
                 if(isset($this->inputs[$key])){
420 418
                     $keyMethod = $this->{$method}();
421 419
                     $this->inputs[$key] = $keyMethod;
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         // if we leave the request process to the application side,
59 59
         // then in this case we refer to the requestClient object in
60 60
         // the services section of the store directory.
61
-        (property_exists($this,'app') && $this->app) ? parent::handle() : $this->handle();
61
+        (property_exists($this, 'app') && $this->app) ? parent::handle() : $this->handle();
62 62
     }
63 63
 
64 64
     /**
@@ -68,16 +68,16 @@  discard block
 block discarded – undo
68 68
      */
69 69
     private function autoValidate($validate)
70 70
     {
71
-        foreach ($this->{$validate} as $object=>$datas){
72
-            if(Utils::isNamespaceExists($object)){
71
+        foreach ($this->{$validate} as $object=>$datas) {
72
+            if (Utils::isNamespaceExists($object)) {
73 73
                 $getObjectInstance = app()->resolve($object);
74
-                foreach ($datas as $dataKey=>$data){
75
-                    if(is_numeric($dataKey) && method_exists($getObjectInstance,$data)){
76
-                        if(isset($this->origin[$data])){
77
-                            if(!is_array($this->origin[$data])){
74
+                foreach ($datas as $dataKey=>$data) {
75
+                    if (is_numeric($dataKey) && method_exists($getObjectInstance, $data)) {
76
+                        if (isset($this->origin[$data])) {
77
+                            if (!is_array($this->origin[$data])) {
78 78
                                 $this->origin[$data] = array($this->origin[$data]);
79 79
                             }
80
-                            foreach ($this->origin[$data] as $originData){
80
+                            foreach ($this->origin[$data] as $originData) {
81 81
                                 $getObjectInstance->{$data}($originData);
82 82
                             }
83 83
                         }
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
 
100 100
         // Determines which HTTP method
101 101
         // the request object will be exposed to.
102
-        if($this->checkProperties('http')){
102
+        if ($this->checkProperties('http')) {
103 103
 
104 104
             // if the current http method does not exist
105 105
             // in the http object, the exception will be thrown.
106
-            if(!in_array($method,$this->http)){
106
+            if (!in_array($method, $this->http)) {
107 107
 
108 108
                 //exception batMethodCall
109 109
                 exception()->badMethodCall(
110
-                    'Invalid http method process for '.class_basename($this).'.That is accepted http methods ['.implode(",",$this->http).'] ');
110
+                    'Invalid http method process for '.class_basename($this).'.That is accepted http methods ['.implode(",", $this->http).'] ');
111 111
             }
112 112
         }
113 113
     }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     {
123 123
         // from the properties of the object properties to
124 124
         // the existing variables, control the array and at least one element.
125
-        return (property_exists($this,$properties)
125
+        return (property_exists($this, $properties)
126 126
             && is_array($this->{$properties}) && count($this->{$properties})) ? true : false;
127 127
     }
128 128
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         // we are saving the expected values ​​for the request in container.
137 137
         // this record can be returned in exception information.
138
-        app()->register('requestExpected',$this->expected);
138
+        app()->register('requestExpected', $this->expected);
139 139
     }
140 140
 
141 141
     /**
@@ -147,15 +147,15 @@  discard block
 block discarded – undo
147 147
     public function except($except)
148 148
     {
149 149
         // the except parameter is a callable value.
150
-        if(is_callable($except)){
151
-            $call = call_user_func_array($except,[$this]);
150
+        if (is_callable($except)) {
151
+            $call = call_user_func_array($except, [$this]);
152 152
             $except = $call;
153 153
         }
154 154
 
155 155
         // except with the except exceptions property
156 156
         // and then assigning them to the inputs property.
157
-        $this->except = array_merge($this->except,$except);
158
-        $this->inputs = array_diff_key($this->inputs,array_flip($this->except));
157
+        $this->except = array_merge($this->except, $except);
158
+        $this->inputs = array_diff_key($this->inputs, array_flip($this->except));
159 159
 
160 160
         return $this;
161 161
     }
@@ -169,26 +169,26 @@  discard block
 block discarded – undo
169 169
     {
170 170
         // expected method is executed.
171 171
         // this method is a must for http method values to be found in this property.
172
-        if($this->checkProperties('expected')){
172
+        if ($this->checkProperties('expected')) {
173 173
 
174 174
             // if the expected values are not found in the inputs array,
175 175
             // the exception will be thrown.
176
-            foreach ($this->expected as $expected){
176
+            foreach ($this->expected as $expected) {
177 177
 
178 178
                 $expectedValues = [];
179 179
 
180 180
                 // mandatory expected data for each key | can be separated by.
181 181
                 // this is evaluated as "or".
182
-                foreach($expectedData = explode("|",$expected) as $inputs){
183
-                    if(!isset($this->inputs[$inputs])){
182
+                foreach ($expectedData = explode("|", $expected) as $inputs) {
183
+                    if (!isset($this->inputs[$inputs])) {
184 184
                         $expectedValues[] = $inputs;
185 185
                     }
186 186
                 }
187 187
 
188 188
                 // if the expectedData and expectedValues ​​
189 189
                 // array are numerically equal to the expected key, the exception is thrown.
190
-                if(count($expectedData)===count($expectedValues)){
191
-                    exception()->unexpectedValue('You absolutely have to send the value '.implode(" or ",$expectedValues).' for request object');
190
+                if (count($expectedData)===count($expectedValues)) {
191
+                    exception()->unexpectedValue('You absolutely have to send the value '.implode(" or ", $expectedValues).' for request object');
192 192
                 }
193 193
             }
194 194
         }
@@ -203,17 +203,17 @@  discard block
 block discarded – undo
203 203
     {
204 204
         // check the presence of the generator object
205 205
         // and operate the generator over this object.
206
-        if($this->checkProperties('auto_generators')){
206
+        if ($this->checkProperties('auto_generators')) {
207 207
             $generators = $this->auto_generators;
208 208
         }
209 209
 
210 210
         // check the presence of the generator object
211 211
         // and operate the generator over this object.
212
-        if($this->checkProperties('generators')){
213
-            $generators = array_merge(isset($generators) ? $generators: [],$this->generators);
212
+        if ($this->checkProperties('generators')) {
213
+            $generators = array_merge(isset($generators) ? $generators : [], $this->generators);
214 214
         }
215 215
 
216
-        if(isset($generators)){
216
+        if (isset($generators)) {
217 217
             $this->generatorMethod($generators);
218 218
         }
219 219
     }
@@ -226,30 +226,30 @@  discard block
 block discarded – undo
226 226
     private function generatorMethod($generators)
227 227
     {
228 228
         //generator array object
229
-        foreach ($generators as $generator){
229
+        foreach ($generators as $generator) {
230 230
 
231 231
             //generator method name
232 232
             $generatorMethodName = $generator.'Generator';
233 233
 
234 234
             // if the generator method is present,
235 235
             // the fake value is assigned.
236
-            if(method_exists($this,$generatorMethodName)){
236
+            if (method_exists($this, $generatorMethodName)) {
237 237
 
238 238
                 //fake registration
239
-                if(!isset($this->inputs[$generator])){
239
+                if (!isset($this->inputs[$generator])) {
240 240
                     $this->{$generator} = $this->{$generatorMethodName}();
241 241
                     $this->inputs[$generator] = $this->{$generatorMethodName}();
242 242
                 }
243 243
                 else {
244 244
 
245
-                    if($this->checkProperties('auto_generators_dont_overwrite')
246
-                        && in_array($generator,$this->auto_generators_dont_overwrite)){
245
+                    if ($this->checkProperties('auto_generators_dont_overwrite')
246
+                        && in_array($generator, $this->auto_generators_dont_overwrite)) {
247 247
                         $this->{$generator} = $this->{$generatorMethodName}();
248 248
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
249 249
                     }
250 250
 
251
-                    if($this->checkProperties('generators_dont_overwrite')
252
-                        && in_array($generator,$this->generators_dont_overwrite)){
251
+                    if ($this->checkProperties('generators_dont_overwrite')
252
+                        && in_array($generator, $this->generators_dont_overwrite)) {
253 253
                         $this->{$generator} = $this->{$generatorMethodName}();
254 254
                         $this->inputs[$generator] = $this->{$generatorMethodName}();
255 255
                     }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     private function getClientObjects()
280 280
     {
281
-        return array_diff_key($this->getObjects(),['inputs'=>[]]);
281
+        return array_diff_key($this->getObjects(), ['inputs'=>[]]);
282 282
     }
283 283
 
284 284
     /**
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     {
325 325
         // we use the http method to write
326 326
         // the values to the inputs and origin properties.
327
-        foreach($this->requestHttp->resolve() as $key=>$value){
327
+        foreach ($this->requestHttp->resolve() as $key=>$value) {
328 328
 
329 329
             //inputs and origin properties
330 330
             $this->inputs[$key] = $value;
@@ -368,9 +368,9 @@  discard block
 block discarded – undo
368 368
 
369 369
         // we update the input values ​​after
370 370
         // we receive and check the saved objects.
371
-        foreach ($clientObjects as $key=>$value){
371
+        foreach ($clientObjects as $key=>$value) {
372 372
 
373
-            if(isset($clientObjects['origin'][$key])){
373
+            if (isset($clientObjects['origin'][$key])) {
374 374
 
375 375
                 $this->{$key} = $clientObjects['origin'][$key];
376 376
                 $this->inputs[$key] = $this->{$key};
@@ -395,11 +395,11 @@  discard block
 block discarded – undo
395 395
 
396 396
         // the request update to be performed using
397 397
         // the method name to be used with the http method.
398
-        $this->setRequestInputs($requestMethod,$key);
398
+        $this->setRequestInputs($requestMethod, $key);
399 399
 
400 400
         // the request update to be performed using
401 401
         // the method name to be used without the http method.
402
-        $this->setRequestInputs($key,$key);
402
+        $this->setRequestInputs($key, $key);
403 403
     }
404 404
 
405 405
     /**
@@ -408,28 +408,28 @@  discard block
 block discarded – undo
408 408
      * @param $method
409 409
      * @param $key
410 410
      */
411
-    private function setRequestInputs($method,$key)
411
+    private function setRequestInputs($method, $key)
412 412
     {
413
-        if(method_exists($this,$method) && $this->reflection->reflectionMethodParams($method)->isProtected){
413
+        if (method_exists($this, $method) && $this->reflection->reflectionMethodParams($method)->isProtected) {
414 414
 
415 415
             //check annotations for method
416
-            $annotation = app()->resolve(RequestAnnotationManager::class,['request'=>$this]);
417
-            $annotation->annotation($method,$key);
416
+            $annotation = app()->resolve(RequestAnnotationManager::class, ['request'=>$this]);
417
+            $annotation->annotation($method, $key);
418 418
 
419
-            if(isset($this->inputs[$key]) && is_array($this->inputs[$key])){
419
+            if (isset($this->inputs[$key]) && is_array($this->inputs[$key])) {
420 420
 
421 421
                 $inputKeys = $this->inputs[$key];
422 422
 
423 423
                 $this->inputs[$key] = [];
424
-                foreach ($inputKeys as $input){
424
+                foreach ($inputKeys as $input) {
425 425
 
426 426
                     $this->{$key}           = $input;
427 427
                     $keyMethod              = $this->{$method}();
428 428
                     $this->inputs[$key][]   = $keyMethod;
429 429
                 }
430 430
             }
431
-            else{
432
-                if(isset($this->inputs[$key])){
431
+            else {
432
+                if (isset($this->inputs[$key])) {
433 433
                     $keyMethod = $this->{$method}();
434 434
                     $this->inputs[$key] = $keyMethod;
435 435
                 }
@@ -445,22 +445,22 @@  discard block
 block discarded – undo
445 445
      */
446 446
     private function validation()
447 447
     {
448
-        if(property_exists($this,'autoObjectValidate') && is_array($this->autoObjectValidate) && count($this->autoObjectValidate)){
448
+        if (property_exists($this, 'autoObjectValidate') && is_array($this->autoObjectValidate) && count($this->autoObjectValidate)) {
449 449
             $this->autoValidate('autoObjectValidate');
450 450
         }
451 451
         // we need to find the rule method
452 452
         // because we can not validate it.
453
-        if(method_exists($this,'rule')){
453
+        if (method_exists($this, 'rule')) {
454 454
             $this->rule();
455 455
         }
456 456
 
457 457
         // if we only want to make a rule of
458 458
         // the specified request object, we will use
459 459
         // the rule method with the prefix of the request object.
460
-        $validName=strtolower(str_replace('Request','',class_basename($this))).'Rule';
460
+        $validName = strtolower(str_replace('Request', '', class_basename($this))).'Rule';
461 461
 
462 462
         //if the specified method exists;
463
-        if(method_exists($this,$validName)){
463
+        if (method_exists($this, $validName)) {
464 464
             $this->{$validName}();
465 465
         }
466 466
     }
Please login to merge, or discard this patch.