@@ -13,5 +13,5 @@ |
||
13 | 13 | * @param array $data |
14 | 14 | * @return mixed |
15 | 15 | */ |
16 | - public function set($data=array()); |
|
16 | + public function set($data = array()); |
|
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param array $bind |
25 | 25 | * @return mixed |
26 | 26 | */ |
27 | - public function controller($endpoint=null,$bind=array()); |
|
27 | + public function controller($endpoint = null, $bind = array()); |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @return mixed |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @param null $app |
9 | 9 | * @return mixed |
10 | 10 | */ |
11 | - public function app($app=null); |
|
11 | + public function app($app = null); |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @return mixed |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param bool $bool |
56 | 56 | * @return mixed |
57 | 57 | */ |
58 | - public function controller($controller=null,$bool=true); |
|
58 | + public function controller($controller = null, $bool = true); |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * @return mixed |
@@ -146,5 +146,5 @@ discard block |
||
146 | 146 | * @param null $app |
147 | 147 | * @return mixed |
148 | 148 | */ |
149 | - public function version($app=null); |
|
149 | + public function version($app = null); |
|
150 | 150 | } |
151 | 151 | \ No newline at end of file |
@@ -10,11 +10,11 @@ |
||
10 | 10 | * @param $concrete |
11 | 11 | * @return mixed |
12 | 12 | */ |
13 | - public function addListener($eventName,$abstract,$concrete); |
|
13 | + public function addListener($eventName, $abstract, $concrete); |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param array $subscriber |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function addSubscriber($subscriber=array()); |
|
19 | + public function addSubscriber($subscriber = array()); |
|
20 | 20 | } |
21 | 21 | \ No newline at end of file |
@@ -10,6 +10,6 @@ |
||
10 | 10 | * @param bool $onion |
11 | 11 | * @return mixed |
12 | 12 | */ |
13 | - public function callBootstrapperProcess($group,$booting,$onion=true); |
|
13 | + public function callBootstrapperProcess($group, $booting, $onion = true); |
|
14 | 14 | |
15 | 15 | } |
16 | 16 | \ No newline at end of file |
@@ -8,6 +8,6 @@ |
||
8 | 8 | * @param null $path |
9 | 9 | * @return mixed |
10 | 10 | */ |
11 | - public function setConfig($path=null); |
|
11 | + public function setConfig($path = null); |
|
12 | 12 | |
13 | 13 | } |
14 | 14 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param callable $callback |
30 | 30 | * @return mixed |
31 | 31 | */ |
32 | - public function exclude($middleware,callable $callback) |
|
32 | + public function exclude($middleware, callable $callback) |
|
33 | 33 | { |
34 | 34 | $this->result = true; |
35 | 35 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | //if there is exclude method |
43 | 43 | //in service middleware class |
44 | - if($this->existMethod()){ |
|
44 | + if ($this->existMethod()) { |
|
45 | 45 | |
46 | 46 | //call exclude method |
47 | 47 | /** |
@@ -50,24 +50,24 @@ discard block |
||
50 | 50 | $serviceMiddleware = $middleware['class']; |
51 | 51 | $excludes = $serviceMiddleware->exclude(); |
52 | 52 | |
53 | - foreach ($excludes as $excludeKey=>$excludeVal){ |
|
54 | - $this->excludeProcess($excludeKey,$excludeVal); |
|
53 | + foreach ($excludes as $excludeKey=>$excludeVal) { |
|
54 | + $this->excludeProcess($excludeKey, $excludeVal); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | //return true |
59 | - return Utils::returnCallback($this->result,$callback); |
|
59 | + return Utils::returnCallback($this->result, $callback); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @param $excludeKey |
64 | 64 | * @param $excludeVal |
65 | 65 | */ |
66 | - private function excludeProcess($excludeKey,$excludeVal) |
|
66 | + private function excludeProcess($excludeKey, $excludeVal) |
|
67 | 67 | { |
68 | - $this->excludeForAll($excludeKey,$excludeVal,function() use ($excludeKey,$excludeVal){ |
|
68 | + $this->excludeForAll($excludeKey, $excludeVal, function() use ($excludeKey, $excludeVal){ |
|
69 | 69 | |
70 | - if($excludeKey == $this->excludeList['middleware']['middlewareName']){ |
|
70 | + if ($excludeKey==$this->excludeList['middleware']['middlewareName']) { |
|
71 | 71 | $this->inArrayExclude($excludeVal); |
72 | 72 | |
73 | 73 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | private function existMethod() |
81 | 81 | { |
82 | - return Utils::existMethod($this->excludeList['middleware']['class'],'exclude'); |
|
82 | + return Utils::existMethod($this->excludeList['middleware']['class'], 'exclude'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | */ |
88 | 88 | private function inArrayExclude($exclude) |
89 | 89 | { |
90 | - foreach($exclude as $item){ |
|
91 | - if(in_array($item,$this->middleware['odds'])){ |
|
90 | + foreach ($exclude as $item) { |
|
91 | + if (in_array($item, $this->middleware['odds'])) { |
|
92 | 92 | $this->result = false; |
93 | 93 | } |
94 | 94 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @param callable $callback |
101 | 101 | * @return mixed |
102 | 102 | */ |
103 | - private function excludeForAll($excludeKey,$excludeVal,callable $callback) |
|
103 | + private function excludeForAll($excludeKey, $excludeVal, callable $callback) |
|
104 | 104 | { |
105 | 105 | return ($excludeKey=="all") ? $this->inArrayExclude($excludeVal) : call_user_func($callback); |
106 | 106 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * @var array $onionTypes |
27 | 27 | */ |
28 | - protected $onionTypes=[ |
|
28 | + protected $onionTypes = [ |
|
29 | 29 | |
30 | 30 | 'middlewareGroups' => 'before', |
31 | 31 | 'reflectionGroups' => 'core' |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | |
43 | 43 | // If the peelings variable does not have a kernel, |
44 | 44 | // we first assign an instance of this class to the initial value of the array. |
45 | - if(!isset($this->app['peelings'])){ |
|
46 | - $this->app->register('peelings','0',$this); |
|
45 | + if (!isset($this->app['peelings'])) { |
|
46 | + $this->app->register('peelings', '0', $this); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // we will then use the keys of |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | |
53 | 53 | // and since we can not peel, |
54 | 54 | // we will include the onion property in the process class respectively and run it as before yada after. |
55 | - $bootstrapperPeelOnionProcess = new MiddlewareKernelProviderProcess($this->onionTypes[$group],$this->onionList); |
|
55 | + $bootstrapperPeelOnionProcess = new MiddlewareKernelProviderProcess($this->onionTypes[$group], $this->onionList); |
|
56 | 56 | |
57 | 57 | // and we assign this running onion process property to the peelings variable on the kernel. |
58 | - $this->app->register('peelings',end($keys)+1,$bootstrapperPeelOnionProcess); |
|
58 | + $this->app->register('peelings', end($keys)+1, $bootstrapperPeelOnionProcess); |
|
59 | 59 | |
60 | 60 | //If the peelingsAfter object is not in the kernel. |
61 | - if(!isset($this->app['peelingsAfter'])){ |
|
61 | + if (!isset($this->app['peelingsAfter'])) { |
|
62 | 62 | |
63 | 63 | //we assign the last saved after object to the peelingsAfter variable independently in the kernel. |
64 | - $bootstrapperPeelAfterOnionProcess = new MiddlewareKernelProviderProcess('after',$this->onionList); |
|
65 | - $this->app->register('peelingsAfter',$bootstrapperPeelAfterOnionProcess); |
|
64 | + $bootstrapperPeelAfterOnionProcess = new MiddlewareKernelProviderProcess('after', $this->onionList); |
|
65 | + $this->app->register('peelingsAfter', $bootstrapperPeelAfterOnionProcess); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | return true; |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | |
83 | 83 | // After we check the peel objects in the list for core, |
84 | 84 | // we hold the core objects in a row. |
85 | - foreach ($peelings as $peelKey=>$peelObje){ |
|
85 | + foreach ($peelings as $peelKey=>$peelObje) { |
|
86 | 86 | |
87 | - if($peelObje->onionType=='core'){ |
|
87 | + if ($peelObje->onionType=='core') { |
|
88 | 88 | $peelList['core'][] = $peelObje; |
89 | 89 | } |
90 | - else{ |
|
90 | + else { |
|
91 | 91 | $peelList['peel'][] = $peelObje; |
92 | 92 | } |
93 | 93 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @param callable $callback |
121 | 121 | * @return mixed|null |
122 | 122 | */ |
123 | - public function onionBoot($onion,callable $callback) |
|
123 | + public function onionBoot($onion, callable $callback) |
|
124 | 124 | { |
125 | 125 | // we are globalizing the onion variable. |
126 | 126 | $this->onionList = $onion; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | // if the current onionlist is present in the specified onions list we will peel. |
142 | 142 | // otherwise we will have to make a normal bootstrapper. |
143 | - if(isset($this->onionTypes[current($this->onionList)])){ |
|
143 | + if (isset($this->onionTypes[current($this->onionList)])) { |
|
144 | 144 | |
145 | 145 | // If our register property succeeds, |
146 | 146 | // we return this condition. |
@@ -86,8 +86,7 @@ |
||
86 | 86 | |
87 | 87 | if($peelObje->onionType=='core'){ |
88 | 88 | $peelList['core'][] = $peelObje; |
89 | - } |
|
90 | - else{ |
|
89 | + } else{ |
|
91 | 90 | $peelList['peel'][] = $peelObje; |
92 | 91 | } |
93 | 92 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @param null $onionType |
22 | 22 | * @param null $onions |
23 | 23 | */ |
24 | - public function __construct($onionType=null,$onions=null) |
|
24 | + public function __construct($onionType = null, $onions = null) |
|
25 | 25 | { |
26 | 26 | $this->onionType = $onionType; |
27 | 27 | $this->onions = $onions; |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function peel($object, \Closure $next) |
38 | 38 | { |
39 | - if($this->onionType=="before"){ |
|
39 | + if ($this->onionType=="before") { |
|
40 | 40 | |
41 | 41 | $object->runs[] = $this->onionsProcess(); |
42 | 42 | |
43 | 43 | return $next($object); |
44 | 44 | } |
45 | 45 | |
46 | - if($this->onionType=="after"){ |
|
46 | + if ($this->onionType=="after") { |
|
47 | 47 | |
48 | 48 | $response = $next($object); |
49 | 49 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | private function afterPeel() |
72 | 72 | { |
73 | - if(isset(core()->bindings['middleware']) && core()->bindings['middleware']!==null){ |
|
73 | + if (isset(core()->bindings['middleware']) && core()->bindings['middleware']!==null) { |
|
74 | 74 | return core()->bindings['middleware']->after(); |
75 | 75 | } |
76 | 76 | } |