From ff47516ea079a7075f14f9126229056a88d6eeaa Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 7 Sep 2020 22:06:42 +0200 Subject: [PATCH 1/3] Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3). --- phpunit | 6 +++--- .../Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php | 4 ++-- src/Symfony/Bundle/FrameworkBundle/composer.json | 2 +- src/Symfony/Component/Form/composer.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpunit b/phpunit index 2b4412dc4d..e1b1aea0e4 100755 --- a/phpunit +++ b/phpunit @@ -12,10 +12,10 @@ if (!getenv('SYMFONY_PHPUNIT_VERSION')) { if (false === getenv('SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT') && false !== strpos(@file_get_contents(__DIR__.'/src/Symfony/Component/HttpKernel/Kernel.php'), 'const MAJOR_VERSION = 3;')) { putenv('SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1'); } - if (\PHP_VERSION_ID >= 80000) { - putenv('SYMFONY_PHPUNIT_VERSION=9.3'); + if (\PHP_VERSION_ID < 70300) { + putenv('SYMFONY_PHPUNIT_VERSION=8.5'); } else { - putenv('SYMFONY_PHPUNIT_VERSION=8.3'); + putenv('SYMFONY_PHPUNIT_VERSION=9.3'); } } elseif (\PHP_VERSION_ID >= 70000) { putenv('SYMFONY_PHPUNIT_VERSION=6.5'); diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php index b6d05cb0f1..dc579e408f 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php @@ -49,8 +49,8 @@ class SymfonyTestsListenerTrait \PHPUnit_Util_Blacklist::$blacklistedClassNames[__CLASS__] = 2; } elseif (method_exists('PHPUnit\Util\Blacklist', 'addDirectory')) { eval(" // PHP 5.3 compat - (new BlackList())->getBlacklistedDirectories(); - Blacklist::addDirectory(\dirname((new \ReflectionClass(__CLASS__))->getFileName(), 2)); + (new \PHPUnit\Util\Blacklist())->getBlacklistedDirectories(); + \PHPUnit\Util\Blacklist::addDirectory(\dirname(__FILE__, 2)); "); } else { Blacklist::$blacklistedClassNames[__CLASS__] = 2; diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index aad4e3fc61..c9750dc8df 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -25,7 +25,7 @@ "symfony/debug": "~2.8|~3.0|~4.0", "symfony/event-dispatcher": "~3.4|~4.0", "symfony/http-foundation": "^3.4.38|^4.3", - "symfony/http-kernel": "^3.4.31|^4.3.4", + "symfony/http-kernel": "^3.4.44|^4.3.4", "symfony/polyfill-mbstring": "~1.0", "symfony/filesystem": "~2.8|~3.0|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json index c69ac107bd..5e2010acbe 100644 --- a/src/Symfony/Component/Form/composer.json +++ b/src/Symfony/Component/Form/composer.json @@ -26,7 +26,7 @@ }, "require-dev": { "doctrine/collections": "~1.0", - "symfony/validator": "^3.4.3|^4.0.3", + "symfony/validator": "^3.4.44|^4.0.3", "symfony/dependency-injection": "~3.3|~4.0", "symfony/config": "~2.7|~3.0|~4.0", "symfony/expression-language": "~3.4|~4.0", From 4fcb41c3ba49a0b27073ef9a5a3b4911a8d85c51 Mon Sep 17 00:00:00 2001 From: vladyslavstartsev <17382248+vladyslavstartsev@users.noreply.github.com> Date: Mon, 14 Sep 2020 19:22:49 +0300 Subject: [PATCH 2/3] Change 'cache_key' to AbstractRendererEngine::CACHE_KEY_VAR The purpose of this change is to find all usages of AbstractRendererEngine::CACHE_KEY_VAR. Currently, if you search for AbstractRendererEngine::CACHE_KEY_VAR you will see only access to it, i.e. (`$view->vars[AbstractRendererEngine::CACHE_KEY_VAR]`), but you can't find it in write level. With this pull request you can see where is was used for write. --- src/Symfony/Component/Form/Extension/Core/Type/BaseType.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php b/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php index 05d215f63c..2b3c25889b 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Form\Extension\Core\Type; +use Symfony\Component\Form\AbstractRendererEngine; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormInterface; @@ -100,7 +101,7 @@ abstract class BaseType extends AbstractType // collection form have different types (dynamically), they should // be rendered differently. // https://github.com/symfony/symfony/issues/5038 - 'cache_key' => $uniqueBlockPrefix.'_'.$form->getConfig()->getType()->getBlockPrefix(), + AbstractRendererEngine::CACHE_KEY_VAR => $uniqueBlockPrefix.'_'.$form->getConfig()->getType()->getBlockPrefix(), ]); } From 05a9660a1e5a51b8dcd8bc6c696c35931a80ec77 Mon Sep 17 00:00:00 2001 From: Tom Klingenberg Date: Thu, 17 Sep 2020 01:48:05 +0200 Subject: [PATCH 3/3] remove superfluous cast in YAML component. minor. --- src/Symfony/Component/Yaml/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 51a0fa9127..9cfd1d45cb 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -725,7 +725,7 @@ class Parser if (self::preg_match('/^(?:'.self::TAG_PATTERN.' +)?'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; - $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs((int) $modifiers)); + $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), abs((int) $modifiers)); if ('' !== $matches['tag']) { if ('!!binary' === $matches['tag']) {