Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Apr 29, 2024
1 parent 296e90e commit 62983ce
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
9 changes: 5 additions & 4 deletions lib/Collection/QueryType/Handler/BlockHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler;

use BitBag\SyliusCmsPlugin\Entity\BlockInterface;
use Netgen\Layouts\API\Values\Collection\Query;
use Netgen\Layouts\Collection\QueryType\QueryTypeHandlerInterface;
use Netgen\Layouts\Parameters\ParameterBuilderInterface;
Expand All @@ -31,7 +30,9 @@ final class BlockHandler implements QueryTypeHandlerInterface
use SyliusProductTrait;
use SyliusTaxonTrait;

/** @var array<string, string> */
/**
* @var array<string, string>
*/
private array $sortingOptions = [
'Name' => 'translation.name',
'Code' => 'code',
Expand All @@ -53,9 +54,9 @@ public function buildParameters(ParameterBuilderInterface $builder): void
}

/**
* @return BlockInterface[]
* @return iterable<\BitBag\SyliusCmsPlugin\Entity\BlockInterface>

Check failure on line 57 in lib/Collection/QueryType/Handler/BlockHandler.php

View workflow job for this annotation

GitHub Actions / psalm

InvalidReturnType

lib/Collection/QueryType/Handler/BlockHandler.php:57:16: InvalidReturnType: The declared return type 'iterable<mixed, BitBag\SyliusCmsPlugin\Entity\BlockInterface>' for Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler\BlockHandler::getValues is incorrect, got 'array<array-key, mixed>' (see https://psalm.dev/011)
*/
public function getValues(Query $query, int $offset = 0, ?int $limit = null): array
public function getValues(Query $query, int $offset = 0, ?int $limit = null): iterable
{
$queryBuilder = $this->blockRepository->createListQueryBuilder(
$this->localeContext->getLocaleCode(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler;

use BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionInterface;
use Netgen\Layouts\API\Values\Collection\Query;
use Netgen\Layouts\Collection\QueryType\QueryTypeHandlerInterface;
use Netgen\Layouts\Parameters\ParameterBuilderInterface;
Expand All @@ -24,7 +23,9 @@ final class FrequentlyAskedQuestionHandler implements QueryTypeHandlerInterface
use BitBagSortingTrait;
use SyliusChannelFilterTrait;

/** @var array<string, string> */
/**
* @var array<string, string>
*/
private array $sortingOptions = [
'Position' => 'position',
'Question' => 'translation.question',
Expand All @@ -44,9 +45,9 @@ public function buildParameters(ParameterBuilderInterface $builder): void
}

/**
* @return FrequentlyAskedQuestionInterface[]
* @return iterable<\BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionInterface>

Check failure on line 48 in lib/Collection/QueryType/Handler/FrequentlyAskedQuestionHandler.php

View workflow job for this annotation

GitHub Actions / psalm

InvalidReturnType

lib/Collection/QueryType/Handler/FrequentlyAskedQuestionHandler.php:48:16: InvalidReturnType: The declared return type 'iterable<mixed, BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionInterface>' for Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler\FrequentlyAskedQuestionHandler::getValues is incorrect, got 'array<array-key, mixed>' (see https://psalm.dev/011)
*/
public function getValues(Query $query, int $offset = 0, ?int $limit = null): array
public function getValues(Query $query, int $offset = 0, ?int $limit = null): iterable
{
$queryBuilder = $this->frequentlyAskedQuestionRepository->createListQueryBuilder(
$this->localeContext->getLocaleCode(),
Expand Down
9 changes: 5 additions & 4 deletions lib/Collection/QueryType/Handler/MediaHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler;

use BitBag\SyliusCmsPlugin\Entity\MediaInterface;
use Netgen\Layouts\API\Values\Collection\Query;
use Netgen\Layouts\Collection\QueryType\QueryTypeHandlerInterface;
use Netgen\Layouts\Parameters\ParameterBuilderInterface;
Expand All @@ -29,7 +28,9 @@ final class MediaHandler implements QueryTypeHandlerInterface
use SyliusChannelFilterTrait;
use SyliusProductTrait;

/** @var array<string, string> */
/**
* @var array<string, string>
*/
private array $sortingOptions = [
'Name' => 'translation.name',
'Code' => 'code',
Expand All @@ -50,9 +51,9 @@ public function buildParameters(ParameterBuilderInterface $builder): void
}

/**
* @return MediaInterface[]
* @return iterable<\BitBag\SyliusCmsPlugin\Entity\MediaInterface>

Check failure on line 54 in lib/Collection/QueryType/Handler/MediaHandler.php

View workflow job for this annotation

GitHub Actions / psalm

InvalidReturnType

lib/Collection/QueryType/Handler/MediaHandler.php:54:16: InvalidReturnType: The declared return type 'iterable<mixed, BitBag\SyliusCmsPlugin\Entity\MediaInterface>' for Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler\MediaHandler::getValues is incorrect, got 'array<array-key, mixed>' (see https://psalm.dev/011)
*/
public function getValues(Query $query, int $offset = 0, ?int $limit = null): array
public function getValues(Query $query, int $offset = 0, ?int $limit = null): iterable
{
$queryBuilder = $this->mediaRepository->createListQueryBuilder(
$this->localeContext->getLocaleCode(),
Expand Down
9 changes: 5 additions & 4 deletions lib/Collection/QueryType/Handler/PageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler;

use BitBag\SyliusCmsPlugin\Entity\PageInterface;
use Netgen\Layouts\API\Values\Collection\Query;
use Netgen\Layouts\Collection\QueryType\QueryTypeHandlerInterface;
use Netgen\Layouts\Parameters\ParameterBuilderInterface;
Expand All @@ -29,7 +28,9 @@ final class PageHandler implements QueryTypeHandlerInterface
use SyliusChannelFilterTrait;
use SyliusProductTrait;

/** @var array<string, string> */
/**
* @var array<string, string>
*/
private array $sortingOptions = [
'Name' => 'translation.name',
'Code' => 'code',
Expand All @@ -53,9 +54,9 @@ public function buildParameters(ParameterBuilderInterface $builder): void
}

/**
* @return PageInterface[]
* @return iterable<\BitBag\SyliusCmsPlugin\Entity\PageInterface>

Check failure on line 57 in lib/Collection/QueryType/Handler/PageHandler.php

View workflow job for this annotation

GitHub Actions / psalm

InvalidReturnType

lib/Collection/QueryType/Handler/PageHandler.php:57:16: InvalidReturnType: The declared return type 'iterable<mixed, BitBag\SyliusCmsPlugin\Entity\PageInterface>' for Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler\PageHandler::getValues is incorrect, got 'array<array-key, mixed>' (see https://psalm.dev/011)
*/
public function getValues(Query $query, int $offset = 0, ?int $limit = null): array
public function getValues(Query $query, int $offset = 0, ?int $limit = null): iterable
{
$queryBuilder = $this->pageRepository->createListQueryBuilder(
$this->localeContext->getLocaleCode(),
Expand Down
9 changes: 5 additions & 4 deletions lib/Collection/QueryType/Handler/SectionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler;

use BitBag\SyliusCmsPlugin\Entity\SectionInterface;
use Netgen\Layouts\API\Values\Collection\Query;
use Netgen\Layouts\Collection\QueryType\QueryTypeHandlerInterface;
use Netgen\Layouts\Parameters\ParameterBuilderInterface;
Expand All @@ -20,7 +19,9 @@ final class SectionHandler implements QueryTypeHandlerInterface
{
use BitBagSortingTrait;

/** @var array<string, string> */
/**
* @var array<string, string>
*/
private array $sortingOptions = [
'Name' => 'translation.name',
'Code' => 'code',
Expand All @@ -37,9 +38,9 @@ public function buildParameters(ParameterBuilderInterface $builder): void
}

/**
* @return SectionInterface[]
* @return iterable<\BitBag\SyliusCmsPlugin\Entity\SectionInterface>

Check failure on line 41 in lib/Collection/QueryType/Handler/SectionHandler.php

View workflow job for this annotation

GitHub Actions / psalm

InvalidReturnType

lib/Collection/QueryType/Handler/SectionHandler.php:41:16: InvalidReturnType: The declared return type 'iterable<mixed, BitBag\SyliusCmsPlugin\Entity\SectionInterface>' for Netgen\Layouts\Sylius\BitBag\Collection\QueryType\Handler\SectionHandler::getValues is incorrect, got 'array<array-key, mixed>' (see https://psalm.dev/011)
*/
public function getValues(Query $query, int $offset = 0, ?int $limit = null): array
public function getValues(Query $query, int $offset = 0, ?int $limit = null): iterable
{
$queryBuilder = $this->sectionRepository->createListQueryBuilder(
$this->localeContext->getLocaleCode(),
Expand Down

0 comments on commit 62983ce

Please sign in to comment.