diff --git a/phpunit b/phpunit index 9141d249d2695..619ba4674a594 100755 --- a/phpunit +++ b/phpunit @@ -16,9 +16,6 @@ if (!getenv('SYMFONY_PHPUNIT_VERSION')) { putenv('SYMFONY_PHPUNIT_VERSION=9.5'); } } -if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) { - putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1'); -} if (getcwd() === realpath(__DIR__.'/src/Symfony/Bridge/PhpUnit')) { putenv('SYMFONY_DEPRECATIONS_HELPER=disabled'); } diff --git a/src/Symfony/Component/ErrorHandler/DebugClassLoader.php b/src/Symfony/Component/ErrorHandler/DebugClassLoader.php index c9587b482c3e1..e5e6bb7a5b7e8 100644 --- a/src/Symfony/Component/ErrorHandler/DebugClassLoader.php +++ b/src/Symfony/Component/ErrorHandler/DebugClassLoader.php @@ -535,7 +535,7 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array if (null !== (self::INTERNAL_TYPES[$use] ?? null)) { foreach (self::INTERNAL_TYPES[$use] as $method => $returnType) { if ('void' !== $returnType) { - self::$returnTypes[$class] += [$method => [$returnType, $returnType, $class, '']]; + self::$returnTypes[$class] += [$method => [$returnType, $returnType, $use, '']]; } } } @@ -612,7 +612,7 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array $this->patchMethod($method, $returnType, $declaringFile, $normalizedType); } - if (strncmp($ns, $declaringClass, $len)) { + if (false === strpos($doc, '@deprecated') && strncmp($ns, $declaringClass, $len)) { if ($canAddReturnType && 'docblock' === $this->patchTypes['force'] && false === strpos($method->getFileName(), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) { $this->patchMethod($method, $returnType, $declaringFile, $normalizedType); } elseif ('' !== $declaringClass && $this->patchTypes['deprecations']) { diff --git a/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php b/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php index 17984b86d9cc3..b1e7993de70ae 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php @@ -320,12 +320,12 @@ public function getSalt() return null; } - public function serialize() + public function serialize(): string { return serialize($this->name); } - public function unserialize($serialized) + public function unserialize($serialized): void { $this->name = unserialize($serialized); }