Skip to content

Commit

Permalink
fix: add legacy FilterInterface as return type of getFilter function (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
louismariegaborit committed Apr 15, 2024
1 parent 9fee836 commit 8a232a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ParameterValidator/FilterLocatorTrait.php
Expand Up @@ -13,8 +13,9 @@

namespace ApiPlatform\ParameterValidator;

use ApiPlatform\Api\FilterInterface;
use ApiPlatform\Exception\InvalidArgumentException;
use ApiPlatform\Metadata\FilterInterface;
use ApiPlatform\Metadata\FilterInterface as MetadataFilterInterface;
use Psr\Container\ContainerInterface;

/**
Expand Down Expand Up @@ -45,7 +46,7 @@ private function setFilterLocator(?ContainerInterface $filterLocator, bool $allo
/**
* Gets a filter with a backward compatibility.
*/
private function getFilter(string $filterId): ?FilterInterface
private function getFilter(string $filterId): FilterInterface|MetadataFilterInterface|null
{
if ($this->filterLocator && $this->filterLocator->has($filterId)) {
return $this->filterLocator->get($filterId);
Expand Down

0 comments on commit 8a232a4

Please sign in to comment.