@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | use Resta\Contracts\ApplicationHelpersContracts; |
| 16 | 16 | use Resta\Foundation\Bootstrapper\Bootstrappers; |
| 17 | 17 | |
| 18 | -class Application extends Kernel implements ApplicationContracts,ApplicationHelpersContracts |
|
| 18 | +class Application extends Kernel implements ApplicationContracts, ApplicationHelpersContracts |
|
| 19 | 19 | {
|
| 20 | 20 | //get app paths |
| 21 | 21 | use ApplicationPath; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param bool $console |
| 39 | 39 | */ |
| 40 | - public function __construct($console=false) |
|
| 40 | + public function __construct($console = false) |
|
| 41 | 41 | {
|
| 42 | 42 | // get console status for cli |
| 43 | 43 | $this->console = $console; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | {
|
| 58 | 58 | // the booted objects are saved to the kernel. |
| 59 | 59 | // this method checks whether these objects are registered. |
| 60 | - return (isset($this['bindings'],$this['bindings'][$object])); |
|
| 60 | + return (isset($this['bindings'], $this['bindings'][$object])); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | // taking care of the differences between operating system |
| 77 | 77 | // and escaping arguments to prevent security issues. |
| 78 | 78 | // It replaces PHP functions like exec, passthru, shell_exec and system |
| 79 | - return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle(); |
|
| 79 | + return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle(); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function config($config) |
| 103 | 103 | {
|
| 104 | - if($this->checkBindings(__FUNCTION__)){
|
|
| 104 | + if ($this->checkBindings(__FUNCTION__)) {
|
|
| 105 | 105 | return Config::make($config)->get(); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | * @param array $environment |
| 143 | 143 | * @return mixed|string |
| 144 | 144 | */ |
| 145 | - public function environment($environment=array()) |
|
| 145 | + public function environment($environment = array()) |
|
| 146 | 146 | {
|
| 147 | - if($this->checkBindings(__FUNCTION__)){
|
|
| 147 | + if ($this->checkBindings(__FUNCTION__)) {
|
|
| 148 | 148 | |
| 149 | 149 | $arguments = (isset(func_get_args()[0])) |
| 150 | 150 | ? func_get_args()[0] : func_get_args(); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $environmentContainer = $this['environment']; |
| 154 | 154 | |
| 155 | 155 | return $environmentContainer->environment( |
| 156 | - $arguments,$this['environmentVariables'] |
|
| 156 | + $arguments, $this['environmentVariables'] |
|
| 157 | 157 | ); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | public function isLocale() : bool |
| 186 | 186 | {
|
| 187 | 187 | //check environment for local |
| 188 | - return $this->environment() === 'local'; |
|
| 188 | + return $this->environment()==='local'; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -199,14 +199,14 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | // with the help of reflection instance, |
| 201 | 201 | // we get the kernel properties extended with the application object. |
| 202 | - foreach ($this['reflection']($this)->getProperties() as $property){
|
|
| 202 | + foreach ($this['reflection']($this)->getProperties() as $property) {
|
|
| 203 | 203 | $properties[] = $property->getName(); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // we get the names of |
| 207 | 207 | // the kernel properties ended with groups through the Collection class. |
| 208 | - [$groups] = Collection::make($properties)->partition(function($properties){
|
|
| 209 | - return Str::endsWith($properties,'Groups'); |
|
| 208 | + [$groups] = Collection::make($properties)->partition(function($properties) {
|
|
| 209 | + return Str::endsWith($properties, 'Groups'); |
|
| 210 | 210 | }); |
| 211 | 211 | |
| 212 | 212 | //as a result, kernel groups are being returned. |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | $list = []; |
| 224 | 224 | |
| 225 | 225 | //get kernel group names with manifest method |
| 226 | - foreach ($this->kernelGroupKeys() as $groupKey){
|
|
| 227 | - $list = array_merge($list,$this->manifest($groupKey)); |
|
| 226 | + foreach ($this->kernelGroupKeys() as $groupKey) {
|
|
| 227 | + $list = array_merge($list, $this->manifest($groupKey)); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | return $list; |
@@ -240,10 +240,10 @@ discard block |
||
| 240 | 240 | {
|
| 241 | 241 | // it adds the values in path data specified |
| 242 | 242 | // by callback to the configuration values. |
| 243 | - if($this['config'] instanceof ConfigProviderContracts){
|
|
| 243 | + if ($this['config'] instanceof ConfigProviderContracts) {
|
|
| 244 | 244 | |
| 245 | 245 | //set your path for config loader |
| 246 | - return tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
|
|
| 246 | + return tap($this['config'], function(ConfigProviderContracts $config) use($callback) {
|
|
| 247 | 247 | return $config->setConfig(call_user_func($callback)); |
| 248 | 248 | }); |
| 249 | 249 | } |
@@ -258,19 +258,19 @@ discard block |
||
| 258 | 258 | * @param array $loaders |
| 259 | 259 | * @return mixed|void |
| 260 | 260 | */ |
| 261 | - public function loadIfNotExistBoot($loaders=array()) |
|
| 261 | + public function loadIfNotExistBoot($loaders = array()) |
|
| 262 | 262 | {
|
| 263 | 263 | //get kernel group list from application |
| 264 | 264 | $kernelGroupList = $this->kernelGroupList(); |
| 265 | 265 | |
| 266 | - foreach ($loaders as $loader){
|
|
| 266 | + foreach ($loaders as $loader) {
|
|
| 267 | 267 | |
| 268 | 268 | // if a service needs another boot service, |
| 269 | 269 | // the service is directly installed here and the service needs are resolved. |
| 270 | - if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){
|
|
| 270 | + if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) {
|
|
| 271 | 271 | |
| 272 | 272 | //with the boot loader kernel,we get the boot loader method. |
| 273 | - $this['closureBootLoader']->call(function() use($loader,$kernelGroupList) {
|
|
| 273 | + $this['closureBootLoader']->call(function() use($loader, $kernelGroupList) {
|
|
| 274 | 274 | $this->bootstrapper = $kernelGroupList[$loader]; |
| 275 | 275 | return $this->boot(); |
| 276 | 276 | }); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $bootstrapper = $this['bootstrapper']; |
| 291 | 291 | |
| 292 | 292 | //kernel manifest bootstrapper |
| 293 | - return $bootstrapper->bootFire(null,$maker); |
|
| 293 | + return $bootstrapper->bootFire(null, $maker); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | public function runningInConsole() : bool |
| 302 | 302 | {
|
| 303 | 303 | //Determine if the application is running in the console. |
| 304 | - return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; |
|
| 304 | + return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg'; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | : []; |
| 318 | 318 | |
| 319 | 319 | //core kernel providers and project providers have been merged |
| 320 | - return array_merge($this->manifest('providers'),$providers);
|
|
| 320 | + return array_merge($this->manifest('providers'), $providers);
|
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -327,12 +327,12 @@ discard block |
||
| 327 | 327 | * @param string $path |
| 328 | 328 | * @return mixed|void |
| 329 | 329 | */ |
| 330 | - public function setPaths($name,$path) |
|
| 330 | + public function setPaths($name, $path) |
|
| 331 | 331 | {
|
| 332 | 332 | // save the globally identified paths to |
| 333 | 333 | // the global container object of the resta. |
| 334 | - if(file_exists($path)){
|
|
| 335 | - $this->register('paths',$name,$path);
|
|
| 334 | + if (file_exists($path)) {
|
|
| 335 | + $this->register('paths', $name, $path);
|
|
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @param array $arguments |
| 16 | 16 | * @return mixed |
| 17 | 17 | */ |
| 18 | - public function command($command,$arguments=array()); |
|
| 18 | + public function command($command, $arguments = array()); |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @return array |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param array $environment |
| 43 | 43 | * @return mixed |
| 44 | 44 | */ |
| 45 | - public function environment($environment=array()); |
|
| 45 | + public function environment($environment = array()); |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * @return mixed |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @param $instance |
| 55 | 55 | * @return mixed |
| 56 | 56 | */ |
| 57 | - public function instance ($abstract,$instance); |
|
| 57 | + public function instance($abstract, $instance); |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * @return mixed |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * @param array $loaders |
| 82 | 82 | * @return mixed |
| 83 | 83 | */ |
| 84 | - public function loadIfNotExistBoot($loaders=array()); |
|
| 84 | + public function loadIfNotExistBoot($loaders = array()); |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * @param $maker |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @param null $concrete |
| 96 | 96 | * @return mixed |
| 97 | 97 | */ |
| 98 | - public function register($key,$object,$concrete=null); |
|
| 98 | + public function register($key, $object, $concrete = null); |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * @return mixed |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @param string $path |
| 113 | 113 | * @return mixed |
| 114 | 114 | */ |
| 115 | - public function setPaths($name,$path); |
|
| 115 | + public function setPaths($name, $path); |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * @return mixed |