1 | <?php |
||
10 | class VotingAbilityAwareAssembly extends VotingAssembly implements IVotingAbilityAwareAssembly |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $subjectClassName; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $contextClassName; |
||
22 | |||
23 | /** |
||
24 | * @var string[] |
||
25 | */ |
||
26 | protected $actionList; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * @param \SpareParts\Overseer\StrategyEnum $strategy |
||
31 | * @param IVoter[] $voters |
||
32 | * @param string|string[] $actions |
||
33 | * @param string $contextClassName |
||
34 | * @param string $subjectClassName |
||
35 | */ |
||
36 | public function __construct( |
||
49 | |||
50 | |||
51 | /** |
||
52 | * @param string $actionName |
||
53 | * @param object $subject |
||
54 | * @param \SpareParts\Overseer\Context\IVotingContext $context |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function canVoteOn($actionName, $subject, IVotingContext $context) |
||
72 | |||
73 | } |
||
74 |
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.