| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 29 | public function countByVariant(ProductVariantInterface $variant, array $orderStates = []): int |
||
| 30 | { |
||
| 31 | if (!$orderStates) { |
||
| 32 | $orderStates = [OrderInterface::STATE_CANCELLED, OrderInterface::STATE_CART]; |
||
| 33 | } |
||
| 34 | |||
| 35 | return (int) ($this->baseOrderItemRepository |
||
| 36 | ->createQueryBuilder('oi') |
||
| 37 | ->select('SUM(oi.quantity)') |
||
| 38 | ->join('oi.order', 'o') |
||
| 39 | ->where('oi.variant = :variant') |
||
| 40 | ->andWhere('o.state NOT IN (:states)') |
||
| 41 | ->setParameter('variant', $variant) |
||
| 42 | ->setParameter('states', $orderStates) |
||
| 43 | ->getQuery() |
||
| 44 | ->getSingleScalarResult()); |
||
| 45 | } |
||
| 47 |
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..