Conditions | 5 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
24 | 2 | public function join(string $join, string $ref, string $condition = '', ...$bindingsInline): void |
|
25 | { |
||
26 | 2 | $condition = ltrim($condition); |
|
27 | |||
28 | 2 | if ($condition !== '' |
|
29 | 2 | && strtoupper(substr($condition, 0, 3)) !== 'ON ' |
|
30 | 2 | && strtoupper(substr($condition, 0, 6)) !== 'USING ' |
|
31 | ) { |
||
32 | 2 | $condition = 'ON ' . $condition; |
|
33 | } |
||
34 | |||
35 | 2 | if (! empty($bindingsInline)) { |
|
36 | 1 | $condition = $this->bindings->sprintf($condition, ...$bindingsInline); |
|
37 | } |
||
38 | |||
39 | 2 | end($this->list); |
|
40 | 2 | $end = key($this->list); |
|
41 | 2 | $this->list[$end][] = " {$join} {$ref} {$condition}"; |
|
42 | 2 | } |
|
43 | |||
58 |