1 | <?php |
||||
2 | |||||
3 | /* |
||||
4 | * This file was created by developers working at BitBag |
||||
5 | * Do you need more information about us and what we do? Visit our https://bitbag.io website! |
||||
6 | * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career |
||||
7 | */ |
||||
8 | |||||
9 | declare(strict_types=1); |
||||
10 | |||||
11 | namespace BitBag\SyliusElasticsearchPlugin\Repository; |
||||
12 | |||||
13 | use Doctrine\ORM\EntityRepository; |
||||
14 | use Sylius\Component\Core\Model\OrderInterface; |
||||
15 | use Sylius\Component\Core\Model\ProductVariantInterface; |
||||
16 | |||||
17 | class OrderItemRepository implements OrderItemRepositoryInterface |
||||
18 | { |
||||
19 | /** @var OrderItemRepositoryInterface */ |
||||
20 | private $baseOrderItemRepository; |
||||
21 | |||||
22 | public function __construct(EntityRepository $baseOrderItemRepository) |
||||
23 | { |
||||
24 | $this->baseOrderItemRepository = $baseOrderItemRepository; |
||||
0 ignored issues
–
show
|
|||||
25 | } |
||||
26 | |||||
27 | public function countByVariant(ProductVariantInterface $variant, array $orderStates = []): int |
||||
28 | { |
||||
29 | if (empty($orderStates)) { |
||||
30 | $orderStates = [OrderInterface::STATE_CANCELLED, OrderInterface::STATE_CART]; |
||||
31 | } |
||||
32 | |||||
33 | return (int) ($this->baseOrderItemRepository |
||||
34 | ->createQueryBuilder('oi') |
||||
0 ignored issues
–
show
The method
createQueryBuilder() does not exist on BitBag\SyliusElasticsear...ItemRepositoryInterface .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||||
35 | ->select('SUM(oi.quantity)') |
||||
36 | ->join('oi.order', 'o') |
||||
37 | ->where('oi.variant = :variant') |
||||
38 | ->andWhere('o.state NOT IN (:states)') |
||||
39 | ->setParameter('variant', $variant) |
||||
40 | ->setParameter('states', $orderStates) |
||||
41 | ->getQuery() |
||||
42 | ->getSingleScalarResult()); |
||||
43 | } |
||||
44 | } |
||||
45 |
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..