8000 [ErrorHandler] fix parsing return types in DebugClassLoader · PhilETaylor/symfony@58e32b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 58e32b3

Browse files
[ErrorHandler] fix parsing return types in DebugClassLoader
1 parent 9197199 commit 58e32b3

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

phpunit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
1616
putenv('SYMFONY_PHPUNIT_VERSION=9.5');
1717
}
1818
}
19-
if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
20-
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');
21-
}
2219
if (getcwd() === realpath(__DIR__.'/src/Symfony/Bridge/PhpUnit')) {
2320
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
2421
}

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
535535
if (null !== (self::INTERNAL_TYPES[$use] ?? null)) {
536536
foreach (self::INTERNAL_TYPES[$use] as $method => $returnType) {
537537
if ('void' !== $returnType) {
538-
self::$returnTypes[$class] += [$method => [$returnType, $returnType, $class, '']];
538+
self::$returnTypes[$class] += [$method => [$returnType, $returnType, $use, '']];
539539
}
540540
}
541541
}
@@ -612,7 +612,7 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
612612
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
613613
}
614614

615-
if (strncmp($ns, $declaringClass, $len)) {
615+
if (false === strpos($doc, '@deprecated') && strncmp($ns, $declaringClass, $len)) {
616616
if ($canAddReturnType && 'docblock' === $this->patchTypes['force'] && false === strpos($method->getFileName(), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) {
617617
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
618618
} elseif ('' !== $declaringClass && $this->patchTypes['deprecations']) {

src/Symfony/Component/Security/Core/Tests/Authentication/Token/AbstractTokenTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ public function getSalt()
320320
return null;
321321
}
322322

323-
public function serialize()
323+
public function serialize(): string
324324
{
325325
return serialize($this->name);
326326
}
327327

328-
public function unserialize($serialized)
328+
public function unserialize($serialized): void
329329
{
330330
$this->name = unserialize($serialized);
331331
}

0 commit comments

Comments
 (0)
0