| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 30 | private function buildLimit(): string |
|
| 41 | { |
||
| 42 | 30 | $limit = $this->buildLimitClause(); |
|
| 43 | |||
| 44 | 30 | $offset = ''; |
|
| 45 | 30 | if(! empty($limit)) |
|
| 46 | { |
||
| 47 | 6 | $offset = $this->buildOffsetClause(); |
|
| 48 | } |
||
| 49 | |||
| 50 | 30 | $clauses = array($limit, $offset); |
|
| 51 | |||
| 52 | 30 | return implode(' ', array_filter($clauses)); |
|
| 53 | } |
||
| 54 | |||
| 75 |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.