Total Complexity | 7 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class ReactionFactory |
||
8 | { |
||
9 | /** |
||
10 | * @var \Imanghafoori\HeyMan\Chain |
||
11 | */ |
||
12 | private $chain; |
||
13 | |||
14 | /** |
||
15 | * ListenerFactory constructor. |
||
16 | * |
||
17 | * @param Chain $chain |
||
18 | */ |
||
19 | 78 | public function __construct(Chain $chain) |
|
22 | 78 | } |
|
23 | |||
24 | /** |
||
25 | * @return \Closure |
||
26 | */ |
||
27 | 78 | public function make(): \Closure |
|
28 | { |
||
29 | 78 | $responder = app(ResponderFactory::class)->make(); |
|
30 | |||
31 | 78 | return $this->makeReaction($responder); |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param $responder |
||
36 | * |
||
37 | * @return \Closure |
||
38 | */ |
||
39 | 78 | private function makeReaction(callable $responder): \Closure |
|
53 | 78 | }; |
|
54 | } |
||
55 | |||
56 | 78 | private function methodsToCall(): \Closure |
|
68 | } |
||
69 | 3 | }; |
|
72 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.