diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 498a7ca7..bb318e00 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,7 +14,7 @@ jobs: name: "PHPUnit" uses: "doctrine/.github/.github/workflows/continuous-integration.yml@12.1.0" with: - php-versions: '["8.1", "8.2", "8.3", "8.4", "8.5"]' + php-versions: '["8.4", "8.5"]' phpunit-options-lowest: "--do-not-fail-on-deprecation" secrets: CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" diff --git a/UPGRADE.md b/UPGRADE.md index ca89d1bc..07017c9d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -6,6 +6,14 @@ awareness about deprecated code. - Use of our low-overhead runtime deprecation API, details: https://github.com/doctrine/deprecations/ +# Upgrade to 5.0 + +## BC Break: added type declarations to constants + +The code base now has constants with type declarations. If you extend types +from the library and override the constants, you will need to add compatible +type declarations. + # Upgrade to 4.2 ## Add `getFieldValue` and `setFieldValue` to `ClassMetadata` implementation diff --git a/composer.json b/composer.json index 6ec6ca1d..4d1e4f3c 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ {"name": "Marco Pivetta", "email": "ocramius@gmail.com"} ], "require": { - "php": "^8.1", + "php": "^8.4", "doctrine/deprecations": "^1", "doctrine/event-manager": "^1 || ^2", "psr/cache": "^1.0 || ^2.0 || ^3.0" diff --git a/phpcs.xml.dist b/phpcs.xml.dist index f248bbd8..97f499fd 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -12,7 +12,7 @@ - + src tests diff --git a/phpstan.neon b/phpstan.neon index 8a4291b4..6f358e4b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,7 +6,7 @@ includes: parameters: level: 7 - phpVersion: 80100 + phpVersion: 80400 paths: - src diff --git a/src/Mapping/ClassMetadata.php b/src/Mapping/ClassMetadata.php index 3ca89075..4cca90c9 100644 --- a/src/Mapping/ClassMetadata.php +++ b/src/Mapping/ClassMetadata.php @@ -35,7 +35,7 @@ public function getIdentifier(): array; /** * Gets the ReflectionClass instance for this mapped class. * - * @return ReflectionClass + * @return ReflectionClass */ public function getReflectionClass(): ReflectionClass; diff --git a/src/Proxy.php b/src/Proxy.php index 7394111f..77c4563d 100644 --- a/src/Proxy.php +++ b/src/Proxy.php @@ -14,12 +14,12 @@ interface Proxy /** * Marker for Proxy class names. */ - public const MARKER = '__CG__'; + public const string MARKER = '__CG__'; /** * Length of the proxy marker. */ - public const MARKER_LENGTH = 6; + public const int MARKER_LENGTH = 6; /** * Initializes this proxy if its not yet initialized. diff --git a/tests/RuntimeReflectionPropertyTest.php b/tests/RuntimeReflectionPropertyTest.php index f88b546b..eeead9f2 100644 --- a/tests/RuntimeReflectionPropertyTest.php +++ b/tests/RuntimeReflectionPropertyTest.php @@ -54,6 +54,7 @@ public function testGetValueOnProxyProperty(string $proxyClass): void $reflProperty = new RuntimeReflectionProperty($proxyClass, 'checkedProperty'); self::assertSame('testValue', $reflProperty->getValue($mockProxy)); + /** @phpstan-ignore unset.possiblyHookedProperty */ unset($mockProxy->checkedProperty); self::assertNull($reflProperty->getValue($mockProxy)); }