| Conditions | 1 |
| Paths | 1 |
| Total Lines | 7 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 2 | public function compileParentKeyOfFirstPathSegment(string $pathColumn, string $parentKeyColumn, Builder $parentKeyQuery): string |
|
| 32 | { |
||
| 33 | 2 | $column = $this->wrap($pathColumn); |
|
| 34 | 2 | $parentKeyColumn = $this->wrap($parentKeyColumn); |
|
| 35 | 2 | $sql = $parentKeyQuery->toSql(); |
|
| 36 | |||
| 37 | 2 | return "case when instr($column, ?) = 0 then $parentKeyColumn else ($sql) end"; |
|
| 38 | } |
||
| 40 |