| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function create(PaymentInterface $payment, string $locale): PaymentView |
||
| 35 | { |
||
| 36 | /** @var PaymentView $paymentView */ |
||
| 37 | $paymentView = new $this->paymentViewClass(); |
||
| 38 | |||
| 39 | $paymentView->state = $payment->getState(); |
||
| 40 | $paymentView->method = $this->paymentMethodViewFactory->create($payment->getMethod(), $locale); |
||
|
|
|||
| 41 | $paymentView->price = $this->priceViewFactory->create($payment->getAmount(), $payment->getCurrencyCode()); |
||
| 42 | |||
| 43 | return $paymentView; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
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.