1 | <?php |
||
24 | abstract class AbstractPrice implements PriceInterface, EntityInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var integer |
||
28 | */ |
||
29 | protected $id; |
||
30 | |||
31 | /** |
||
32 | * @var Type |
||
33 | */ |
||
34 | protected $type; |
||
35 | |||
36 | /** |
||
37 | * @var Target |
||
38 | */ |
||
39 | protected $target; |
||
40 | |||
41 | 4 | public function __construct($id, TypeInterface $type, TargetInterface $target) |
|
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | 3 | public function getType() |
|
52 | { |
||
53 | 3 | return $this->type; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 3 | public function getTarget() |
|
60 | { |
||
61 | 3 | return $this->target; |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | * Default sum calculation method: sum = price * usage. |
||
67 | */ |
||
68 | 1 | public function calculateSum(QuantityInterface $quantity) |
|
82 | |||
83 | public static function create(array $data) |
||
87 | |||
88 | public function jsonSerialize() |
||
89 | { |
||
90 | return [ |
||
91 | 'id' => $this->id, |
||
92 | 'type' => $this->type, |
||
93 | 'target' => $this->target, |
||
94 | ]; |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | abstract public function calculateUsage(QuantityInterface $quantity); |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | abstract public function calculatePrice(QuantityInterface $action); |
||
106 | } |
||
107 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..