Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 18 | public function buildMessage(array $users, $object, $language = null) |
|
33 | { |
||
34 | 18 | $filteredUsers = self::filterUsers($users); |
|
35 | |||
36 | 18 | if (count($filteredUsers) === 0) { |
|
37 | 9 | return null; |
|
38 | } |
||
39 | |||
40 | 9 | $messageText = $this->extractor->extractMessage($object, ($language) ? : self::getLanguage($filteredUsers)); |
|
41 | |||
42 | 9 | if ($messageText === null) { |
|
43 | 3 | return null; |
|
44 | } |
||
45 | |||
46 | 6 | return new DefaultMessage($filteredUsers, $messageText); |
|
|
|||
47 | } |
||
48 | |||
73 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: