Merge branch '4.4' into 5.2

* 4.4:
  Skip checking return types on PHP <= 7.2
This commit is contained in:
Nicolas Grekas 2021-02-11 09:21:20 +01:00
commit 55ca168ee1
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
putenv('SYMFONY_PHPUNIT_VERSION=9.5');
}
}
if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
if (!getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') && \PHP_VERSION_ID >= 70300) {
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1');
}
if (getcwd() === realpath(__DIR__.'/src/Symfony/Bridge/PhpUnit')) {

View File

@ -611,7 +611,7 @@ class DebugClassLoader
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
}
if (false === strpos($doc, '@deprecated') && 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']) {