1 | <?php |
||
27 | class SinglePrice extends AbstractPrice |
||
28 | { |
||
29 | /** |
||
30 | * @var Quantity prepaid quantity also implies Unit |
||
31 | */ |
||
32 | protected $prepaid; |
||
33 | |||
34 | /** |
||
35 | * @var Money |
||
36 | */ |
||
37 | protected $price; |
||
38 | |||
39 | public function __construct( |
||
50 | |||
51 | /* |
||
52 | protected $properties = [ |
||
53 | 'id' => '', |
||
54 | 'target' => [AbstractTarget::class, 'create'], |
||
55 | 'type' => [Type::class, 'create'], |
||
56 | 'prepaid' => [Quantity::class, 'create'], |
||
57 | 'price' => [MoneyFactory::class, 'create'], |
||
58 | ]; |
||
59 | */ |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function calculateUsage(QuantityInterface $quantity) |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | * Same price for any usage. |
||
74 | */ |
||
75 | public function calculatePrice(QuantityInterface $usage) |
||
79 | } |
||
80 |
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.