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