Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function create(PaymentInterface $payment, $locale) |
||
34 | { |
||
35 | $paymentView = new PaymentView(); |
||
36 | |||
37 | $paymentView->state = $payment->getState(); |
||
38 | $paymentView->method = $this->paymentMethodViewFactory->create($payment->getMethod(), $locale); |
||
|
|||
39 | $paymentView->price = $this->priceViewFactory->create($payment->getAmount()); |
||
40 | |||
41 | return $paymentView; |
||
42 | } |
||
43 | } |
||
44 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.