@@ -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->result = true; |
72 | 72 | $this->inArrayExclude($excludeVal); |
73 | 73 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | private function existMethod() |
82 | 82 | { |
83 | - return Utils::existMethod($this->excludeList['middleware']['class'],'exclude'); |
|
83 | + return Utils::existMethod($this->excludeList['middleware']['class'], 'exclude'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function inArrayExclude($exclude) |
90 | 90 | { |
91 | - foreach($exclude as $item){ |
|
92 | - if(in_array($item,$this->middleware['odds'])){ |
|
91 | + foreach ($exclude as $item) { |
|
92 | + if (in_array($item, $this->middleware['odds'])) { |
|
93 | 93 | $this->result = false; |
94 | 94 | } |
95 | 95 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @param callable $callback |
102 | 102 | * @return mixed |
103 | 103 | */ |
104 | - private function excludeForAll($excludeKey,$excludeVal,callable $callback) |
|
104 | + private function excludeForAll($excludeKey, $excludeVal, callable $callback) |
|
105 | 105 | { |
106 | 106 | return ($excludeKey=="all") ? $this->inArrayExclude($excludeVal) : call_user_func($callback); |
107 | 107 | } |