| 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 | 5 | public function __construct( |
|
| 52 | |||
| 53 | 1 | public function getPrepaid() |
|
| 54 | { |
||
| 55 | 1 | return $this->prepaid; |
|
| 56 | } |
||
| 57 | |||
| 58 | 1 | public function getPrice() |
|
| 59 | { |
||
| 60 | 1 | return $this->price; |
|
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * {@inheritdoc} |
||
| 65 | */ |
||
| 66 | 3 | public function calculateUsage(QuantityInterface $quantity) |
|
| 72 | |||
| 73 | /** |
||
| 74 | * {@inheritdoc} |
||
| 75 | * Same price for any usage. |
||
| 76 | */ |
||
| 77 | 2 | 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.