| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 3 | public function findClientNotesAmount(int $clientId): int |
|
| 22 | { |
||
| 23 | 3 | $query = $this->queryFactory->selectQuery()->from('client'); |
|
| 24 | |||
| 25 | 3 | $query->select(['amount' => $query->func()->count('n.id')]) |
|
| 26 | 3 | ->join(['n' => ['table' => 'note', 'type' => 'LEFT', 'conditions' => 'n.client_id = client.id']]) |
|
| 27 | 3 | ->where( |
|
| 28 | 3 | [ |
|
| 29 | 3 | 'client.id' => $clientId, |
|
| 30 | // The main note should not be counted in |
||
| 31 | 3 | 'n.is_main' => 0, |
|
| 32 | 3 | 'n.deleted_at IS' => null, |
|
| 33 | 3 | ] |
|
| 34 | 3 | ); |
|
| 35 | |||
| 36 | // Return amount of notes |
||
| 37 | 3 | return (int)$query->execute()->fetch('assoc')['amount']; |
|
| 38 | } |
||
| 40 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths