Skip to content

Commit

Permalink
Remove deprecated annotation loader in tests, not required
Browse files Browse the repository at this point in the history
  • Loading branch information
silverbackdan committed Jan 27, 2023
1 parent d448abc commit cf7c0ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
41 changes: 17 additions & 24 deletions src/Filter/OrSearchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ final class OrSearchFilter extends AbstractFilter implements SearchFilterInterfa

public const DOCTRINE_INTEGER_TYPE = Types::INTEGER;

public function __construct(ManagerRegistry $managerRegistry, IriConverterInterface $iriConverter, PropertyAccessorInterface $propertyAccessor = null, LoggerInterface $logger = null, array $properties = null, NameConverterInterface $nameConverter = null)
public function __construct(
ManagerRegistry $managerRegistry,
IriConverterInterface $iriConverter,
PropertyAccessorInterface $propertyAccessor = null,
LoggerInterface $logger = null,
array $properties = null,
NameConverterInterface $nameConverter = null
)
{
parent::__construct($managerRegistry, $logger, $properties, $nameConverter);

Expand All @@ -52,29 +59,15 @@ public function __construct(ManagerRegistry $managerRegistry, IriConverterInterf
*/
protected function getType(string $doctrineType): string
{
switch ($doctrineType) {
case Types::ARRAY:
return 'array';
case Types::BIGINT:
case Types::INTEGER:
case Types::SMALLINT:
return 'int';
case Types::BOOLEAN:
return 'bool';
case Types::DATE_MUTABLE:
case Types::TIME_MUTABLE:
case Types::DATETIME_MUTABLE:
case Types::DATETIMETZ_MUTABLE:
case Types::DATE_IMMUTABLE:
case Types::TIME_IMMUTABLE:
case Types::DATETIME_IMMUTABLE:
case Types::DATETIMETZ_IMMUTABLE:
return \DateTimeInterface::class;
case Types::FLOAT:
return 'float';
}

return 'string';
return match ($doctrineType) {
Types::ARRAY => 'array',
Types::JSON => 'json',
Types::BIGINT, Types::INTEGER, Types::SMALLINT => 'int',
Types::BOOLEAN => 'bool',
Types::DATE_MUTABLE, Types::TIME_MUTABLE, Types::DATETIME_MUTABLE, Types::DATETIMETZ_MUTABLE, Types::DATE_IMMUTABLE, Types::TIME_IMMUTABLE, Types::DATETIME_IMMUTABLE, Types::DATETIMETZ_IMMUTABLE => \DateTimeInterface::class,
Types::FLOAT => 'float',
default => 'string',
};
}

protected function getIriConverter(): IriConverterInterface
Expand Down
4 changes: 0 additions & 4 deletions tests/Functional/app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@

declare(strict_types=1);

use Doctrine\Common\Annotations\AnnotationRegistry;

date_default_timezone_set('UTC');

$loader = require __DIR__ . '/../../../vendor/autoload.php';
require __DIR__ . '/AppKernel.php';

AnnotationRegistry::registerLoader('class_exists');

return $loader;

0 comments on commit cf7c0ca

Please sign in to comment.