1 | <?php |
||
22 | class LastCombination implements ChargeModifier |
||
23 | { |
||
24 | public function __construct(ChargeModifier $left, ChargeModifier $right) |
||
29 | |||
30 | public function modifyCharge(?ChargeInterface $charge, ActionInterface $action): array |
||
38 | |||
39 | public function isSuitable(?ChargeInterface $charge, ActionInterface $action): bool |
||
43 | } |
||
44 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: