@@ -77,17 +77,17 @@ discard block |
||
| 77 | 77 | foreach($criteria as $arguments){ |
| 78 | 78 | if(count($arguments) == 1){ |
| 79 | 79 | $this->where($arguments[0]); |
| 80 | - }elseif(count($arguments) == 2){ |
|
| 80 | + } elseif(count($arguments) == 2){ |
|
| 81 | 81 | $this->where($arguments[0], $arguments[1]); |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - }else{ |
|
| 84 | + } else{ |
|
| 85 | 85 | $criteria = $this->validate_criteria($criteria); |
| 86 | 86 | $value = $this->parse_value($value); |
| 87 | 87 | |
| 88 | 88 | if($value === null || $value === ''){ |
| 89 | 89 | $this->query->push([$criteria]); |
| 90 | - }else{ |
|
| 90 | + } else{ |
|
| 91 | 91 | $this->query->push([$criteria, $value]); |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -102,7 +102,9 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function orWhere(\Closure $closure = null) { |
| 104 | 104 | $this->query->push(['OR']); |
| 105 | - if($closure !== null) $closure($this); |
|
| 105 | + if($closure !== null) { |
|
| 106 | + $closure($this); |
|
| 107 | + } |
|
| 106 | 108 | |
| 107 | 109 | return $this; |
| 108 | 110 | } |
@@ -114,7 +116,9 @@ discard block |
||
| 114 | 116 | */ |
| 115 | 117 | public function andWhere(\Closure $closure = null) { |
| 116 | 118 | $this->query->push(['AND']); |
| 117 | - if($closure !== null) $closure($this); |
|
| 119 | + if($closure !== null) { |
|
| 120 | + $closure($this); |
|
| 121 | + } |
|
| 118 | 122 | |
| 119 | 123 | return $this; |
| 120 | 124 | } |
@@ -97,7 +97,9 @@ discard block |
||
| 97 | 97 | * @throws MessageSearchValidationException |
| 98 | 98 | */ |
| 99 | 99 | protected function parse_date($date) { |
| 100 | - if($date instanceof \Carbon\Carbon) return $date; |
|
| 100 | + if($date instanceof \Carbon\Carbon) { |
|
| 101 | + return $date; |
|
| 102 | + } |
|
| 101 | 103 | |
| 102 | 104 | try { |
| 103 | 105 | $date = Carbon::parse($date); |
@@ -169,7 +171,7 @@ discard block |
||
| 169 | 171 | } else { |
| 170 | 172 | if($statement[1] === null){ |
| 171 | 173 | $query .= $statement[0]; |
| 172 | - }else{ |
|
| 174 | + } else{ |
|
| 173 | 175 | $query .= $statement[0].' "'.$statement[1].'"'; |
| 174 | 176 | } |
| 175 | 177 | } |
@@ -198,7 +200,9 @@ discard block |
||
| 198 | 200 | * @return $this |
| 199 | 201 | */ |
| 200 | 202 | public function limit($limit, $page = 1) { |
| 201 | - if($page >= 1) $this->page = $page; |
|
| 203 | + if($page >= 1) { |
|
| 204 | + $this->page = $page; |
|
| 205 | + } |
|
| 202 | 206 | $this->limit = $limit; |
| 203 | 207 | |
| 204 | 208 | return $this; |