Passed
Branch master (752bd4)
by Php Easy Api
02:40
created
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.