Skip to content

Commit

Permalink
Add fix for phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymon Kostrubiec committed Jul 9, 2024
1 parent e992598 commit d6a7421
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function getQuery(FormEvent $event, string $namePropertyPrefix): Query

$data = $this->shopProductListDataHandler->retrieveData($eventData);

/** @var Query\BoolQuery $boolQuery */
$boolQuery = $this->searchProductsQueryBuilder->buildQuery($data);

foreach ($data['facets'] ?? [] as $facetId => $selectedBuckets) {
Expand Down
6 changes: 4 additions & 2 deletions src/Repository/ProductAttributeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ public function __construct(

public function getAttributeTypeByName(string $attributeName): string
{
/** @var QueryBuilder $queryBuilder */
$queryBuilder = $this->productAttributeRepository->createQueryBuilder('p');
/** @var EntityRepository $queryBuilder */
$queryBuilder = $this->productAttributeRepository;

$result = $queryBuilder
->createQueryBuilder('o')
->select('p.type')
->where('p.code = :code')
->setParameter(':code', $attributeName)
Expand All @@ -47,6 +48,7 @@ public function findAllWithTranslations(?string $locale): array
$queryBuilder
->createQueryBuilder('o')
->addSelect('translation')
/** @phpstan-ignore-next-line */
->leftJoin('o.translations', 'translation', 'ot')
->andWhere('translation.locale = :locale')
->setParameter('locale', $locale)
Expand Down
1 change: 1 addition & 0 deletions src/Repository/ProductAttributeValueRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function __construct(

public function getUniqueAttributeValues(AttributeInterface $productAttribute, Taxon $taxon): array
{
/** @phpstan-ignore-next-line */
$queryBuilder = $this->baseAttributeValueRepository->createQueryBuilder('o');

/** @var string|null $storageType */
Expand Down
1 change: 1 addition & 0 deletions src/Repository/ProductOptionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function findAllWithTranslations(?string $locale): array
$queryBuilder
->createQueryBuilder('o')
->addSelect('translation')
/** @phpstan-ignore-next-line */
->leftJoin('o.translations', 'translation', 'ot')
->andWhere('translation.locale = :locale')
->setParameter('locale', $locale)
Expand Down

0 comments on commit d6a7421

Please sign in to comment.