Conditions | 5 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
55 | 8 | public function isHandling(array $record) |
|
56 | { |
||
57 | 8 | if (count($record) == 1) { |
|
58 | 3 | return parent::isHandling($record); |
|
59 | } |
||
60 | |||
61 | 7 | if (!parent::isHandling($record)) { |
|
62 | 4 | return false; |
|
63 | } |
||
64 | |||
65 | 5 | if (empty($this->channel)) { |
|
66 | 3 | return empty($record['context']['channel']); |
|
67 | } |
||
68 | |||
69 | 2 | if (empty($record['context']['channel'])) { |
|
70 | return false; |
||
71 | 2 | } |
|
72 | |||
73 | 2 | $supported = $this->channel === $record['context']['channel']; |
|
74 | |||
75 | return $supported; |
||
76 | } |
||
77 | } |
||
78 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.