Skip to content

Commit

Permalink
Revert "Bump supported Symfony versions" (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech authored Dec 18, 2023
1 parent fba14ce commit d2e49a2
Show file tree
Hide file tree
Showing 29 changed files with 388 additions and 480 deletions.
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"azuyalabs/yasumi": "~2.0",
"doctrine/dbal": "~2.6 || ~3.0",
"psr/cache": "~1.0|~2.0|~3.0",
"symfony/config": "^5.4.21||^6.3||^7.0",
"symfony/dependency-injection": "^5.4.21||^6.3||^7.0",
"symfony/form": "^5.4.21||^6.3||^7.0",
"symfony/http-kernel": "^5.4.21||^6.3||^7.0",
"symfony/config": "~4.4.44||~5.4.21||~6.0",
"symfony/dependency-injection": "~4.4.49||~5.4.21||~6.0",
"symfony/form": "~4.4.48||~5.4.21||~6.0",
"symfony/http-kernel": "~4.4.50||~5.4.21||~6.0",
"symfony/polyfill-mbstring": "~1.0",
"symfony/validator": "^5.4.21||^6.3||^7.0",
"symfony/validator": "~4.4.48||~5.4.21||~6.0",
"twig/twig": "~1.43||~2.10||~3"
},
"require-dev": {
Expand All @@ -32,11 +32,11 @@
"flow-php/etl-adapter-http": "^0.1 || ^0.2",
"google/apiclient": "^2.0",
"phpbench/phpbench": "^1.2.6",
"symfony/browser-kit": "^6.4||^7.0",
"symfony/cache": "^6.4||^7.0",
"symfony/dom-crawler": "^6.4||^7.0",
"symfony/framework-bundle": "^6.4||^7.0",
"symfony/security-bundle": "^6.4||^7.0"
"symfony/browser-kit": "~4.4.44||~5.4.21||~6",
"symfony/cache": "~4.4.48||~5.1||~6.0",
"symfony/dom-crawler": "~4.4.45||~5.4.21||~6.0",
"symfony/framework-bundle": "~4.4.49||~5.4.21||~6.0",
"symfony/security-bundle": "~4.4.44||~5.4.21||~6.0"
},
"suggest": {
"ext-bcmath": "Compare time units with high precision"
Expand Down
603 changes: 297 additions & 306 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/rate-limiter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"symfony/polyfill-mbstring": "^1.0"
},
"require-dev": {
"symfony/cache": "^6.4||^7.0"
"symfony/cache": "^5.1||^6.0"
},
"config": {
"optimize-autoloader": true,
Expand Down
18 changes: 9 additions & 9 deletions src/symfony-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
"aeon-php/rate-limiter": "~1.0",
"aeon-php/retry": "~1.0",
"aeon-php/sleep": "~1.0",
"symfony/config": "^5.4.21||^6.3||^7.0",
"symfony/dependency-injection": "^5.4.21||^6.3||^7.0",
"symfony/form": "^5.4.21||^6.3||^7.0",
"symfony/http-kernel": "^5.4.21||^6.3||^7.0",
"symfony/validator": "^5.4.21||^6.3||^7.0"
"symfony/config": "^4.4.12||^5.0||^6.0",
"symfony/dependency-injection": "^4.4.12||^5.1||^6.0",
"symfony/form": "^4.4.12||^5.3||^6.0",
"symfony/http-kernel": "^4.4||^5.0||^6.0",
"symfony/validator": "^4.4||^5.0||^6.0"
},
"require-dev": {
"aeon-php/calendar-holidays-yasumi": "~1.0",
"symfony/browser-kit": "^5.4.21||^6.3||^7.0",
"symfony/dom-crawler": "^5.4.21||^6.3||^7.0",
"symfony/framework-bundle": "^5.4.21||^6.3||^7.0",
"symfony/security-bundle": "^5.4.21||^6.3||^7.0"
"symfony/browser-kit": "^4.4||^5.0||^6.0",
"symfony/dom-crawler": "^4.4.12||^5.0||^6.0",
"symfony/framework-bundle": "^4.4||^5.3||^6.0",
"symfony/security-bundle": "^4.4||^5.0||^6.0"
},
"license": "MIT",
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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 @@ -28,6 +29,9 @@ 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() : TreeBuilder
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('aeon');
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace Aeon\Symfony\AeonBundle\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\Loader\Configurator as Symfony;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;

/**
* @deprecated Remove when dropping Symfony 4.4 support.
*/
final class LegacyConfigurator extends ContainerConfigurator
{
}

/**
* @psalm-suppress UnusedParam
* @psalm-suppress MixedInferredReturnType
* @psalm-suppress MixedReturnStatement
*/
function service(string $id) : ReferenceConfigurator
{
if (\function_exists('Symfony\Component\DependencyInjection\Loader\Configurator\service')) {
return Symfony\service($id);
}

/** @phpstan-ignore-next-line */
return Symfony\ref($id);
}
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) : mixed
public function transform($value)
{
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) : mixed
public function transform($value)
{
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) : mixed
public function transform($value)
{
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) : mixed
public function transform($value)
{
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 Symfony\Component\DependencyInjection\Loader\Configurator\service;
use function Aeon\Symfony\AeonBundle\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 Symfony\Component\DependencyInjection\Loader\Configurator\service;
use function Aeon\Symfony\AeonBundle\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 Symfony\Component\DependencyInjection\Loader\Configurator\service;
use function Aeon\Symfony\AeonBundle\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 Symfony\Component\DependencyInjection\Loader\Configurator\service;
use function Aeon\Symfony\AeonBundle\DependencyInjection\Loader\Configurator\service;
use Aeon\Symfony\AeonBundle\EventListener\RateLimitRequestListener;
use Aeon\Symfony\AeonBundle\EventListener\RateLimitResponseListener;
use Aeon\Symfony\AeonBundle\RateLimiter\RateLimiters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,9 @@ final class After extends AbstractComparison
{
public const BEFORE_OR_EQUAL_ERROR = '99f63b74-a275-4a01-8678-63124971bff8';

/**
* @var array<string, string>
*/
protected const ERROR_NAMES = [
self::BEFORE_OR_EQUAL_ERROR => 'BEFORE_OR_EQUAL_ERROR',
];

/**
* @var array<string, string>
*/
protected static $errorNames = [
self::BEFORE_OR_EQUAL_ERROR => 'BEFORE_OR_EQUAL_ERROR',
];

public function __construct(mixed $value = null, string $propertyPath = null, string $message = 'This value should be after {{ compared_value }}.', array $groups = null, mixed $payload = null, array $options = [])
{
parent::__construct(
$value,
$propertyPath,
$message,
$groups,
$payload,
$options
);
}
public $message = 'This value should be after {{ compared_value }}.';
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,9 @@ final class AfterOrEqual extends AbstractComparison
{
public const BEFORE_ERROR = '1c6d2666-52d7-4131-bd11-3f90e2120c2d';

/**
* @var array<string, string>
*/
protected const ERROR_NAMES = [
self::BEFORE_ERROR => 'BEFORE_ERROR',
];

/**
* @var array<string, string>
*/
protected static $errorNames = [
self::BEFORE_ERROR => 'BEFORE_ERROR',
];

public function __construct(mixed $value = null, string $propertyPath = null, string $message = 'This value should be after or equal {{ compared_value }}.', array $groups = null, mixed $payload = null, array $options = [])
{
parent::__construct(
$value,
$propertyPath,
$message,
$groups,
$payload,
$options
);
}
public $message = 'This value should be after or equal {{ compared_value }}.';
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class AfterOrEqualValidator extends AbstractComparisonValidator
{
/**
* @param DateTime|Day|Month|Year $value1
* @param null|DateTime|Day|Month|Year $value2
* @param ?DateTime|?Day|?Month|?Year $value2
*
* @return bool
*/
Expand All @@ -28,7 +28,7 @@ protected function compareValues($value1, $value2) : bool
return false;
}

return $value1->isAfterOrEqualTo($value2);
return $value1->isAfterOrEqual($value2);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class AfterValidator extends AbstractComparisonValidator
{
/**
* @param DateTime|Day|Month|Year $value1
* @param null|DateTime|Day|Month|Year $value2
* @param ?DateTime|?Day|?Month|?Year $value2
*
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,9 @@ final class Before extends AbstractComparison
{
public const BEFORE_OR_EQUAL_ERROR = 'c561f511-0fee-4fed-8505-6e67e21aa903';

/**
* @var array<string, string>
*/
protected const ERROR_NAMES = [
self::BEFORE_OR_EQUAL_ERROR => 'BEFORE_OR_EQUAL_ERROR',
];

/**
* @var array<string, string>
*/
protected static $errorNames = [
self::BEFORE_OR_EQUAL_ERROR => 'BEFORE_OR_EQUAL_ERROR',
];

public function __construct(mixed $value = null, string $propertyPath = null, string $message = 'This value should be before {{ compared_value }}.', array $groups = null, mixed $payload = null, array $options = [])
{
parent::__construct(
$value,
$propertyPath,
$message,
$groups,
$payload,
$options
);
}
public $message = 'This value should be before {{ compared_value }}.';
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,9 @@ final class BeforeOrEqual extends AbstractComparison
{
public const AFTER_ERROR = 'c411b575-c9fd-4e22-af8a-2e23a565d9a4';

/**
* @var array<string, string>
*/
protected const ERROR_NAMES = [
self::AFTER_ERROR => 'AFTER_ERROR',
];

/**
* @var array<string, string>
*/
protected static $errorNames = [
self::AFTER_ERROR => 'AFTER_ERROR',
];

public function __construct(mixed $value = null, string $propertyPath = null, string $message = 'This value should be before or equal {{ compared_value }}.', array $groups = null, mixed $payload = null, array $options = [])
{
parent::__construct(
$value,
$propertyPath,
$message,
$groups,
$payload,
$options
);
}
public $message = 'This value should be before or equal {{ compared_value }}.';
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class BeforeOrEqualValidator extends AbstractComparisonValidator
{
/**
* @param DateTime|Day|Month|Year $value1
* @param null|DateTime|Day|Month|Year $value2
* @param ?DateTime|?Day|?Month|?Year $value2
*
* @return bool
*/
Expand All @@ -28,7 +28,7 @@ protected function compareValues($value1, $value2) : bool
return false;
}

return $value1->isBeforeOrEqualTo($value2);
return $value1->isBeforeOrEqual($value2);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class BeforeValidator extends AbstractComparisonValidator
{
/**
* @param DateTime|Day|Month|Year $value1
* @param null|DateTime|Day|Month|Year $value2
* @param ?DateTime|?Day|?Month|?Year $value2
*
* @return bool
*/
Expand Down
Loading

0 comments on commit d2e49a2

Please sign in to comment.