diff --git a/.github/workflows/php_ci.yml b/.github/workflows/php_ci.yml index 1e8640390d..8a6eae3da7 100644 --- a/.github/workflows/php_ci.yml +++ b/.github/workflows/php_ci.yml @@ -11,8 +11,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.2'] - dependencies: ['latest', 'lowest'] + include: + - php: '8.2' + dependencies: 'lowest' + + - php: '8.4' + dependencies: 'latest' actions: - {name: composer, run: make check-composer} - {name: monorepo, run: make check-monorepo} diff --git a/.github/workflows/split_tests.yml b/.github/workflows/split_tests.yml index 7b4fbb3bca..6cda63bf97 100644 --- a/.github/workflows/split_tests.yml +++ b/.github/workflows/split_tests.yml @@ -57,8 +57,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.2'] - dependencies: ['latest', 'lowest'] + include: + - php: '8.2' + dependencies: 'lowest' + + - php: '8.4' + dependencies: 'latest' package: ${{ fromJson(needs.provide_packages_json.outputs.matrix) }} name: ${{ matrix.package.dir }} (${{ matrix.php }}${{ matrix.dependencies == 'lowest' && ' - lowest dependencies' || '' }}) diff --git a/composer.json b/composer.json index 92fc7f1bfd..f6d2bf2ac5 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-openssl": "*", "ext-pdo": "*", "ext-sodium": "*", - "api-platform/core": "^3.4.17 || ^4.2.1", + "api-platform/core": "^4.2.11", "async-aws/secrets-manager": "^2.5", "aws/aws-sdk-php": "^3.288.1", "bugsnag/bugsnag": "^3.29", @@ -36,36 +36,37 @@ "psr/cache": "^3.0", "psr/log": "^3.0", "spatie/url": "^2.2", - "symfony/cache": "^7.2", + "symfony/cache": "^7.4 || ^8.0", "symfony/cache-contracts": "^3.5", - "symfony/config": "^7.2", - "symfony/console": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/doctrine-bridge": "^7.2", - "symfony/error-handler": "^7.2", - "symfony/event-dispatcher": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/doctrine-bridge": "^7.4 || ^8.0", + "symfony/error-handler": "^7.4 || ^8.0", + "symfony/event-dispatcher": "^7.4 || ^8.0", "symfony/event-dispatcher-contracts": "^3.5", - "symfony/expression-language": "^7.2", - "symfony/filesystem": "^7.2", - "symfony/finder": "^7.2", - "symfony/framework-bundle": "^7.2", - "symfony/http-client": "^7.2", + "symfony/expression-language": "^7.4 || ^8.0", + "symfony/filesystem": "^7.4 || ^8.0", + "symfony/finder": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/http-client": "^7.4 || ^8.0", "symfony/http-client-contracts": "^3.5", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/lock": "^7.2", - "symfony/messenger": "^7.2", - "symfony/property-access": "^7.2", - "symfony/runtime": "^7.2", - "symfony/security-bundle": "^7.2", - "symfony/security-core": "^7.2", - "symfony/security-http": "^7.2", - "symfony/serializer": "^7.2", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/lock": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0", + "symfony/property-access": "^7.4 || ^8.0", + "symfony/property-info": "^7.4 || ^8.0", + "symfony/runtime": "^7.4 || ^8.0", + "symfony/security-bundle": "^7.4 || ^8.0", + "symfony/security-core": "^7.4 || ^8.0", + "symfony/security-http": "^7.4 || ^8.0", + "symfony/serializer": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5", - "symfony/string": "^7.2", - "symfony/translation": "^7.2", - "symfony/uid": "^7.2", - "symfony/var-dumper": "^7.2", + "symfony/string": "^7.4 || ^8.0", + "symfony/translation": "^7.4 || ^8.0", + "symfony/uid": "^7.4 || ^8.0", + "symfony/var-dumper": "^7.4 || ^8.0", "twig/twig": "^3.14.1" }, "require-dev": { @@ -95,13 +96,13 @@ "phpspec/prophecy-phpunit": "^2.0", "phpstan/phpstan": "^1.11", "psr-discovery/discovery": "^1.0.2", - "symfony/amazon-sqs-messenger": "^7.2", - "symfony/browser-kit": "^7.2", - "symfony/process": "^7.2", - "symfony/routing": "^7.2", - "symfony/twig-bundle": "^7.2", - "symfony/validator": "^7.2", - "symfony/yaml": "^7.2", + "symfony/amazon-sqs-messenger": "^7.4 || ^8.0", + "symfony/browser-kit": "^7.4 || ^8.0", + "symfony/process": "^7.4 || ^8.0", + "symfony/routing": "^7.4 || ^8.0", + "symfony/twig-bundle": "^7.4 || ^8.0", + "symfony/validator": "^7.4 || ^8.0", + "symfony/yaml": "^7.4 || ^8.0", "symplify/monorepo-builder": "^11.2.22" }, "autoload": { diff --git a/packages/EasyActivity/composer.json b/packages/EasyActivity/composer.json index ec0fe48c39..2fcaa204c1 100644 --- a/packages/EasyActivity/composer.json +++ b/packages/EasyActivity/composer.json @@ -11,20 +11,20 @@ "eonx-com/easy-doctrine": "^6.18", "eonx-com/easy-lock": "^6.18", "nesbot/carbon": "^3.8.4", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/event-dispatcher": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/messenger": "^7.2", - "symfony/property-access": "^7.2", - "symfony/serializer": "^7.2", - "symfony/uid": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/event-dispatcher": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0", + "symfony/property-access": "^7.4 || ^8.0", + "symfony/serializer": "^7.4 || ^8.0", + "symfony/uid": "^7.4 || ^8.0" }, "require-dev": { "doctrine/doctrine-bundle": "^2.12", "eonx-com/easy-test": "^6.18", "phpunit/phpunit": "^10.2|^11.4", - "symfony/framework-bundle": "^7.2" + "symfony/framework-bundle": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyApiPlatform/composer.json b/packages/EasyApiPlatform/composer.json index 071182b56e..173473fc90 100644 --- a/packages/EasyApiPlatform/composer.json +++ b/packages/EasyApiPlatform/composer.json @@ -5,20 +5,21 @@ "license": "MIT", "require": { "php": "^8.2", - "api-platform/core": "^3.4.17 || ^4.2.1", + "api-platform/core": "^4.2.11", "doctrine/collections": "^1.7.2 || ^2.1", "doctrine/dbal": "^3.8", "doctrine/orm": "^2.20", "doctrine/persistence": "^3.3", "nesbot/carbon": "^3.8.4", "psr/log": "^3.0", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/property-access": "^7.2", - "symfony/serializer": "^7.2", - "symfony/uid": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/property-access": "^7.4 || ^8.0", + "symfony/property-info": "^7.4 || ^8.0", + "symfony/serializer": "^7.4 || ^8.0", + "symfony/uid": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", @@ -28,13 +29,13 @@ "eonx-com/easy-test": "^6.18", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/browser-kit": "^7.2", - "symfony/expression-language": "^7.2", - "symfony/framework-bundle": "^7.2", - "symfony/http-client": "^7.2", - "symfony/security-bundle": "^7.2", - "symfony/twig-bundle": "^7.2", - "symfony/validator": "^7.2" + "symfony/browser-kit": "^7.4 || ^8.0", + "symfony/expression-language": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/http-client": "^7.4 || ^8.0", + "symfony/security-bundle": "^7.4 || ^8.0", + "symfony/twig-bundle": "^7.4 || ^8.0", + "symfony/validator": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyApiPlatform/src/Common/Filter/AdvancedSearchFilter.php b/packages/EasyApiPlatform/src/Common/Filter/AdvancedSearchFilter.php index d93365468d..5c6af97d6f 100644 --- a/packages/EasyApiPlatform/src/Common/Filter/AdvancedSearchFilter.php +++ b/packages/EasyApiPlatform/src/Common/Filter/AdvancedSearchFilter.php @@ -18,7 +18,6 @@ use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; use Doctrine\Persistence\ManagerRegistry; -use EonX\EasyApiPlatform\Common\IriConverter\IriConverterTrait; use Psr\Log\LoggerInterface; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\PropertyAccess\PropertyAccessorInterface; @@ -46,7 +45,6 @@ */ final class AdvancedSearchFilter extends AbstractFilter implements SearchFilterInterface { - use IriConverterTrait; use SearchFilterTrait; public const DOCTRINE_INTEGER_TYPE = Types::INTEGER; @@ -457,6 +455,11 @@ protected function getIdFromValue(string $value): mixed } } + protected function getIriConverter(): IriConverterInterface + { + return $this->iriConverter; + } + protected function getPropertyAccessor(): PropertyAccessorInterface { return $this->propertyAccessor; diff --git a/packages/EasyApiPlatform/src/Common/IriConverter/IriConverterTrait.php b/packages/EasyApiPlatform/src/Common/IriConverter/IriConverterTrait.php deleted file mode 100644 index a2bc4f0bae..0000000000 --- a/packages/EasyApiPlatform/src/Common/IriConverter/IriConverterTrait.php +++ /dev/null @@ -1,36 +0,0 @@ -iriConverter; - } - } -} else { - /** - * @mixin \EonX\EasyApiPlatform\Common\Filter\AdvancedSearchFilter - */ - trait IriConverterTrait - { - protected function getIriConverter(): LegacyIriConverterInterface|IriConverterInterface - { - return $this->iriConverter; - } - } -} diff --git a/packages/EasyApiPlatform/src/Common/Paginator/CustomPaginatorInterface.php b/packages/EasyApiPlatform/src/Common/Paginator/CustomPaginatorInterface.php index b0824eb7d4..54e1708580 100644 --- a/packages/EasyApiPlatform/src/Common/Paginator/CustomPaginatorInterface.php +++ b/packages/EasyApiPlatform/src/Common/Paginator/CustomPaginatorInterface.php @@ -3,7 +3,7 @@ namespace EonX\EasyApiPlatform\Common\Paginator; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; interface CustomPaginatorInterface { diff --git a/packages/EasyApiPlatform/src/Common/SerializerContextBuilder/SerializerContextBuilder.php b/packages/EasyApiPlatform/src/Common/SerializerContextBuilder/SerializerContextBuilder.php index 2c181831d4..b37337cd0a 100644 --- a/packages/EasyApiPlatform/src/Common/SerializerContextBuilder/SerializerContextBuilder.php +++ b/packages/EasyApiPlatform/src/Common/SerializerContextBuilder/SerializerContextBuilder.php @@ -4,72 +4,36 @@ namespace EonX\EasyApiPlatform\Common\SerializerContextBuilder; use ApiPlatform\Metadata\GetCollection; -use ApiPlatform\Serializer\SerializerContextBuilderInterface as LegacySerializerContextBuilderInterface; use ApiPlatform\State\SerializerContextBuilderInterface; use EonX\EasyApiPlatform\Common\Paginator\CustomPaginatorInterface; use Symfony\Component\HttpFoundation\Request; -// @todo Remove this class when dropping support for API Platform 3 -if (\interface_exists(LegacySerializerContextBuilderInterface::class)) { - final readonly class SerializerContextBuilder implements - SerializerContextBuilderInterface, - LegacySerializerContextBuilderInterface - { - public function __construct( - private SerializerContextBuilderInterface $decorated, - ) { - } - - public function createFromRequest( - Request $request, - bool $normalization, - ?array $extractedAttributes = null, - ): array { - $context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes); - $operation = $context['operation'] ?? null; - - // Customize context only for collection get - if ($operation instanceof GetCollection) { - $groups = (array)($context['groups'] ?? []); - - if (\in_array(CustomPaginatorInterface::SERIALIZER_GROUP, $groups, true) === false) { - $groups[] = CustomPaginatorInterface::SERIALIZER_GROUP; - } - - $context['groups'] = $groups; - } - - return $context; - } +final readonly class SerializerContextBuilder implements SerializerContextBuilderInterface +{ + public function __construct( + private SerializerContextBuilderInterface $decorated, + ) { } -} else { - final readonly class SerializerContextBuilder implements SerializerContextBuilderInterface - { - public function __construct( - private SerializerContextBuilderInterface $decorated, - ) { - } - public function createFromRequest( - Request $request, - bool $normalization, - ?array $extractedAttributes = null, - ): array { - $context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes); - $operation = $context['operation'] ?? null; + public function createFromRequest( + Request $request, + bool $normalization, + ?array $extractedAttributes = null, + ): array { + $context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes); + $operation = $context['operation'] ?? null; - // Customize context only for collection get - if ($operation instanceof GetCollection) { - $groups = (array)($context['groups'] ?? []); + // Customize context only for collection get + if ($operation instanceof GetCollection) { + $groups = (array)($context['groups'] ?? []); - if (\in_array(CustomPaginatorInterface::SERIALIZER_GROUP, $groups, true) === false) { - $groups[] = CustomPaginatorInterface::SERIALIZER_GROUP; - } - - $context['groups'] = $groups; + if (\in_array(CustomPaginatorInterface::SERIALIZER_GROUP, $groups, true) === false) { + $groups[] = CustomPaginatorInterface::SERIALIZER_GROUP; } - return $context; + $context['groups'] = $groups; } + + return $context; } } diff --git a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/AbstractApiPlatformSerializerExceptionErrorResponseBuilder.php b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/AbstractApiPlatformSerializerExceptionErrorResponseBuilder.php index 502e2f5097..cf349b8626 100644 --- a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/AbstractApiPlatformSerializerExceptionErrorResponseBuilder.php +++ b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/AbstractApiPlatformSerializerExceptionErrorResponseBuilder.php @@ -59,7 +59,9 @@ protected function buildViolationsForNotNormalizableValueException(NotNormalizab \preg_match(self::MESSAGE_PATTERN_CLASS, $throwable->getMessage(), $matches); if (isset($matches[1])) { - $path = $this->nameConverter->normalize((string)$path, (string)$matches[1]); + /** @var class-string $class */ + $class = (string)$matches[1]; + $path = $this->nameConverter->normalize((string)$path, $class); } return [ diff --git a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformCustomSerializerExceptionErrorResponseBuilder.php b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformCustomSerializerExceptionErrorResponseBuilder.php index 8824e08e35..c17bc9c377 100644 --- a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformCustomSerializerExceptionErrorResponseBuilder.php +++ b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformCustomSerializerExceptionErrorResponseBuilder.php @@ -58,6 +58,8 @@ protected function doBuildViolations(Throwable $throwable): array } /** + * @param class-string|null $class + * * @deprecated Deprecated since 6.4.0, will be moved to the parent class in 7.0 */ protected function normalizePropertyName(string $name, ?string $class = null): string @@ -66,7 +68,7 @@ protected function normalizePropertyName(string $name, ?string $class = null): s $mainRequest = $this->requestStack->getMainRequest(); if ($mainRequest !== null) { - /** @var string|null $apiResourceClass */ + /** @var class-string|null $apiResourceClass */ $apiResourceClass = $mainRequest->attributes->get('_api_resource_class'); $class = $apiResourceClass; } diff --git a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformTypeErrorExceptionErrorResponseBuilder.php b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformTypeErrorExceptionErrorResponseBuilder.php index dbd19e11d8..7d52c482ad 100644 --- a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformTypeErrorExceptionErrorResponseBuilder.php +++ b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformTypeErrorExceptionErrorResponseBuilder.php @@ -50,8 +50,10 @@ protected function doBuildViolations(Throwable $throwable): array $matches ) === 1 ) { + /** @var class-string $class */ + $class = $matches['class']; $violations = [ - $this->normalizePropertyName($matches['property'], $matches['class']) => [ + $this->normalizePropertyName($matches['property'], $class) => [ $this->translator->trans( 'violations.invalid_type', [ @@ -66,6 +68,8 @@ protected function doBuildViolations(Throwable $throwable): array } /** + * @param class-string|null $class + * * @deprecated Deprecated since 6.4.0, will be moved to the parent class in 7.0 */ protected function normalizePropertyName(string $name, ?string $class = null): string @@ -74,7 +78,7 @@ protected function normalizePropertyName(string $name, ?string $class = null): s $mainRequest = $this->requestStack->getMainRequest(); if ($mainRequest !== null) { - /** @var string|null $apiResourceClass */ + /** @var class-string|null $apiResourceClass */ $apiResourceClass = $mainRequest->attributes->get('_api_resource_class'); $class = $apiResourceClass; } diff --git a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformValidationExceptionErrorResponseBuilder.php b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformValidationExceptionErrorResponseBuilder.php index c8885a3d6d..6a47fee78a 100644 --- a/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformValidationExceptionErrorResponseBuilder.php +++ b/packages/EasyApiPlatform/src/EasyErrorHandler/Builder/ApiPlatformValidationExceptionErrorResponseBuilder.php @@ -79,6 +79,8 @@ protected function buildViolations(Throwable $throwable): array } /** + * @param class-string|null $class + * * @deprecated Deprecated since 6.4.0, will be moved to the parent class in 7.0 */ protected function normalizePropertyName(string $name, ?string $class = null): string @@ -87,7 +89,7 @@ protected function normalizePropertyName(string $name, ?string $class = null): s $mainRequest = $this->requestStack->getMainRequest(); if ($mainRequest !== null) { - /** @var string|null $apiResourceClass */ + /** @var class-string|null $apiResourceClass */ $apiResourceClass = $mainRequest->attributes->get('_api_resource_class'); $class = $apiResourceClass; } diff --git a/packages/EasyApiPlatform/tests/Application/src/EasyErrorHandler/Provider/ApiPlatformErrorResponseBuilderProviderTest.php b/packages/EasyApiPlatform/tests/Application/src/EasyErrorHandler/Provider/ApiPlatformErrorResponseBuilderProviderTest.php index f107796b9c..8d6cfb0d45 100644 --- a/packages/EasyApiPlatform/tests/Application/src/EasyErrorHandler/Provider/ApiPlatformErrorResponseBuilderProviderTest.php +++ b/packages/EasyApiPlatform/tests/Application/src/EasyErrorHandler/Provider/ApiPlatformErrorResponseBuilderProviderTest.php @@ -3,7 +3,6 @@ namespace EonX\EasyApiPlatform\Tests\Application\EasyErrorHandler\Provider; -use Composer\InstalledVersions; use EonX\EasyApiPlatform\Tests\Application\AbstractApplicationTestCase; use EonX\EasyApiPlatform\Tests\Fixture\App\EasyErrorHandler\Exception\DummyBException; use EonX\EasyErrorHandler\Common\Strategy\VerboseStrategyInterface; @@ -34,25 +33,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => "title: This value should not be blank.\ntitle: This value should not be null.", - 'version' => null, - ]; - - yield 'ValidationException when enum v3' => [ - 'url' => '/books', - 'json' => [ - 'description' => 'some description', - 'printingHouse' => '/printing-houses/1', - 'status' => 'some-non-existing-status', - 'weight' => 11, - ], - 'violations' => [ - 'status' => [ - 'The value should be a valid choice.', - ], - ], - 'exceptionMessage' => 'status: This value should be of type EonX\\EasyApiPlatform\\Tests\\Fixture\\App' . - '\\EasyErrorHandler\\Enum\\Status.', - 'version' => 3, ]; yield 'ValidationException when enum' => [ @@ -69,7 +49,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'status: This value should be of type int|string.', - 'version' => 4, ]; yield 'Carbon date with custom Normalizer is empty string' => [ @@ -85,7 +64,6 @@ public static function provideDataForBuildErrorResponse(): iterable 'This value is not a valid date/time.', ], 'exceptionMessage' => 'Custom message from custom CarbonNormalizer.', - 'version' => null, ]; yield 'Carbon date with custom Normalizer is NULL' => [ @@ -100,7 +78,6 @@ public static function provideDataForBuildErrorResponse(): iterable 'This value is not a valid date/time.', ], 'exceptionMessage' => 'Custom message from custom CarbonNormalizer.', - 'version' => null, ]; yield 'invalid Carbon date format with custom Normalizer' => [ @@ -115,7 +92,6 @@ public static function provideDataForBuildErrorResponse(): iterable 'This value is not a valid date/time.', ], 'exceptionMessage' => 'Custom message from custom CarbonNormalizer.', - 'version' => null, ]; yield 'invalid argument type' => [ @@ -132,7 +108,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'pageCount: This value should be of type int.', - 'version' => null, ]; yield 'NULL value' => [ @@ -149,27 +124,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'pageCount: This value should be of type int.', - 'version' => null, - ]; - - yield 'missing constructor argument v3' => [ - 'url' => '/books', - 'json' => [], - 'violations' => [ - 'description' => [ - 'This value should be of type string.', - ], - 'printingHouse' => [ - 'This value should be of type /printing-houses IRI.', - ], - 'weight' => [ - 'This value should be of type int.', - ], - ], - 'exceptionMessage' => "description: This value should be of type string.\nweight: This value should" . - " be of type int.\nprintingHouse: This value should be of type" . - " EonX\EasyApiPlatform\Tests\Fixture\App\EasyErrorHandler\ApiResource\PrintingHouse.", - 'version' => 3, ]; yield 'missing constructor argument' => [ @@ -188,23 +142,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], 'exceptionMessage' => "description: This value should be of type string.\nweight: This value should" . " be of type int.\nprintingHouse: This value should be of type PrintingHouse.", - 'version' => 4, - ]; - - yield 'invalid constructor Enum argument v3' => [ - 'url' => '/printing-houses', - 'json' => [ - 'name' => 'some name', - 'status' => 'some-non-existing-status', - ], - 'violations' => [ - 'status' => [ - 'The value should be a valid choice.', - ], - ], - 'exceptionMessage' => 'status: This value should be of type EonX\\EasyApiPlatform\\Tests\\Fixture\\App' . - '\\EasyErrorHandler\\Enum\\Status.', - 'version' => 3, ]; yield 'invalid constructor Enum argument' => [ @@ -219,7 +156,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'status: This value should be of type int|string.', - 'version' => 4, ]; yield 'missing constructor argument in DTO' => [ @@ -241,7 +177,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], 'exceptionMessage' => "author.name: This value should be of type string.\nauthor.age:" . ' This value should be of type int.', - 'version' => null, ]; yield 'invalid constructor argument type' => [ @@ -257,7 +192,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'weight: This value should be of type int.', - 'version' => null, ]; yield 'input data is misformatted when invalid argument in DTO' => [ @@ -272,7 +206,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'rank: This value should be of type int.', - 'version' => null, ]; yield 'missing constructor argument in DTO when input DTO' => [ @@ -286,26 +219,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'rank: This value should be of type int.', - 'version' => null, - ]; - - yield 'invalid IRI format v3' => [ - 'url' => '/books', - 'json' => [ - 'title' => 'some title', - 'description' => 'some description', - 'weight' => 11, - 'category' => 'some invalid IRI', - 'printingHouse' => '/printing-houses/1', - ], - 'violations' => [ - 'category' => [ - 'This value should be of type /book-categories IRI.', - ], - ], - 'exceptionMessage' => 'category: This value should be of type' . - ' EonX\\EasyApiPlatform\\Tests\\Fixture\\App\\EasyErrorHandler\\ApiResource\\Category.', - 'version' => 3, ]; yield 'invalid IRI format' => [ @@ -323,25 +236,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'category: This value should be of type Category.', - 'version' => 4, - ]; - - yield 'invalid IRI type when constructor parameter v3' => [ - 'url' => '/books', - 'json' => [ - 'title' => 'some title', - 'description' => 'some description', - 'weight' => 11, - 'printingHouse' => 'some string', - ], - 'violations' => [ - 'printingHouse' => [ - 'This value should be of type /printing-houses IRI.', - ], - ], - 'exceptionMessage' => 'printingHouse: This value should be of type' . - ' EonX\\EasyApiPlatform\\Tests\\Fixture\\App\\EasyErrorHandler\\ApiResource\\PrintingHouse.', - 'version' => 3, ]; yield 'invalid IRI type when constructor parameter' => [ @@ -358,7 +252,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'printingHouse: This value should be of type PrintingHouse.', - 'version' => 4, ]; yield 'invalid IRI type when input dto' => [ @@ -372,7 +265,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'payment: This value should be of type Payment.', - 'version' => 4, ]; yield 'item not found by IRI type when input dto' => [ @@ -386,7 +278,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'payment: This value should be of type Payment.', - 'version' => 4, ]; yield 'invalid IRI when input dto' => [ @@ -400,7 +291,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'payment: This value should be of type Payment.', - 'version' => 4, ]; yield 'different object IRI when constructor parameter' => [ @@ -420,7 +310,6 @@ public static function provideDataForBuildErrorResponse(): iterable '\\EasyErrorHandler\\ApiResource\\Book::__construct(): Argument #3 ($printingHouse) must be of type ' . 'EonX\\EasyApiPlatform\\Tests\\Fixture\\App\\EasyErrorHandler\\ApiResource\\PrintingHouse, ' . 'EonX\\EasyApiPlatform\\Tests\\Fixture\\App\\EasyErrorHandler\\ApiResource\\PublishingHouse given', - 'version' => null, ]; yield 'date is empty string' => [ @@ -437,7 +326,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'publishedAt: This value should be of type string.', - 'version' => null, ]; yield 'date is NULL' => [ @@ -454,7 +342,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'publishedAt: This value should be of type string.', - 'version' => null, ]; yield 'invalid date' => [ @@ -471,24 +358,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'publishedAt: This value should be of type string.', - 'version' => null, - ]; - - yield 'invalid date format v3' => [ - 'url' => '/books', - 'json' => [ - 'availableFrom' => '2024-04-22T01:01:00+11:00', - 'description' => 'some description', - 'printingHouse' => '/printing-houses/1', - 'weight' => 11, - ], - 'violations' => [ - 'availableFrom' => [ - 'This value is not a valid date/time.', - ], - ], - 'exceptionMessage' => 'availableFrom: This value should be of type string.', - 'version' => 3, ]; yield 'invalid date format' => [ @@ -505,7 +374,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'availableFrom: This value should be of type DateTimeImmutable|null.', - 'version' => 4, ]; yield 'date is empty string, when constructor parameter' => [ @@ -520,7 +388,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'publishedAt: This value should be of type string.', - 'version' => null, ]; yield 'date is NULL, when constructor parameter' => [ @@ -535,7 +402,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'publishedAt: This value should be of type string.', - 'version' => null, ]; yield 'invalid date, when constructor parameter' => [ @@ -550,7 +416,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'publishedAt: This value should be of type string.', - 'version' => null, ]; yield 'invalid date format, when constructor parameter' => [ @@ -565,7 +430,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'publishedAt: This value should be of type string.', - 'version' => null, ]; yield 'invalid constructor argument in DTO' => [ @@ -589,7 +453,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], 'exceptionMessage' => "author.name: This value should be of type string.\nauthor.age:" . ' This value should be of type int.', - 'version' => null, ]; yield 'invalid IRI type' => [ @@ -607,7 +470,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'category: This value should be of type array|string.', - 'version' => null, ]; yield 'null IRI when constructor parameter' => [ @@ -624,7 +486,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'printingHouse: This value should be of type array|string.', - 'version' => null, ]; yield 'nested document' => [ @@ -645,7 +506,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'category: This value should be of type array|string.', - 'version' => null, ]; yield 'missing constructor argument with serializedName attribute' => [ @@ -657,7 +517,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'paymentType: This value should be of type string.', - 'version' => null, ]; yield 'null constructor argument with serializedName attribute' => [ @@ -669,7 +528,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'paymentType: This value should be of type string.', - 'version' => null, ]; yield 'missing constructor argument in input DTO with serializedName attribute' => [ @@ -681,7 +539,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'paymentType: This value should be of type string.', - 'version' => null, ]; yield 'null constructor argument in input DTO with serializedName attribute' => [ @@ -693,25 +550,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'paymentType: This value should be of type string.', - 'version' => null, - ]; - - yield 'Item not found by IRI v3' => [ - 'url' => '/books', - 'json' => [ - 'description' => 'some description', - 'printingHouse' => '/printing-houses/2', - 'title' => 'some title', - 'weight' => 11, - ], - 'violations' => [ - 'printingHouse' => [ - 'Item not found for "/printing-houses/2".', - ], - ], - 'exceptionMessage' => 'printingHouse: This value should be of type ' . - 'EonX\\EasyApiPlatform\\Tests\\Fixture\\App\\EasyErrorHandler\\ApiResource\\PrintingHouse.', - 'version' => 3, ]; yield 'Item not found by IRI' => [ @@ -728,7 +566,6 @@ public static function provideDataForBuildErrorResponse(): iterable ], ], 'exceptionMessage' => 'printingHouse: This value should be of type PrintingHouse.', - 'version' => 4, ]; } @@ -795,23 +632,7 @@ public function testBuildErrorResponse( array $json, array $violations, string $exceptionMessage, - ?int $version = null, ): void { - if ($version !== null && \class_exists(InstalledVersions::class)) { - $installedVersion = InstalledVersions::getVersion('api-platform/core'); - - if ( - $installedVersion !== null - && ( - \version_compare($installedVersion, (string)$version, '>=') - && \version_compare($installedVersion, (string)($version + 1), '<') - ) === false - ) { - self::markTestSkipped( - 'This test requires API Platform version >=' . $version . ' and < ' . ($version + 1) . '.' - ); - } - } $response = self::$client->request('POST', $url, ['json' => $json]); $responseData = $response->toArray(false); @@ -876,23 +697,7 @@ public function testBuildExtendedErrorResponse( array $json, array $violations, string $exceptionMessage, - ?int $version = null, ): void { - if ($version !== null && \class_exists(InstalledVersions::class)) { - $installedVersion = InstalledVersions::getVersion('api-platform/core'); - - if ( - $installedVersion !== null - && ( - \version_compare($installedVersion, (string)$version, '>=') - && \version_compare($installedVersion, (string)($version + 1), '<') - ) === false - ) { - self::markTestSkipped( - 'This test requires API Platform version >=' . $version . ' and < ' . ($version + 1) . '.' - ); - } - } $chainVerboseStrategy = self::getService(VerboseStrategyInterface::class); self::setPrivatePropertyValue($chainVerboseStrategy, 'verbose', true); diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/DummyFriend.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/DummyFriend.php index 53b8d4d83d..277adbd40b 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/DummyFriend.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/DummyFriend.php @@ -7,7 +7,7 @@ use ApiPlatform\Metadata\ApiResource; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Validator\Constraints as Assert; #[ApiResource( diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/EmbeddableDummy.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/EmbeddableDummy.php index b20df4d7a5..f69bf4ea20 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/EmbeddableDummy.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/EmbeddableDummy.php @@ -6,7 +6,7 @@ use Carbon\CarbonImmutable; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Validator\Constraints as Assert; #[ORM\Embeddable] diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/FourthLevel.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/FourthLevel.php index 0569804cb8..cf4bd5b526 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/FourthLevel.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/FourthLevel.php @@ -6,7 +6,7 @@ use ApiPlatform\Metadata\ApiResource; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; #[ApiResource( openapi: false, diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ParentDummy.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ParentDummy.php index 3ea838f6da..e889a4440e 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ParentDummy.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ParentDummy.php @@ -5,7 +5,7 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; #[Orm\MappedSuperclass] abstract class ParentDummy diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedDummy.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedDummy.php index b36a9e8429..5cd7682cd3 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedDummy.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedDummy.php @@ -13,7 +13,7 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use EonX\EasyApiPlatform\Common\Filter\AdvancedSearchFilter; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Validator\Constraints as Assert; #[ApiResource( diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedToDummyFriend.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedToDummyFriend.php index 0eafe85c9c..f1b8caeb47 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedToDummyFriend.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/RelatedToDummyFriend.php @@ -7,7 +7,7 @@ use ApiPlatform\Metadata\ApiResource; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Validator\Constraints as Assert; #[ApiResource( diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ThirdLevel.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ThirdLevel.php index d2ea1337a9..f01b79f0e5 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ThirdLevel.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/ApiResource/ThirdLevel.php @@ -6,7 +6,7 @@ use ApiPlatform\Metadata\ApiResource; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; #[ApiResource( openapi: false, diff --git a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/NameConverter/CustomNameConverter.php b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/NameConverter/CustomNameConverter.php index 253a13f93d..e9b03a92b5 100644 --- a/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/NameConverter/CustomNameConverter.php +++ b/packages/EasyApiPlatform/tests/Fixture/app/src/AdvancedSearchFilter/NameConverter/CustomNameConverter.php @@ -11,13 +11,25 @@ */ final class CustomNameConverter extends CamelCaseToSnakeCaseNameConverter { - public function denormalize(string $propertyName): string - { - return $propertyName === 'name_converted' ? parent::denormalize($propertyName) : $propertyName; + public function denormalize( + string $propertyName, + ?string $class = null, + ?string $format = null, + ?array $context = null, + ): string { + return $propertyName === 'name_converted' + ? parent::denormalize($propertyName, $class, $format, $context ?? []) + : $propertyName; } - public function normalize(string $propertyName): string - { - return $propertyName === 'nameConverted' ? parent::normalize($propertyName) : $propertyName; + public function normalize( + string $propertyName, + ?string $class = null, + ?string $format = null, + ?array $context = null, + ): string { + return $propertyName === 'nameConverted' + ? parent::normalize($propertyName, $class, $format, $context ?? []) + : $propertyName; } } diff --git a/packages/EasyApiToken/composer.json b/packages/EasyApiToken/composer.json index d6f7d9df45..5330648a18 100644 --- a/packages/EasyApiToken/composer.json +++ b/packages/EasyApiToken/composer.json @@ -9,11 +9,11 @@ "eonx-com/easy-utils": "^6.18", "nette/utils": "^4.0", "psr/log": "^3.0", - "symfony/dependency-injection": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/security-bundle": "^7.2", - "symfony/security-http": "^7.2", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/security-bundle": "^7.4 || ^8.0", + "symfony/security-http": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5" }, "require-dev": { @@ -25,8 +25,8 @@ "phpseclib/phpseclib": "^3.0.36", "phpunit/phpunit": "^10.2|^11.4", "psr-discovery/discovery": "^1.0.2", - "symfony/cache": "^7.2", - "symfony/http-client": "^7.2" + "symfony/cache": "^7.4 || ^8.0", + "symfony/http-client": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyAsync/composer.json b/packages/EasyAsync/composer.json index facdb24cbc..bd119843f0 100644 --- a/packages/EasyAsync/composer.json +++ b/packages/EasyAsync/composer.json @@ -10,11 +10,11 @@ "doctrine/orm": "^2.20", "doctrine/persistence": "^3.3", "psr/log": "^3.0", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/event-dispatcher": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/messenger": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/event-dispatcher": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", @@ -24,8 +24,8 @@ "eonx-com/easy-random": "^6.18", "eonx-com/easy-test": "^6.18", "phpunit/phpunit": "^10.2|^11.4", - "symfony/doctrine-bridge": "^7.2", - "symfony/framework-bundle": "^7.2" + "symfony/doctrine-bridge": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyBatch/composer.json b/packages/EasyBatch/composer.json index 761428de26..375ac23283 100644 --- a/packages/EasyBatch/composer.json +++ b/packages/EasyBatch/composer.json @@ -13,10 +13,10 @@ "eonx-com/easy-random": "^6.18", "eonx-com/easy-utils": "^6.18", "nesbot/carbon": "^3.8.4", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/messenger": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0" }, "require-dev": { "eonx-com/easy-test": "^6.18", diff --git a/packages/EasyBugsnag/composer.json b/packages/EasyBugsnag/composer.json index e91783a499..eec20a5220 100644 --- a/packages/EasyBugsnag/composer.json +++ b/packages/EasyBugsnag/composer.json @@ -10,17 +10,17 @@ "guzzlehttp/guzzle": "^7.0", "nesbot/carbon": "^3.8.4", "nette/utils": "^4.0", - "symfony/cache": "^7.2", + "symfony/cache": "^7.4 || ^8.0", "symfony/cache-contracts": "^3.5", - "symfony/config": "^7.2", - "symfony/console": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/event-dispatcher": "^7.2", - "symfony/filesystem": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/messenger": "^7.2", - "symfony/var-dumper": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/event-dispatcher": "^7.4 || ^8.0", + "symfony/filesystem": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0", + "symfony/var-dumper": "^7.4 || ^8.0" }, "require-dev": { "doctrine/doctrine-bundle": "^2.12", @@ -29,8 +29,8 @@ "eonx-com/easy-test": "^6.18", "laravel/lumen-framework": "^11.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/doctrine-bridge": "^7.2", - "symfony/uid": "^7.2" + "symfony/doctrine-bridge": "^7.4 || ^8.0", + "symfony/uid": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyDecision/composer.json b/packages/EasyDecision/composer.json index 8aa623abf1..a44eca181f 100644 --- a/packages/EasyDecision/composer.json +++ b/packages/EasyDecision/composer.json @@ -7,12 +7,12 @@ "php": "^8.2", "eonx-com/easy-utils": "^6.18", "psr/cache": "^3.0", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/expression-language": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/messenger": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/expression-language": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0" }, "require-dev": { "laravel/lumen-framework": "^11.0", diff --git a/packages/EasyDoctrine/composer.json b/packages/EasyDoctrine/composer.json index a57affd043..bbe1892572 100644 --- a/packages/EasyDoctrine/composer.json +++ b/packages/EasyDoctrine/composer.json @@ -17,10 +17,10 @@ "myclabs/deep-copy": "^1.11", "nesbot/carbon": "^3.8.4", "symfony/cache-contracts": "^3.5", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/doctrine-bridge": "^7.2", - "symfony/http-kernel": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/doctrine-bridge": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5" }, "require-dev": { diff --git a/packages/EasyEncryption/composer.json b/packages/EasyEncryption/composer.json index 9dc1fd0bad..78174c0727 100644 --- a/packages/EasyEncryption/composer.json +++ b/packages/EasyEncryption/composer.json @@ -8,17 +8,17 @@ "ext-sodium": "*", "eonx-com/easy-utils": "^6.18", "paragonie/halite": "^5.1", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-kernel": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0" }, "require-dev": { "aws/aws-sdk-php": "^3.288.1", "eonx-com/easy-test": "^6.18", "laravel/lumen-framework": "^11.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/filesystem": "^7.2", - "symfony/process": "^7.2" + "symfony/filesystem": "^7.4 || ^8.0", + "symfony/process": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyErrorHandler/composer.json b/packages/EasyErrorHandler/composer.json index b55e399554..a9c8c660f9 100644 --- a/packages/EasyErrorHandler/composer.json +++ b/packages/EasyErrorHandler/composer.json @@ -9,17 +9,17 @@ "eonx-com/easy-utils": "^6.18", "nesbot/carbon": "^3.8.4", "nikic/php-parser": "^5.0", - "symfony/config": "^7.2", - "symfony/console": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/error-handler": "^7.2", - "symfony/finder": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/property-access": "^7.2", - "symfony/serializer": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/error-handler": "^7.4 || ^8.0", + "symfony/finder": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/property-access": "^7.4 || ^8.0", + "symfony/serializer": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5", - "symfony/translation": "^7.2" + "symfony/translation": "^7.4 || ^8.0" }, "require-dev": { "eonx-com/easy-bugsnag": "^6.18", @@ -27,7 +27,7 @@ "eonx-com/easy-webhook": "^6.18", "laravel/lumen-framework": "^11.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/framework-bundle": "^7.2" + "symfony/framework-bundle": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyEventDispatcher/composer.json b/packages/EasyEventDispatcher/composer.json index 919ccd1593..19e4506091 100644 --- a/packages/EasyEventDispatcher/composer.json +++ b/packages/EasyEventDispatcher/composer.json @@ -5,15 +5,15 @@ "license": "MIT", "require": { "php": "^8.2", - "symfony/dependency-injection": "^7.2", + "symfony/dependency-injection": "^7.4 || ^8.0", "symfony/event-dispatcher-contracts": "^3.5", - "symfony/http-kernel": "^7.2" + "symfony/http-kernel": "^7.4 || ^8.0" }, "require-dev": { "eonx-com/easy-test": "^6.18", "laravel/lumen-framework": "^11.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/config": "^7.2" + "symfony/config": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyHttpClient/composer.json b/packages/EasyHttpClient/composer.json index 60c3a6398f..7cf6434cd8 100644 --- a/packages/EasyHttpClient/composer.json +++ b/packages/EasyHttpClient/composer.json @@ -8,11 +8,11 @@ "eonx-com/easy-event-dispatcher": "^6.18", "eonx-com/easy-utils": "^6.18", "nesbot/carbon": "^3.8.4", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-client": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-client": "^7.4 || ^8.0", "symfony/http-client-contracts": "^3.5", - "symfony/http-kernel": "^7.2", + "symfony/http-kernel": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5" }, "require-dev": { @@ -27,8 +27,8 @@ "laravel/lumen-framework": "^11.0", "mockery/mockery": "^1.6", "phpunit/phpunit": "^10.2|^11.4", - "symfony/amazon-sqs-messenger": "^7.2", - "symfony/doctrine-bridge": "^7.2", + "symfony/amazon-sqs-messenger": "^7.4 || ^8.0", + "symfony/doctrine-bridge": "^7.4 || ^8.0", "symfony/event-dispatcher-contracts": "^3.5" }, "autoload": { diff --git a/packages/EasyLock/composer.json b/packages/EasyLock/composer.json index 05664253cd..654ab6f9c9 100644 --- a/packages/EasyLock/composer.json +++ b/packages/EasyLock/composer.json @@ -6,11 +6,11 @@ "require": { "php": "^8.2", "psr/log": "^3.0", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/lock": "^7.2", - "symfony/messenger": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/lock": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5" }, "require-dev": { diff --git a/packages/EasyLogging/composer.json b/packages/EasyLogging/composer.json index eb031d7600..0308b61447 100644 --- a/packages/EasyLogging/composer.json +++ b/packages/EasyLogging/composer.json @@ -7,9 +7,9 @@ "php": "^8.2", "eonx-com/easy-utils": "^6.18", "monolog/monolog": "^3.7", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-kernel": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5" }, "require-dev": { diff --git a/packages/EasyNotification/composer.json b/packages/EasyNotification/composer.json index 9fb800a2a7..bd604abf42 100644 --- a/packages/EasyNotification/composer.json +++ b/packages/EasyNotification/composer.json @@ -8,14 +8,14 @@ "aws/aws-sdk-php": "^3.288.1", "eonx-com/easy-utils": "^6.18", "nette/utils": "^4.0", - "symfony/cache": "^7.2", + "symfony/cache": "^7.4 || ^8.0", "symfony/cache-contracts": "^3.5", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-client": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-client": "^7.4 || ^8.0", "symfony/http-client-contracts": "^3.5", - "symfony/http-kernel": "^7.2", - "symfony/uid": "^7.2" + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/uid": "^7.4 || ^8.0" }, "require-dev": { "laravel/lumen-framework": "^11.0", diff --git a/packages/EasyPagination/composer.json b/packages/EasyPagination/composer.json index e7668cc754..56eb847309 100644 --- a/packages/EasyPagination/composer.json +++ b/packages/EasyPagination/composer.json @@ -10,18 +10,18 @@ "doctrine/orm": "^2.20", "eonx-com/easy-utils": "^6.18", "spatie/url": "^2.2", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/string": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/string": "^7.4 || ^8.0" }, "require-dev": { "doctrine/doctrine-bundle": "^2.12", "laravel/lumen-framework": "^11.0", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/uid": "^7.2" + "symfony/uid": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyRandom/composer.json b/packages/EasyRandom/composer.json index 805a5a9f79..4c614f2274 100644 --- a/packages/EasyRandom/composer.json +++ b/packages/EasyRandom/composer.json @@ -5,17 +5,17 @@ "license": "MIT", "require": { "php": "^8.2", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/string": "^7.2", - "symfony/uid": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/string": "^7.4 || ^8.0", + "symfony/uid": "^7.4 || ^8.0" }, "require-dev": { "eonx-com/easy-test": "^6.18", "laravel/lumen-framework": "^11.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/framework-bundle": "^7.2" + "symfony/framework-bundle": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyRequestId/composer.json b/packages/EasyRequestId/composer.json index 4e6ec09f3f..df46e06882 100644 --- a/packages/EasyRequestId/composer.json +++ b/packages/EasyRequestId/composer.json @@ -6,11 +6,11 @@ "require": { "php": "^8.2", "eonx-com/easy-random": "^6.18", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/messenger": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5" }, "require-dev": { diff --git a/packages/EasySchedule/composer.json b/packages/EasySchedule/composer.json index c26dabb784..20e8d46b68 100644 --- a/packages/EasySchedule/composer.json +++ b/packages/EasySchedule/composer.json @@ -10,11 +10,11 @@ "eonx-com/easy-lock": "^6.18", "eonx-com/easy-utils": "^6.18", "nesbot/carbon": "^3.8.4", - "symfony/config": "^7.2", - "symfony/console": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0" }, "require-dev": { "phpspec/prophecy-phpunit": "^2.0", diff --git a/packages/EasySecurity/composer.json b/packages/EasySecurity/composer.json index ad5cd6b697..c2d542ab6e 100644 --- a/packages/EasySecurity/composer.json +++ b/packages/EasySecurity/composer.json @@ -8,16 +8,16 @@ "eonx-com/easy-api-token": "^6.18", "eonx-com/easy-utils": "^6.18", "nette/utils": "^4.0", - "symfony/cache": "^7.2", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/expression-language": "^7.2", - "symfony/framework-bundle": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/routing": "^7.2", - "symfony/security-core": "^7.2", - "symfony/security-http": "^7.2" + "symfony/cache": "^7.4 || ^8.0", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/expression-language": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/routing": "^7.4 || ^8.0", + "symfony/security-core": "^7.4 || ^8.0", + "symfony/security-http": "^7.4 || ^8.0" }, "require-dev": { "eonx-com/easy-bugsnag": "^6.18", diff --git a/packages/EasySecurity/src/SymfonySecurity/Voter/PermissionVoter.php b/packages/EasySecurity/src/SymfonySecurity/Voter/PermissionVoter.php index 155504d8c4..608e2bdb12 100644 --- a/packages/EasySecurity/src/SymfonySecurity/Voter/PermissionVoter.php +++ b/packages/EasySecurity/src/SymfonySecurity/Voter/PermissionVoter.php @@ -5,6 +5,7 @@ use EonX\EasySecurity\Common\Resolver\SecurityContextResolverInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; +use Symfony\Component\Security\Core\Authorization\Voter\Vote; use Symfony\Component\Security\Core\Authorization\Voter\Voter; /** @@ -25,8 +26,12 @@ protected function supports(string $attribute, mixed $subject): bool ->isPermission($attribute); } - protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool - { + protected function voteOnAttribute( + string $attribute, + mixed $subject, + TokenInterface $token, + ?Vote $vote = null, + ): bool { return $this->securityContextResolver ->resolveContext() ->hasPermission($attribute); diff --git a/packages/EasySecurity/src/SymfonySecurity/Voter/ProviderVoter.php b/packages/EasySecurity/src/SymfonySecurity/Voter/ProviderVoter.php index f858f8b02e..ffd354cdb8 100644 --- a/packages/EasySecurity/src/SymfonySecurity/Voter/ProviderVoter.php +++ b/packages/EasySecurity/src/SymfonySecurity/Voter/ProviderVoter.php @@ -6,6 +6,7 @@ use EonX\EasySecurity\Common\Resolver\SecurityContextResolverInterface; use InvalidArgumentException; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; +use Symfony\Component\Security\Core\Authorization\Voter\Vote; use Symfony\Component\Security\Core\Authorization\Voter\Voter; /** @@ -27,8 +28,12 @@ protected function supports(string $attribute, mixed $subject): bool return $subject->getRestrictedProviderUniqueId() !== null; } - protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool - { + protected function voteOnAttribute( + string $attribute, + mixed $subject, + TokenInterface $token, + ?Vote $vote = null, + ): bool { if ($subject instanceof ProviderRestrictedInterface === false) { throw new InvalidArgumentException(\sprintf( 'Subject must be instance of "%s", "%s" given.', diff --git a/packages/EasySecurity/src/SymfonySecurity/Voter/RoleVoter.php b/packages/EasySecurity/src/SymfonySecurity/Voter/RoleVoter.php index 0601b023f7..04aaa24619 100644 --- a/packages/EasySecurity/src/SymfonySecurity/Voter/RoleVoter.php +++ b/packages/EasySecurity/src/SymfonySecurity/Voter/RoleVoter.php @@ -5,6 +5,7 @@ use EonX\EasySecurity\Common\Resolver\SecurityContextResolverInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; +use Symfony\Component\Security\Core\Authorization\Voter\Vote; use Symfony\Component\Security\Core\Authorization\Voter\Voter; /** @@ -25,8 +26,12 @@ protected function supports(string $attribute, mixed $subject): bool ->isRole($attribute); } - protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool - { + protected function voteOnAttribute( + string $attribute, + mixed $subject, + TokenInterface $token, + ?Vote $vote = null, + ): bool { return $this->securityContextResolver ->resolveContext() ->hasRole($attribute); diff --git a/packages/EasyServerless/composer.json b/packages/EasyServerless/composer.json index 6d7d96ed32..9ce94b7689 100644 --- a/packages/EasyServerless/composer.json +++ b/packages/EasyServerless/composer.json @@ -18,8 +18,8 @@ "laravel/lumen-framework": "^11.0", "monolog/monolog": "^3.7", "phpunit/phpunit": "^10.2|^11.4", - "symfony/cache": "^7.2", - "symfony/http-kernel": "^7.2", + "symfony/cache": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", "symfony/polyfill-uuid": "^1.31" }, "conflict": { diff --git a/packages/EasyServerless/src/Aws/Helper/SecretsHelper.php b/packages/EasyServerless/src/Aws/Helper/SecretsHelper.php index 4730d1a71b..8dabd4b266 100644 --- a/packages/EasyServerless/src/Aws/Helper/SecretsHelper.php +++ b/packages/EasyServerless/src/Aws/Helper/SecretsHelper.php @@ -107,8 +107,10 @@ public static function loadFromSecretsManager(string $paramName): void ->getSecretValue($input) ->getSecretString(); - if (\json_validate($value ?? '')) { - self::doLoad((array)\json_decode($value ?? '{}', true)); + $value = \json_decode($value ?? '', true); + + if (\is_array($value)) { + self::doLoad($value); } } } diff --git a/packages/EasySwoole/composer.json b/packages/EasySwoole/composer.json index 4c2270312b..a9e2d47ecb 100644 --- a/packages/EasySwoole/composer.json +++ b/packages/EasySwoole/composer.json @@ -9,24 +9,24 @@ "eonx-com/easy-utils": "^6.18", "nesbot/carbon": "^3.8.4", "openswoole/core": "^22.1", - "symfony/cache": "^7.2", + "symfony/cache": "^7.4 || ^8.0", "symfony/cache-contracts": "^3.5", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/filesystem": "^7.2", - "symfony/framework-bundle": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/runtime": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/filesystem": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/runtime": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5", - "symfony/string": "^7.2" + "symfony/string": "^7.4 || ^8.0" }, "require-dev": { "eonx-com/easy-bugsnag": "^6.18", "eonx-com/easy-logging": "^6.18", "openswoole/ide-helper": "^22.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/twig-bundle": "^7.2" + "symfony/twig-bundle": "^7.4 || ^8.0" }, "autoload": { "files": [ diff --git a/packages/EasyTemplatingBlock/composer.json b/packages/EasyTemplatingBlock/composer.json index 731fbe23d5..1063d1e661 100644 --- a/packages/EasyTemplatingBlock/composer.json +++ b/packages/EasyTemplatingBlock/composer.json @@ -6,9 +6,9 @@ "require": { "php": "^8.2", "eonx-com/easy-utils": "^6.18", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-kernel": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", "twig/twig": "^3.14.1" }, "require-dev": { diff --git a/packages/EasyTest/composer.json b/packages/EasyTest/composer.json index 07b19463a9..5c18edb399 100644 --- a/packages/EasyTest/composer.json +++ b/packages/EasyTest/composer.json @@ -8,17 +8,17 @@ "eonx-com/easy-utils": "^6.18", "nette/utils": "^4.0", "phpunit/phpunit": "^10.2|^11.4", - "symfony/config": "^7.2", - "symfony/console": "^7.2", - "symfony/dependency-injection": "^7.2", + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", "symfony/event-dispatcher-contracts": "^3.5", - "symfony/http-client": "^7.2", - "symfony/http-kernel": "^7.2", + "symfony/http-client": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", "symfony/service-contracts": "^3.5", "symfony/translation-contracts": "^3.5" }, "require-dev": { - "symfony/uid": "^7.2" + "symfony/uid": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyTest/src/InvalidData/Maker/InvalidDataMaker.php b/packages/EasyTest/src/InvalidData/Maker/InvalidDataMaker.php index 093b0a942c..a0015034fa 100644 --- a/packages/EasyTest/src/InvalidData/Maker/InvalidDataMaker.php +++ b/packages/EasyTest/src/InvalidData/Maker/InvalidDataMaker.php @@ -38,11 +38,14 @@ */ class InvalidDataMaker extends AbstractInvalidDataMaker { + /** + * @param int<0, max> $minElements + */ public function yieldArrayCollectionWithFewerItems(int $minElements): iterable { $value = new ArrayCollection(\array_fill(0, $minElements - 1, null)); $message = $this->translateMessage( - (new Count(['min' => $minElements]))->minMessage, + (new Count(min: $minElements))->minMessage, [ '{{ limit }}' => $minElements, ], @@ -52,11 +55,14 @@ public function yieldArrayCollectionWithFewerItems(int $minElements): iterable yield from $this->create("{$this->property} has too few elements in the collection", $value, $message); } + /** + * @param int<0, max> $maxElements + */ public function yieldArrayCollectionWithMoreItems(int $maxElements): iterable { $value = new ArrayCollection(\array_fill(0, $maxElements - 1, null)); $message = $this->translateMessage( - (new Count(['max' => $maxElements]))->maxMessage, + (new Count(max: $maxElements))->maxMessage, [ '{{ limit }}' => $maxElements, ], @@ -66,11 +72,14 @@ public function yieldArrayCollectionWithMoreItems(int $maxElements): iterable yield from $this->create("{$this->property} has too many elements in the collection", $value, $message); } + /** + * @param int<0, max> $minElements + */ public function yieldArrayWithFewerItems(int $minElements): iterable { $value = \array_fill(0, $minElements - 1, null); $message = $this->translateMessage( - (new Count(['min' => $minElements]))->minMessage, + (new Count(min: $minElements))->minMessage, [ '{{ limit }}' => $minElements, ], @@ -80,11 +89,14 @@ public function yieldArrayWithFewerItems(int $minElements): iterable yield from $this->create("{$this->property} has too few elements in the array", $value, $message); } + /** + * @param int<0, max> $maxElements + */ public function yieldArrayWithMoreItems(int $maxElements, mixed $itemValue = null): iterable { $value = \array_fill(0, $maxElements + 1, $itemValue); $message = $this->translateMessage( - (new Count(['max' => $maxElements]))->maxMessage, + (new Count(max: $maxElements))->maxMessage, [ '{{ limit }}' => $maxElements, ], @@ -287,13 +299,13 @@ public function yieldInvalidEmail(): iterable yield from $this->create("{$this->property} is invalid email", $value, $message); } + /** + * @param int<1, max> $exactLength + */ public function yieldInvalidExactLengthString(int $exactLength): iterable { $message = $this->translateMessage( - (new Length([ - 'max' => $exactLength, - 'min' => $exactLength, - ]))->exactMessage, + (new Length(min: $exactLength, max: $exactLength))->exactMessage, ['{{ limit }}' => $exactLength], $exactLength ); @@ -429,11 +441,14 @@ public function yieldOutOfRangeNumber(int $min, int $max): iterable yield from $this->create("{$this->property} is out of range (below)", $value, $message); } + /** + * @param int<1, max> $maxLength + */ public function yieldTooLongString(int $maxLength): iterable { $value = \str_pad('g', $maxLength + 1, 'g'); $message = $this->translateMessage( - (new Length(['max' => $maxLength]))->maxMessage, + (new Length(max: $maxLength))->maxMessage, [ '{{ limit }}' => $maxLength, ], @@ -443,11 +458,14 @@ public function yieldTooLongString(int $maxLength): iterable yield from $this->create("{$this->property} is too long", $value, $message); } + /** + * @param int<0, max> $minLength + */ public function yieldTooShortString(int $minLength): iterable { $value = $minLength > 1 ? \str_pad('g', $minLength - 1, 'g') : ''; $message = $this->translateMessage( - (new Length(['min' => $minLength]))->minMessage, + (new Length(min: $minLength))->minMessage, [ '{{ limit }}' => $minLength, ], diff --git a/packages/EasyUtils/composer.json b/packages/EasyUtils/composer.json index 038b851605..e56093c347 100644 --- a/packages/EasyUtils/composer.json +++ b/packages/EasyUtils/composer.json @@ -8,19 +8,19 @@ "ext-bcmath": "*", "ext-ctype": "*", "ext-filter": "*", - "symfony/config": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/framework-bundle": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/string": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/string": "^7.4 || ^8.0" }, "require-dev": { "eonx-com/easy-test": "^6.18", "laravel/lumen-framework": "^11.0", "mockery/mockery": "^1.6", "phpunit/phpunit": "^10.2|^11.4", - "symfony/serializer": "^7.2", - "symfony/validator": "^7.2" + "symfony/serializer": "^7.4 || ^8.0", + "symfony/validator": "^7.4 || ^8.0" }, "autoload": { "psr-4": { diff --git a/packages/EasyUtils/src/Math/Constraint/AbstractNumberComparison.php b/packages/EasyUtils/src/Math/Constraint/AbstractNumberComparison.php index a817d723f0..e9227e7219 100644 --- a/packages/EasyUtils/src/Math/Constraint/AbstractNumberComparison.php +++ b/packages/EasyUtils/src/Math/Constraint/AbstractNumberComparison.php @@ -11,16 +11,15 @@ abstract class AbstractNumberComparison extends AbstractComparison public function __construct( mixed $value = null, - mixed $payload = null, + ?string $propertyPath = null, + ?string $message = null, ?array $groups = null, - ?array $options = null, + mixed $payload = null, ?bool $isMoney = null, - ?string $message = null, - ?string $propertyPath = null, ) { $this->isMoney = $isMoney ?? true; - parent::__construct($value, $propertyPath, $message, $groups, $payload, $options ?? []); + parent::__construct($value, $propertyPath, $message, $groups, $payload); } public function validatedBy(): string diff --git a/packages/EasyWebhook/composer.json b/packages/EasyWebhook/composer.json index ef47b4a40d..66baeb8654 100644 --- a/packages/EasyWebhook/composer.json +++ b/packages/EasyWebhook/composer.json @@ -12,13 +12,13 @@ "eonx-com/easy-utils": "^6.18", "nesbot/carbon": "^3.8.4", "nette/utils": "^4.0", - "symfony/config": "^7.2", - "symfony/console": "^7.2", - "symfony/dependency-injection": "^7.2", - "symfony/http-client": "^7.2", - "symfony/http-foundation": "^7.2", - "symfony/http-kernel": "^7.2", - "symfony/messenger": "^7.2" + "symfony/config": "^7.4 || ^8.0", + "symfony/console": "^7.4 || ^8.0", + "symfony/dependency-injection": "^7.4 || ^8.0", + "symfony/http-client": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/messenger": "^7.4 || ^8.0" }, "require-dev": { "doctrine/dbal": "^3.8", diff --git a/quality/ecs.php b/quality/ecs.php index aba34b341e..b6d585da39 100644 --- a/quality/ecs.php +++ b/quality/ecs.php @@ -112,6 +112,7 @@ NoExtraBlankLinesFixer::class => [ 'packages/EasyTest/.phpstorm.meta.php', ], + 'packages/*/config/reference.php', 'packages/*/var/*', 'packages/*/vendor/*', PhpdocAlignFixer::class => [ diff --git a/quality/rector.php b/quality/rector.php index 91f5af9af1..5c6f23522e 100644 --- a/quality/rector.php +++ b/quality/rector.php @@ -51,6 +51,7 @@ 'packages/EasyLock/tests/Fixture/config/in_memory_connection.php', 'packages/EasyPagination/tests/Stub/Kernel/KernelStub.php', ], + 'packages/*/config/reference.php', 'packages/*/var/*', 'packages/*/vendor/*', ReadOnlyPropertyRector::class => [