Passed
Push — master ( a6c6d7...adfcc4 )
by Php Easy Api
04:31
created
src/resta/Foundation/Application.php 1 patch
Spacing   +28 added lines, -28 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 = (is_bool($console)) ? $console : true;
@@ -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
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         // taking care of the differences between operating system
76 76
         // and escaping arguments to prevent security issues.
77 77
         // It replaces PHP functions like exec, passthru, shell_exec and system
78
-        return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle();
78
+        return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle();
79 79
     }
80 80
 
81 81
     /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function config($config)
102 102
     {
103
-        if($this->checkBindings(__FUNCTION__)){
103
+        if ($this->checkBindings(__FUNCTION__)) {
104 104
 
105 105
             /** @var Macro $macro */
106 106
             $macro = $this['macro'];
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             // this includes the configuration macro class.
109 109
             // therefore, you can expand your configuration settings from
110 110
             // the application kernel identifier to the desired class.
111
-            return $macro->withStatic(Config::macro(),function() use($config){
111
+            return $macro->withStatic(Config::macro(), function() use($config){
112 112
                 return Config::make($config);
113 113
             })->get();
114 114
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     {
143 143
         // this is the method that allows container records
144 144
         // to be written to a json file.
145
-        if(!is_null($containerCacheFile = containerCacheFile())){
145
+        if (!is_null($containerCacheFile = containerCacheFile())) {
146 146
             return $containerCacheFile;
147 147
         }
148 148
 
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
      * @param array $environment
170 170
      * @return mixed|string
171 171
      */
172
-    public function environment($environment=array())
172
+    public function environment($environment = array())
173 173
     {
174
-        if($this->checkBindings(__FUNCTION__)){
174
+        if ($this->checkBindings(__FUNCTION__)) {
175 175
 
176 176
             $arguments = (isset(func_get_args()[0]))
177 177
                 ? func_get_args()[0] : func_get_args();
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             $environmentContainer = $this['environment'];
181 181
 
182 182
             return $environmentContainer->environment(
183
-                $arguments,$this['environmentVariables']
183
+                $arguments, $this['environmentVariables']
184 184
             );
185 185
         }
186 186
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     public function isLocale() : bool
213 213
     {
214 214
         //check environment for local
215
-        return $this->environment() === 'local';
215
+        return $this->environment()==='local';
216 216
     }
217 217
 
218 218
     /**
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
 
227 227
         // with the help of reflection instance,
228 228
         // we get the kernel properties extended with the application object.
229
-        foreach ($this['reflection']($this)->getProperties() as $property){
229
+        foreach ($this['reflection']($this)->getProperties() as $property) {
230 230
             $properties[] = $property->getName();
231 231
         }
232 232
 
233 233
         // we get the names of
234 234
         // the kernel properties ended with groups through the Collection class.
235
-        [$groups] = Collection::make($properties)->partition(function($properties){
236
-            return Str::endsWith($properties,'Groups');
235
+        [$groups] = Collection::make($properties)->partition(function($properties) {
236
+            return Str::endsWith($properties, 'Groups');
237 237
         });
238 238
 
239 239
         //as a result, kernel groups are being returned.
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
         $list = [];
251 251
 
252 252
         //get kernel group names with manifest method
253
-        foreach ($this->kernelGroupKeys() as $groupKey){
254
-            $list = array_merge($list,$this->manifest($groupKey));
253
+        foreach ($this->kernelGroupKeys() as $groupKey) {
254
+            $list = array_merge($list, $this->manifest($groupKey));
255 255
         }
256 256
 
257 257
         return $list;
@@ -267,14 +267,14 @@  discard block
 block discarded – undo
267 267
     {
268 268
         // it adds the values in path data specified
269 269
         // by callback to the configuration values.
270
-        if($this['config'] instanceof ConfigProviderContracts){
270
+        if ($this['config'] instanceof ConfigProviderContracts) {
271 271
 
272 272
             //set your path for config loader
273
-            tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
273
+            tap($this['config'], function(ConfigProviderContracts $config) use($callback) {
274 274
                 $config->setConfig(call_user_func($callback));
275 275
             });
276 276
         }
277
-        else{
277
+        else {
278 278
             //set config instance exception for application
279 279
             exception()->unexpectedValue('config instance is not loaded for application container');
280 280
         }
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      * @param array $loaders
287 287
      * @return mixed|void
288 288
      */
289
-    public function loadIfNotExistBoot($loaders=array())
289
+    public function loadIfNotExistBoot($loaders = array())
290 290
     {
291 291
         //get kernel group list from application
292 292
         $kernelGroupList = $this->kernelGroupList();
@@ -294,14 +294,14 @@  discard block
 block discarded – undo
294 294
         /** @var ClosureDispatcherContracts $closureBootLoader */
295 295
         $closureBootLoader = $this['closureBootLoader'];
296 296
 
297
-        foreach ($loaders as $loader){
297
+        foreach ($loaders as $loader) {
298 298
 
299 299
             // if a service needs another boot service,
300 300
             // the service is directly installed here and the service needs are resolved.
301
-            if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){
301
+            if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) {
302 302
 
303 303
                 //with the boot loader kernel,we get the boot loader method.
304
-                $closureBootLoader->call(function() use($loader,$kernelGroupList) {
304
+                $closureBootLoader->call(function() use($loader, $kernelGroupList) {
305 305
 
306 306
                     /** @var BootLoader $bootLoader */
307 307
                     $bootLoader = $this;
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         $bootstrapper = $this['bootstrapper'];
325 325
 
326 326
         //kernel manifest bootstrapper
327
-        return $bootstrapper->bootFire(null,$maker);
327
+        return $bootstrapper->bootFire(null, $maker);
328 328
     }
329 329
 
330 330
     /**
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
     public function runningInConsole() : bool
336 336
     {
337 337
         //Determine if the application is running in the console.
338
-        return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
338
+        return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg';
339 339
     }
340 340
 
341 341
     /**
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
             : [];
352 352
 
353 353
         //core kernel providers and project providers have been merged
354
-        return array_merge($this->manifest('providers'),$providers);
354
+        return array_merge($this->manifest('providers'), $providers);
355 355
     }
356 356
 
357 357
     /**
@@ -361,12 +361,12 @@  discard block
 block discarded – undo
361 361
      * @param string $path
362 362
      * @return mixed|void
363 363
      */
364
-    public function setPaths($name,$path)
364
+    public function setPaths($name, $path)
365 365
     {
366 366
         // save the globally identified paths to
367 367
         // the global container object of the resta.
368
-        if(file_exists($path)){
369
-            $this->register('paths',$name,$path);
368
+        if (file_exists($path)) {
369
+            $this->register('paths', $name, $path);
370 370
         }
371 371
     }
372 372
 
Please login to merge, or discard this patch.