1 | <?php |
||
21 | abstract class AbstractPrice implements PriceInterface, EntityInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var integer |
||
25 | */ |
||
26 | protected $id; |
||
27 | |||
28 | /** |
||
29 | * @var Target |
||
30 | */ |
||
31 | protected $target; |
||
32 | |||
33 | /** |
||
34 | * @var Type |
||
35 | */ |
||
36 | protected $type; |
||
37 | |||
38 | 3 | public function __construct($id, TargetInterface $target, TypeInterface $type) |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 2 | public function getTarget() |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 2 | public function getType() |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | * Default sum calculation method: sum = price * usage. |
||
64 | */ |
||
65 | 1 | public function calculateSum(QuantityInterface $quantity) |
|
79 | |||
80 | public static function create(array $data) |
||
84 | |||
85 | public function jsonSerialize() |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | abstract public function calculateUsage(QuantityInterface $quantity); |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | abstract public function calculatePrice(QuantityInterface $action); |
||
103 | } |
||
104 |
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.