| 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 | 7 | public function __construct($id, TypeInterface $type, TargetInterface $target) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | 2 | public function getId() |
|
| 52 | { |
||
| 53 | 2 | return $this->id; |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | 7 | public function getType() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritdoc} |
||
| 66 | */ |
||
| 67 | 7 | public function getTarget() |
|
| 71 | |||
| 72 | /** |
||
| 73 | * {@inheritdoc} |
||
| 74 | * Default sum calculation method: sum = price * usage. |
||
| 75 | */ |
||
| 76 | 1 | public function calculateSum(QuantityInterface $quantity) |
|
| 90 | |||
| 91 | public static function create(array $data) |
||
| 95 | |||
| 96 | public function jsonSerialize() |
||
| 104 | |||
| 105 | /** |
||
| 106 | * {@inheritdoc} |
||
| 107 | */ |
||
| 108 | abstract public function calculateUsage(QuantityInterface $quantity); |
||
| 109 | |||
| 110 | /** |
||
| 111 | * {@inheritdoc} |
||
| 112 | */ |
||
| 113 | abstract public function calculatePrice(QuantityInterface $action); |
||
| 114 | } |
||
| 115 |
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..