| 1 | <?php |
||
| 21 | abstract class AbstractPrice implements PriceInterface |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var integer |
||
| 25 | */ |
||
| 26 | protected $id; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var Tariff |
||
| 30 | */ |
||
| 31 | protected $tariff; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var Target |
||
| 35 | */ |
||
| 36 | protected $target; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var Type |
||
| 40 | */ |
||
| 41 | protected $type; |
||
| 42 | |||
| 43 | public function __construct(TargetInterface $target, TypeInterface $type) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @inheritdoc |
||
| 51 | */ |
||
| 52 | public function getTarget() |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @inheritdoc |
||
| 59 | */ |
||
| 60 | public function getType() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @inheritdoc |
||
| 67 | */ |
||
| 68 | public function calculateCharge(ActionInterface $action) |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @inheritdoc |
||
| 89 | * Default sum calculation method: sum = price * usage |
||
| 90 | */ |
||
| 91 | public function calculateSum(QuantityInterface $quantity) |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @inheritdoc |
||
| 108 | */ |
||
| 109 | abstract public function calculateUsage(QuantityInterface $quantity); |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @inheritdoc |
||
| 113 | */ |
||
| 114 | abstract public function calculatePrice(QuantityInterface $action); |
||
| 115 | } |
||
| 116 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.