@@ -7,14 +7,14 @@ |
||
7 | 7 | /** |
8 | 8 | * @var array $bootLoaders |
9 | 9 | */ |
10 | - protected static $bootLoaders = ['url','logger']; |
|
10 | + protected static $bootLoaders = ['url', 'logger']; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * load bootstrapper dependencies |
14 | 14 | * |
15 | 15 | * @param array $loaders |
16 | 16 | */ |
17 | - public static function bootLoader($loaders=array()) |
|
17 | + public static function bootLoader($loaders = array()) |
|
18 | 18 | { |
19 | 19 | app()->loadIfNotExistBoot($loaders); |
20 | 20 | } |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | * @param $class |
23 | 23 | * @return mixed |
24 | 24 | */ |
25 | - public function macro($class) |
|
26 | - { |
|
27 | - $this->class = $class; |
|
28 | - $this->macro = $this; |
|
25 | + public function macro($class) |
|
26 | + { |
|
27 | + $this->class = $class; |
|
28 | + $this->macro = $this; |
|
29 | 29 | |
30 | - return $this; |
|
31 | - } |
|
30 | + return $this; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * get macro property |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @param $name |
37 | 37 | * @return mixed |
38 | 38 | */ |
39 | - public function __get($name) |
|
40 | - { |
|
41 | - return ClosureDispatcher::bind($this->class)->call(function() use($name){ |
|
42 | - return $this->{$name}; |
|
43 | - }); |
|
44 | - } |
|
39 | + public function __get($name) |
|
40 | + { |
|
41 | + return ClosureDispatcher::bind($this->class)->call(function() use($name){ |
|
42 | + return $this->{$name}; |
|
43 | + }); |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | \ No newline at end of file |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function macro($class) |
26 | 26 | { |
27 | - $this->class = $class; |
|
27 | + $this->class = $class; |
|
28 | 28 | $this->macro = $this; |
29 | 29 | |
30 | 30 | return $this; |
@@ -36,10 +36,10 @@ |
||
36 | 36 | return $this->yaml; |
37 | 37 | } |
38 | 38 | |
39 | - public function set($data=array()) |
|
39 | + public function set($data = array()) |
|
40 | 40 | { |
41 | 41 | //we merge the data in yaml with new data. |
42 | - $newYamlData = array_merge($this->yaml,$data); |
|
42 | + $newYamlData = array_merge($this->yaml, $data); |
|
43 | 43 | |
44 | 44 | //we dump new data. |
45 | 45 | $yaml = Yaml::dump($newYamlData); |
@@ -33,8 +33,9 @@ |
||
33 | 33 | */ |
34 | 34 | public function call(\Closure $closure) |
35 | 35 | { |
36 | - if(!is_null($this->bind)) |
|
37 | - $closure = \Closure::bind($closure, $this->bind, $this->bind); |
|
36 | + if(!is_null($this->bind)) { |
|
37 | + $closure = \Closure::bind($closure, $this->bind, $this->bind); |
|
38 | + } |
|
38 | 39 | return $closure(); |
39 | 40 | } |
40 | 41 | } |
41 | 42 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function call(\Closure $closure) |
37 | 37 | { |
38 | - if(!is_null($this->bind)) |
|
38 | + if (!is_null($this->bind)) |
|
39 | 39 | $closure = \Closure::bind($closure, $this->bind, $this->bind); |
40 | 40 | return $closure(); |
41 | 41 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | //root definer: application root path |
4 | -define("root",str_replace("\\","/",realpath(__DIR__.'/'))); |
|
4 | +define("root", str_replace("\\", "/", realpath(__DIR__.'/'))); |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * resta system composer vendor autoload. |
@@ -33,9 +33,9 @@ |
||
33 | 33 | { |
34 | 34 | $inputs = $this->app->get($this->method); |
35 | 35 | |
36 | - $content = json_decode($this->app['request']->getContent(),1); |
|
36 | + $content = json_decode($this->app['request']->getContent(), 1); |
|
37 | 37 | |
38 | - if(is_array($inputs) && count($inputs)){ |
|
38 | + if (is_array($inputs) && count($inputs)) { |
|
39 | 39 | return $inputs; |
40 | 40 | } |
41 | 41 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @param $callback null |
11 | 11 | * @return mixed |
12 | 12 | */ |
13 | - public function bind($object=null,$callback=null); |
|
13 | + public function bind($object = null, $callback = null); |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param $abstract |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param $container false |
38 | 38 | * @return mixed |
39 | 39 | */ |
40 | - public function make($object=null,$callback=null,$container=false); |
|
40 | + public function make($object = null, $callback = null, $container = false); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @param $key |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | * @param null $concrete |
46 | 46 | * @return mixed |
47 | 47 | */ |
48 | - public function register($key,$object,$concrete=null); |
|
48 | + public function register($key, $object, $concrete = null); |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * @param null $object |
52 | 52 | * @param null $callback |
53 | 53 | * @return mixed |
54 | 54 | */ |
55 | - public function share($object=null,$callback=null); |
|
55 | + public function share($object = null, $callback = null); |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @method singleton |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param array $bind |
66 | 66 | * @return mixed |
67 | 67 | */ |
68 | - public function resolve($class,$bind=array()); |
|
68 | + public function resolve($class, $bind = array()); |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * @param $class |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | * @param string $provider |
22 | 22 | * @param string $method |
23 | 23 | */ |
24 | - private function applyProvider($key,$provider,$method='register') |
|
24 | + private function applyProvider($key, $provider, $method = 'register') |
|
25 | 25 | { |
26 | 26 | // If the provider classes are a real object |
27 | 27 | // we will run them. |
28 | - if(Utils::isNamespaceExists($provider)){ |
|
28 | + if (Utils::isNamespaceExists($provider)) { |
|
29 | 29 | |
30 | 30 | // after determining whether the register or boot methods |
31 | 31 | // we are running the provider. |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | $providerInstance = $this->app->resolve($provider); |
34 | 34 | |
35 | 35 | //we need to do method check for provider. |
36 | - if(method_exists($providerInstance,$method)){ |
|
36 | + if (method_exists($providerInstance, $method)) { |
|
37 | 37 | $providerInstance->{$method}(); |
38 | 38 | |
39 | - if($method=="register"){ |
|
39 | + if ($method=="register") { |
|
40 | 40 | /** @scrutinizer ignore-call */ |
41 | - $this->app->register('loadedProviders',$key,$provider); |
|
41 | + $this->app->register('loadedProviders', $key, $provider); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | } |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | */ |
52 | 52 | private function assignerLoadedProvidersInitialCoreValue() |
53 | 53 | { |
54 | - if(!isset($this->app['loadedProviders'])){ |
|
54 | + if (!isset($this->app['loadedProviders'])) { |
|
55 | 55 | |
56 | 56 | // for loaded providers, |
57 | 57 | // we register an empty array for the container object. |
58 | 58 | /** @scrutinizer ignore-call */ |
59 | - $this->app->register('loadedProviders',[]); |
|
59 | + $this->app->register('loadedProviders', []); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | /** @scrutinizer ignore-call */ |
72 | 72 | $providers = $this->app->serviceProviders(); |
73 | 73 | |
74 | - if(count($providers)){ |
|
74 | + if (count($providers)) { |
|
75 | 75 | $this->providers = $providers; |
76 | 76 | } |
77 | 77 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function handle() |
87 | 87 | { |
88 | - define ('serviceprovider',true); |
|
88 | + define('serviceprovider', true); |
|
89 | 89 | |
90 | 90 | //check providers and resolve |
91 | 91 | $this->resolveProviders($this->getServiceProviders()); |
@@ -96,28 +96,28 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param array $providers |
98 | 98 | */ |
99 | - public function resolveProviders($providers=array()) |
|
99 | + public function resolveProviders($providers = array()) |
|
100 | 100 | { |
101 | 101 | // for loaded providers, |
102 | 102 | // we register an empty array for the container object. |
103 | 103 | $this->assignerLoadedProvidersInitialCoreValue(); |
104 | 104 | |
105 | 105 | //first we are running register methods of provider classes. |
106 | - foreach($providers as $key=>$provider){ |
|
106 | + foreach ($providers as $key=>$provider) { |
|
107 | 107 | |
108 | 108 | // providers can only be installed once. |
109 | 109 | // apply providers and register for kernel |
110 | - if(!isset($this->app['loadedProviders'][$key])){ |
|
111 | - $this->applyProvider($key,$provider); |
|
110 | + if (!isset($this->app['loadedProviders'][$key])) { |
|
111 | + $this->applyProvider($key, $provider); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | 115 | //then we are running boot methods of provider classes. |
116 | - foreach($providers as $key=>$provider){ |
|
116 | + foreach ($providers as $key=>$provider) { |
|
117 | 117 | |
118 | 118 | //if the providers register is already booted. |
119 | - if(isset($this->app['loadedProviders'][$key])){ |
|
120 | - $this->applyProvider($key,$provider,'boot'); |
|
119 | + if (isset($this->app['loadedProviders'][$key])) { |
|
120 | + $this->applyProvider($key, $provider, 'boot'); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | |
49 | 49 | //Now, let's get our custom boot list. |
50 | 50 | //Let's assign the final state to our booterList list along with our custom boot list. |
51 | - foreach (array_keys($this->getBootDirectory()) as $customBoots){ |
|
51 | + foreach (array_keys($this->getBootDirectory()) as $customBoots) { |
|
52 | 52 | |
53 | 53 | //We assign the namespace data of the bootable class to the bootNamespace property. |
54 | - $this->bootNamespace=''.StaticPathList::$boot.'\\'.$customBoots; |
|
54 | + $this->bootNamespace = ''.StaticPathList::$boot.'\\'.$customBoots; |
|
55 | 55 | |
56 | 56 | //Your custom boot objects in |
57 | 57 | //the boot directory should not be in the middlewaregroups list. |
58 | - if(false===app()->console() && !in_array($this->bootNamespace,$booterList)){ |
|
58 | + if (false===app()->console() && !in_array($this->bootNamespace, $booterList)) { |
|
59 | 59 | $this->booterManifest(); |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | //The booterList property combines booterList variables. |
64 | - return array_merge($booterList,$this->booterList); |
|
64 | + return array_merge($booterList, $this->booterList); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | //if the boot list belongs to the custom booter, |
74 | 74 | //then we can boot our custom boot objects by adding them at the end of this class. |
75 | - if(array_pop($booter)==$this->customBooter){ |
|
75 | + if (array_pop($booter)==$this->customBooter) { |
|
76 | 76 | return $this->addCustomBooter(); |
77 | 77 | } |
78 | 78 |