diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2907461..446d160 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,7 +41,7 @@ jobs: - name: 'Setup PHP' uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 ini-values: memory_limit=-1 coverage: none tools: composer:v2 @@ -66,7 +66,7 @@ jobs: - name: 'Setup PHP' uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 ini-values: memory_limit=-1 coverage: none tools: composer:v2 @@ -86,17 +86,13 @@ jobs: fail-fast: false matrix: php-version: - - '7.3' - - '7.4' - '8.0' - '8.1' + - '8.2' symfony-version: - - '5.0' - - '5.1' - - '5.2' - - '5.3' - - '5.4' - '6.0' + - '6.1' + - '6.2' steps: - name: 'Checkout Code' uses: actions/checkout@v2 @@ -131,7 +127,7 @@ jobs: - name: 'Setup PHP' uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 ini-values: memory_limit=-1 coverage: pcov tools: composer:v2 diff --git a/EventListener/JmsSerializerSubscriber.php b/EventListener/JmsSerializerSubscriber.php index 5976389..e8bbd7e 100644 --- a/EventListener/JmsSerializerSubscriber.php +++ b/EventListener/JmsSerializerSubscriber.php @@ -18,6 +18,7 @@ use Fresh\VichUploaderSerializationBundle\Annotation\VichSerializableClass; use Fresh\VichUploaderSerializationBundle\Annotation\VichSerializableField; use Fresh\VichUploaderSerializationBundle\Exception\IncompatibleUploadableAndSerializableFieldAnnotationException; +use Generator; use JMS\Serializer\EventDispatcher\Events; use JMS\Serializer\EventDispatcher\EventSubscriberInterface; use JMS\Serializer\EventDispatcher\ObjectEvent; @@ -74,9 +75,9 @@ public function __construct(StorageInterface $storage, RequestContext $requestCo } /** - * @return iterable|array[] + * @return array, array> */ - public static function getSubscribedEvents(): iterable + public static function getSubscribedEvents(): Generator { yield ['event' => Events::PRE_SERIALIZE, 'method' => 'onPreSerialize']; yield ['event' => Events::POST_SERIALIZE, 'method' => 'onPostSerialize']; diff --git a/LICENSE b/LICENSE index 69fe62a..c51384e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2021 Artem Henvald +Copyright (c) 2015-2023 Artem Henvald Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md index 4effafc..776fd44 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [JMSSerializerBundle](https://github.com/schmittjoh/JMSSerializerBundle "JMSSerializerBundle"). Allows to generate full or relative URIs to entity fields mapped with `@Vich` and `@JMS` annotations during the serialization. -[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/fre5h/VichUploaderSerializationBundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/fre5h/VichUploaderSerializationBundle/) -[![Build Status](https://img.shields.io/github/workflow/status/fre5h/VichUploaderSerializationBundle/CI/main?style=flat-square)](https://github.com/fre5h/VichUploaderSerializationBundle/actions?query=workflow%3ACI+branch%3Amain+) +[![Scrutinizer Quality Score](https://img.shields.io/github/actions/workflow/status/fre5h/VichUploaderSerializationBundle/ci.yaml?branch=main&style=flat-square)](https://scrutinizer-ci.com/g/fre5h/VichUploaderSerializationBundle/) +[![Build Status](https://img.shields.io/github/actions/workflow/status/fre5h/VichUploaderSerializationBundle/ci.yaml?branch=main&style=flat-square)](https://github.com/fre5h/VichUploaderSerializationBundle/actions?query=workflow%3ACI+branch%3Amain+) [![CodeCov](https://img.shields.io/codecov/c/github/fre5h/VichUploaderSerializationBundle.svg?style=flat-square)](https://codecov.io/github/fre5h/VichUploaderSerializationBundle) [![License](https://img.shields.io/packagist/l/fresh/vich-uploader-serialization-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/vich-uploader-serialization-bundle) [![Latest Stable Version](https://img.shields.io/packagist/v/fresh/vich-uploader-serialization-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/vich-uploader-serialization-bundle) @@ -15,12 +15,12 @@ Allows to generate full or relative URIs to entity fields mapped with `@Vich` an ## Requirements 🧐 -* PHP 7.3, 7.4, 8.0, 8.1 -* Symfony 5.0, 5.1, 5.2, 5.3, 5.4, 6.0 +* PHP >=8.0 +* Symfony >= 6.0 ## Installation 🌱 -```composer req fresh/vich-uploader-serialization-bundle='~3.2'``` +```composer req fresh/vich-uploader-serialization-bundle='~3.3'``` ## Usage 🧑‍🎓 diff --git a/composer.json b/composer.json index b471953..5532ef7 100644 --- a/composer.json +++ b/composer.json @@ -22,25 +22,26 @@ "issues": "https://github.com/fre5h/VichUploaderSerializationBundle/issues" }, "require": { - "php": ">=7.3.0", - "doctrine/cache": "^1.11", - "doctrine/common": "^2.11|^3.0", - "doctrine/persistence": "^1.3|^2.0", - "jms/serializer-bundle": "^3.7", - "monolog/monolog": "^2.0", - "symfony/config": "^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/property-access": "^5.0", - "symfony/routing": "^5.0", - "vich/uploader-bundle": "^1.16" + "php": ">=8.0.0", + "doctrine/cache": "^2.1", + "doctrine/common": "^3.2", + "doctrine/persistence": "2.2", + "jms/serializer-bundle": "^5.0", + "monolog/monolog": "^2.3", + "symfony/config": "^6.0", + "symfony/dependency-injection": "^6.0", + "symfony/property-access": "^6.0", + "symfony/routing": "^6.0", + "vich/uploader-bundle": "^1.18" }, "require-dev": { "escapestudios/symfony2-coding-standard": "^3.12", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-doctrine":"^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan": "^1.2", + "phpstan/phpstan-doctrine": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-symfony": "^1.0", "phpunit/phpunit": "^9.5", - "symfony/yaml": "^5.0" + "symfony/yaml": "^6.0" }, "autoload": { "psr-4": { diff --git a/phpstan.neon b/phpstan.neon index b47882e..0815614 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,10 +2,13 @@ includes: - 'vendor/phpstan/phpstan-phpunit/extension.neon' - 'vendor/phpstan/phpstan-phpunit/rules.neon' - 'vendor/phpstan/phpstan-doctrine/extension.neon' + - 'vendor/phpstan/phpstan-symfony/extension.neon' parameters: - level: 8 - excludes_analyse: + level: 9 + excludePaths: - '%rootDir%/../../../Tests/*' - '%rootDir%/../../../vendor/*' + - './vendor/*' fileExtensions: - 'php' + checkGenericClassInNonGenericObjectType: false