Skip to content

Commit

Permalink
Adjust Symfony bundle code to work with newer versions
Browse files Browse the repository at this point in the history
  • Loading branch information
stloyd committed Dec 15, 2023
1 parent 7171446 commit fe96e50
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Aeon\RateLimiter\Algorithm\LeakyBucketAlgorithm;
use Aeon\RateLimiter\Algorithm\SlidingWindowAlgorithm;
use Aeon\RateLimiter\RateLimiter;
use Aeon\Symfony\AeonBundle\DependencyInjection\Loader\Configurator\LegacyConfigurator;
use Aeon\Symfony\AeonBundle\EventListener\RateLimitExceptionListener;
use Aeon\Symfony\AeonBundle\RateLimiter\RateLimitHttpProtocol;
use Aeon\Symfony\AeonBundle\RateLimiter\RequestIdentificationStrategy\HeaderRequestIdentificationStrategy;
Expand All @@ -29,9 +28,6 @@ final class AeonExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container) : void
{
// Trigger autoloading of legacy service function
\class_exists(LegacyConfigurator::class);

$config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs);

$loader = new PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
public function getConfigTreeBuilder() : TreeBuilder
{
$treeBuilder = new TreeBuilder('aeon');
/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class AeonDateTimeToDateTimeTransformer implements DataTransformerInterfac
/**
* @psalm-suppress MissingReturnType
*/
public function transform($value)
public function transform($value) : mixed
{
if ($value instanceof DateTime) {
return $value->toDateTimeImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class AeonDayToDateTimeTransformer implements DataTransformerInterface
/**
* @psalm-suppress MissingReturnType
*/
public function transform($value)
public function transform($value) : mixed
{
if ($value instanceof Day) {
return $value->toDateTimeImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class AeonTimeToDateTimeTransformer implements DataTransformerInterface
/**
* @psalm-suppress MissingReturnType
*/
public function transform($value)
public function transform($value) : mixed
{
if ($value instanceof Time) {
return new \DateTimeImmutable($value->toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class AeonTimeZoneToDateTimeTransformer implements DataTransformerInterfac
/**
* @psalm-suppress MissingReturnType
*/
public function transform($value)
public function transform($value) : mixed
{
if ($value instanceof TimeZone) {
return $value->toDateTimeZone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use function Aeon\Symfony\AeonBundle\DependencyInjection\Loader\Configurator\service;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
use Aeon\Calendar\Gregorian\Calendar;
use Aeon\Calendar\Gregorian\GregorianCalendar;
use Aeon\Calendar\Gregorian\TimeZone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use function Aeon\Symfony\AeonBundle\DependencyInjection\Loader\Configurator\service;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
use Aeon\Symfony\AeonBundle\Validator\Constraints\HolidayValidator;
use Aeon\Symfony\AeonBundle\Validator\Constraints\NotHolidayValidator;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use function Aeon\Symfony\AeonBundle\DependencyInjection\Loader\Configurator\service;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
use Aeon\Symfony\AeonBundle\RateLimiter\RateLimiters;
use Aeon\Symfony\AeonBundle\Twig\RateLimiterExtension;
use Aeon\Twig\CalendarExtension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use function Aeon\Symfony\AeonBundle\DependencyInjection\Loader\Configurator\service;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
use Aeon\Symfony\AeonBundle\EventListener\RateLimitRequestListener;
use Aeon\Symfony\AeonBundle\EventListener\RateLimitResponseListener;
use Aeon\Symfony\AeonBundle\RateLimiter\RateLimiters;
Expand Down

0 comments on commit fe96e50

Please sign in to comment.