| Conditions | 5 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.1502 |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 29 | 12 | protected function wrapValue($value) |
|
| 30 | { |
||
| 31 | 12 | if ($value === '*') { |
|
| 32 | return $value; |
||
| 33 | } |
||
| 34 | |||
| 35 | // If querying hstore |
||
| 36 | 12 | if (preg_match('/\[(.*?)\]/', $value, $match)) { |
|
| 37 | 3 | return (string)str_replace(array('[', ']'), '', $match[1]); |
|
| 38 | } |
||
| 39 | |||
| 40 | // If querying json column |
||
| 41 | 9 | foreach ($this->jsonOperators as $operator) { |
|
| 42 | 9 | if (stripos($value, $operator)) { |
|
| 43 | 9 | list($value, $key) = explode($operator, $value, 2); |
|
| 44 | 9 | return parent::wrapValue($value) . $operator . $key; |
|
| 45 | } |
||
| 46 | 3 | } |
|
| 47 | |||
| 48 | return parent::wrapValue($value); |
||
| 49 | } |
||
| 50 | |||
| 77 |