@@ -16,8 +16,8 @@ |
||
16 | 16 | * @return $this |
17 | 17 | */ |
18 | 18 | public function where($expression) { |
19 | - if($expression instanceof OptionalExpression) { |
|
20 | - if($expression->isValid()) { |
|
19 | + if ($expression instanceof OptionalExpression) { |
|
20 | + if ($expression->isValid()) { |
|
21 | 21 | $this->where[] = [$expression->getExpression(), $expression->getData()]; |
22 | 22 | } |
23 | 23 | } else { |
@@ -16,8 +16,8 @@ |
||
16 | 16 | * @return $this |
17 | 17 | */ |
18 | 18 | public function having($expression) { |
19 | - if($expression instanceof OptionalExpression) { |
|
20 | - if($expression->isValid()) { |
|
19 | + if ($expression instanceof OptionalExpression) { |
|
20 | + if ($expression->isValid()) { |
|
21 | 21 | $this->having[] = [$expression->getExpression(), $expression->getData()]; |
22 | 22 | } |
23 | 23 | } else { |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $this->data = $data; |
23 | 23 | $keyPath = $this->buildKey($keyPath); |
24 | 24 | $this->data = $this->recursiveGet($data, $keyPath, null); |
25 | - if($validator === null) { |
|
26 | - $validator = function ($data) { |
|
25 | + if ($validator === null) { |
|
26 | + $validator = function($data) { |
|
27 | 27 | return (string) $data !== ''; |
28 | 28 | }; |
29 | 29 | } |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | * @throws Exception |
58 | 58 | */ |
59 | 59 | private function buildKey($keyPath) { |
60 | - if(is_string($keyPath)) { |
|
60 | + if (is_string($keyPath)) { |
|
61 | 61 | $keyPath = explode('.', $keyPath); |
62 | 62 | } |
63 | - if(!is_array($keyPath)) { |
|
63 | + if (!is_array($keyPath)) { |
|
64 | 64 | throw new Exception('Invalid key'); |
65 | 65 | } |
66 | 66 | return $keyPath; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | if (!$count) { |
78 | 78 | return $default; |
79 | 79 | } |
80 | - for($idx = 0; $idx < $count; $idx++) { |
|
80 | + for ($idx = 0; $idx < $count; $idx++) { |
|
81 | 81 | $part = $path[$idx]; |
82 | - if(!array_key_exists($part, $array)) { |
|
82 | + if (!array_key_exists($part, $array)) { |
|
83 | 83 | return $default; |
84 | 84 | } |
85 | 85 | $array = $array[$part]; |