Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | protected function compile(string $statement): string |
||
30 | { |
||
31 | $path = $this->getPath($statement); |
||
32 | $attribute = $this->getAttribute($statement); |
||
33 | $field = $this->getField($statement); |
||
34 | |||
35 | $fullPath = !empty($path) |
||
36 | ? \sprintf('%s->%s->%s', $field, $path, $attribute) |
||
37 | : \sprintf('%s->%s', $field, $attribute); |
||
38 | |||
39 | return \sprintf('jsonb_array_length((%s)::jsonb) %s ?', $fullPath, $this->operator); |
||
40 | } |
||
42 |