@@ -11,15 +11,15 @@ |
||
11 | 11 | |
12 | 12 | public function methodAllows($callback, array $parameters = []) |
13 | 13 | { |
14 | - return function (...$payload) use ($callback, $parameters) { |
|
15 | - return (bool) app()->call($callback, array_merge($parameters, ...$payload)); |
|
14 | + return function(...$payload) use ($callback, $parameters) { |
|
15 | + return (bool)app()->call($callback, array_merge($parameters, ...$payload)); |
|
16 | 16 | }; |
17 | 17 | } |
18 | 18 | |
19 | 19 | public function valueAllows($value) |
20 | 20 | { |
21 | - return function () use ($value) { |
|
22 | - return (bool) $value; |
|
21 | + return function() use ($value) { |
|
22 | + return (bool)$value; |
|
23 | 23 | }; |
24 | 24 | } |
25 | 25 | } |
@@ -11,9 +11,9 @@ |
||
11 | 11 | if (! isset($this->methods[$method])) { |
12 | 12 | throw new \BadMethodCallException($method.' does not exists as a Heyman condition'); |
13 | 13 | } |
14 | - $condition = $this->methods[$method]; |
|
14 | + $condition = $this->methods[$method]; |
|
15 | 15 | |
16 | - if (is_callable($condition)) { |
|
16 | + if (is_callable($condition)) { |
|
17 | 17 | return $condition(...$param); |
18 | 18 | } |
19 | 19 |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | public function _call($method, $param) |
10 | 10 | { |
11 | - if (! isset($this->methods[$method])) { |
|
12 | - throw new \BadMethodCallException($method.' does not exists as a Heyman condition'); |
|
11 | + if (!isset($this->methods[$method])) { |
|
12 | + throw new \BadMethodCallException($method . ' does not exists as a Heyman condition'); |
|
13 | 13 | } |
14 | 14 | $condition = $this->methods[$method]; |
15 | 15 |
@@ -23,9 +23,10 @@ |
||
23 | 23 | |
24 | 24 | public function define($methodName, $callable) |
25 | 25 | { |
26 | - if (is_callable($callable) || (is_string($callable) and mb_strpos($callable, '@'))) |
|
27 | - $this->methods[$methodName] = $callable; |
|
28 | - else |
|
29 | - throw new \InvalidArgumentException("$callable should be string Class@method or a php callable"); |
|
26 | + if (is_callable($callable) || (is_string($callable) and mb_strpos($callable, '@'))) { |
|
27 | + $this->methods[$methodName] = $callable; |
|
28 | + } else { |
|
29 | + throw new \InvalidArgumentException("$callable should be string Class@method or a php callable"); |
|
30 | + } |
|
30 | 31 | } |
31 | 32 | } |