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