src/Api/FilterLocatorTrait.php
private function setFilterLocator($filterLocator, bool $allowNull = false): void
    {
        if ($filterLocator instanceof ContainerInterface || $filterLocator instanceof FilterCollection || (null === $filterLocator && $allowNull)) {
            if ($filterLocator instanceof FilterCollection) {
                @trigger_error(sprintf('The %s class is deprecated since version 2.1 and will be removed in 3.0. Provide an implementation of %s instead.', FilterCollection::class, ContainerInterface::class), E_USER_DEPRECATED);
            }

            $this->filterLocator = $filterLocator;
        } else {
            throw new InvalidArgumentException(sprintf('The "$filterLocator" argument is expected to be an implementation of the "%s" interface%s.', ContainerInterface::class, $allowNull ? ' or null' : ''));
        }
    }
private function setFilterLocator($filterLocator, bool $allowNull = false): void
    {
        if ($filterLocator instanceof ContainerInterface || $filterLocator instanceof FilterCollection || (null === $filterLocator && $allowNull)) {
            if ($filterLocator instanceof FilterCollection) {
                @trigger_error(sprintf('The %s class is deprecated since version 2.1 and will be removed in 3.0. Provide an implementation of %s instead.', FilterCollection::class, ContainerInterface::class), E_USER_DEPRECATED);
            }

            $this->filterLocator = $filterLocator;
        } else {
            throw new InvalidArgumentException(sprintf('The "$filterLocator" argument is expected to be an implementation of the "%s" interface%s.', ContainerInterface::class, $allowNull ? ' or null' : ''));
        }
    }
private function setFilterLocator ( $ filterLocator , bool $ allowNull = false ) : void { if ( $ filterLocator instanceof ContainerInterface || $ filterLocator instanceof FilterCollection || ( null === $ filterLocator && $ allowNull ) ) { if ( $ filterLocator instanceof FilterCollection ) { @ trigger_error ( sprintf ( 'The %s class is deprecated since version 2.1 and will be removed in 3.0. Provide an implementation of %s instead.' , FilterCollection :: class , ContainerInterface :: class ) , E_USER_DEPRECATED ) ; } $ this -> filterLocator = $ filterLocator ; } else { throw new InvalidArgumentException ( sprintf ( 'The "$filterLocator" argument is expected to be an implementation of the "%s" interface%s.' , ContainerInterface :: class , $ allowNull ? ' or null' : '' ) ) ; } }
Sets a filter locator with a backward compatibility.

@param ContainerInterface|FilterCollection|null $filterLocator
Sets a filter locator with a backward compatibility .