From 2b268379f5dd951be4f45b3108a310b29f40fe70 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 13 Jun 2019 14:58:48 +0200 Subject: [PATCH 1/7] [VarDumper] caster for HttpClient's response dumps all info --- .../Component/VarDumper/Caster/SymfonyCaster.php | 12 ++++++++++++ .../Component/VarDumper/Cloner/AbstractCloner.php | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Caster/SymfonyCaster.php b/src/Symfony/Component/VarDumper/Caster/SymfonyCaster.php index 78acb90b66..aa10465861 100644 --- a/src/Symfony/Component/VarDumper/Caster/SymfonyCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/SymfonyCaster.php @@ -48,4 +48,16 @@ class SymfonyCaster return $a; } + + public static function castHttpClientResponse($response, array $a, Stub $stub, $isNested) + { + $stub->cut += \count($a); + $a = []; + + foreach ($response->getInfo() + ['debug' => $response->getInfo('debug')] as $k => $v) { + $a[Caster::PREFIX_VIRTUAL.$k] = $v; + } + + return $a; + } } diff --git a/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php b/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php index aacab2c885..ea2b45ffa1 100644 --- a/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php +++ b/src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php @@ -78,8 +78,8 @@ abstract class AbstractCloner implements ClonerInterface 'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], 'Symfony\Component\HttpClient\NativeHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], - 'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], - 'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], + 'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], + 'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], 'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'], 'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'], 'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'], From ff53cb462a6618fa084d789ae5ca3e93098e84ec Mon Sep 17 00:00:00 2001 From: Dmitry Simushev Date: Sat, 8 Jun 2019 23:05:12 +0300 Subject: [PATCH 2/7] [DomCrawler][Feature][DX] Add Form::getName() method --- src/Symfony/Component/DomCrawler/CHANGELOG.md | 5 +++++ src/Symfony/Component/DomCrawler/Form.php | 10 ++++++++++ src/Symfony/Component/DomCrawler/Tests/FormTest.php | 12 ++++++++++++ 3 files changed, 27 insertions(+) diff --git a/src/Symfony/Component/DomCrawler/CHANGELOG.md b/src/Symfony/Component/DomCrawler/CHANGELOG.md index 6c3cd979b6..1be1f6b411 100644 --- a/src/Symfony/Component/DomCrawler/CHANGELOG.md +++ b/src/Symfony/Component/DomCrawler/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.4.0 +----- + +* Added `Form::getName()` method. + 4.3.0 ----- diff --git a/src/Symfony/Component/DomCrawler/Form.php b/src/Symfony/Component/DomCrawler/Form.php index 8bdd364347..13d3bc70a8 100644 --- a/src/Symfony/Component/DomCrawler/Form.php +++ b/src/Symfony/Component/DomCrawler/Form.php @@ -250,6 +250,16 @@ class Form extends Link implements \ArrayAccess return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET'; } + /** + * Gets the form name. + * + * If no name is defined on the form, an empty string is returned. + */ + public function getName(): string + { + return $this->node->getAttribute('name'); + } + /** * Returns true if the named field exists. * diff --git a/src/Symfony/Component/DomCrawler/Tests/FormTest.php b/src/Symfony/Component/DomCrawler/Tests/FormTest.php index 2c0ee22c1f..f5827f0643 100644 --- a/src/Symfony/Component/DomCrawler/Tests/FormTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/FormTest.php @@ -327,6 +327,18 @@ class FormTest extends TestCase $this->assertEquals('POST', $form->getMethod(), '->getMethod() returns the method attribute value of the form'); } + public function testGetName() + { + $form = $this->createForm('
'); + $this->assertSame('foo', $form->getName()); + } + + public function testGetNameOnFormWithoutName() + { + $form = $this->createForm('
'); + $this->assertSame('', $form->getName()); + } + public function testGetSetValue() { $form = $this->createForm('
'); From e3b248aee070e771e605dbb8f7e9528f15c35c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4dlich?= Date: Sat, 27 Apr 2019 12:21:40 +0200 Subject: [PATCH 3/7] [Config] Introduce find method in ArrayNodeDefinition to ease configuration tree manipulation --- .../Builder/ArrayNodeDefinition.php | 22 +++++ .../Builder/ArrayNodeDefinitionTest.php | 81 +++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php index dca5687a20..e40d97b2fb 100644 --- a/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php @@ -523,4 +523,26 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition { return $this->children; } + + /** + * Finds a node defined by the given $nodePath. + * + * @param string $nodePath The path of the node to find. e.g "doctrine.orm.mappings" + */ + public function find(string $nodePath): NodeDefinition + { + $firstPathSegment = (false === $pathSeparatorPos = strpos($nodePath, $this->pathSeparator)) + ? $nodePath + : substr($nodePath, 0, $pathSeparatorPos); + + if (null === $node = ($this->children[$firstPathSegment] ?? null)) { + throw new \RuntimeException(sprintf('Node with name "%s" does not exist in the current node "%s".', $firstPathSegment, $this->name)); + } + + if (false === $pathSeparatorPos) { + return $node; + } + + return $node->find(substr($nodePath, $pathSeparatorPos + \strlen($this->pathSeparator))); + } } diff --git a/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php b/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php index 0aa2a08ab4..0c414a9b9d 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php @@ -13,6 +13,8 @@ namespace Symfony\Component\Config\Tests\Definition\Builder; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; +use Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition; +use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition; use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException; use Symfony\Component\Config\Definition\Processor; @@ -357,6 +359,85 @@ class ArrayNodeDefinitionTest extends TestCase $node->getNode()->finalize([]); } + public function testFindShouldThrowExceptionIfNodeDoesNotExistInRootNode() + { + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage('Node with name "child" does not exist in the current node "root".'); + + $rootNode = new ArrayNodeDefinition('root'); + $rootNode + ->children() + ->arrayNode('social_media_channels')->end() + ->end() + ; + + $rootNode->find('child'); + } + + public function testFindShouldHandleComplexConfigurationProperly() + { + $rootNode = new ArrayNodeDefinition('root'); + $rootNode + ->children() + ->arrayNode('social_media_channels') + ->children() + ->booleanNode('enable')->end() + ->arrayNode('twitter')->end() + ->arrayNode('facebook')->end() + ->arrayNode('instagram') + ->children() + ->booleanNode('enable')->end() + ->arrayNode('accounts')->end() + ->end() + ->end() + ->end() + ->append( + $mailerNode = (new ArrayNodeDefinition('mailer')) + ->children() + ->booleanNode('enable')->end() + ->arrayNode('transports')->end() + ->end() + ) + ->end() + ; + + $this->assertNode('social_media_channels', ArrayNodeDefinition::class, $rootNode->find('social_media_channels')); + $this->assertNode('enable', BooleanNodeDefinition::class, $rootNode->find('social_media_channels.enable')); + $this->assertNode('twitter', ArrayNodeDefinition::class, $rootNode->find('social_media_channels.twitter')); + $this->assertNode('facebook', ArrayNodeDefinition::class, $rootNode->find('social_media_channels.facebook')); + $this->assertNode('instagram', ArrayNodeDefinition::class, $rootNode->find('social_media_channels.instagram')); + $this->assertNode('enable', BooleanNodeDefinition::class, $rootNode->find('social_media_channels.instagram.enable')); + $this->assertNode('accounts', ArrayNodeDefinition::class, $rootNode->find('social_media_channels.instagram.accounts')); + + $this->assertNode('enable', BooleanNodeDefinition::class, $mailerNode->find('enable')); + $this->assertNode('transports', ArrayNodeDefinition::class, $mailerNode->find('transports')); + } + + public function testFindShouldWorkProperlyForNonDefaultPathSeparator() + { + $rootNode = new ArrayNodeDefinition('root'); + $rootNode + ->setPathSeparator('.|') + ->children() + ->arrayNode('mailer.configuration') + ->children() + ->booleanNode('enable')->end() + ->arrayNode('transports')->end() + ->end() + ->end() + ; + + $this->assertNode('mailer.configuration', ArrayNodeDefinition::class, $rootNode->find('mailer.configuration')); + $this->assertNode('enable', BooleanNodeDefinition::class, $rootNode->find('mailer.configuration.|enable')); + $this->assertNode('transports', ArrayNodeDefinition::class, $rootNode->find('mailer.configuration.|transports')); + } + + protected function assertNode(string $expectedName, string $expectedType, NodeDefinition $actualNode): void + { + $this->assertInstanceOf($expectedType, $actualNode); + $this->assertSame($expectedName, $this->getField($actualNode, 'name')); + } + protected function getField($object, $field) { $reflection = new \ReflectionProperty($object, $field); From 0c0978cd47b379769cfedd0d0162460a36c4c068 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Fri, 14 Jun 2019 10:27:35 +0200 Subject: [PATCH 4/7] [Validator] Deprecate unused arg in ExpressionValidator --- UPGRADE-4.4.md | 6 +++ UPGRADE-5.0.md | 1 + src/Symfony/Component/Validator/CHANGELOG.md | 1 + .../Constraints/ExpressionValidator.php | 13 ++++++- .../Constraints/ExpressionValidatorTest.php | 38 +++++++++++++++++++ 5 files changed, 58 insertions(+), 1 deletion(-) diff --git a/UPGRADE-4.4.md b/UPGRADE-4.4.md index 0620564f3b..2fed4defb0 100644 --- a/UPGRADE-4.4.md +++ b/UPGRADE-4.4.md @@ -85,3 +85,9 @@ TwigBridge * Deprecated to pass `$rootDir` and `$fileLinkFormatter` as 5th and 6th argument respectively to the `DebugCommand::__construct()` method, swap the variables position. + +Validator +--------- + + * Deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`. + Pass it as the first argument instead. diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index f23456fb3d..d70223f4c8 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -453,6 +453,7 @@ TwigBridge Validator -------- + * An `ExpressionLanguage` instance or null must be passed as the first argument of `ExpressionValidator::__construct()` * The `checkMX` and `checkHost` options of the `Email` constraint were removed * The `Email::__construct()` 'strict' property has been removed. Use 'mode'=>"strict" instead. * Calling `EmailValidator::__construct()` method with a boolean parameter has been removed, use `EmailValidator("strict")` instead. diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index 56ff079f46..8a85ee35ef 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 4.4.0 ----- + * deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`. Pass it as the first argument instead. * added the `compared_value_path` parameter in violations when using any comparison constraint with the `propertyPath` option. * added support for checking an array of types in `TypeValidator` diff --git a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php b/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php index b72a83365b..0fb43cdddc 100644 --- a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php @@ -25,8 +25,19 @@ class ExpressionValidator extends ConstraintValidator { private $expressionLanguage; - public function __construct($propertyAccessor = null, ExpressionLanguage $expressionLanguage = null) + public function __construct(/*ExpressionLanguage */$expressionLanguage = null) { + if (!$expressionLanguage instanceof ExpressionLanguage) { + if (null !== $expressionLanguage) { + @trigger_error(sprintf('The "%s" first argument must be an instance of "%s" or null since 4.4. "%s" given', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage)), E_USER_DEPRECATED); + } + + if (\func_num_args() > 1 && func_get_arg(1) instanceof ExpressionLanguage) { + @trigger_error(sprintf('The "%s" instance should be passed as "%s" first argument instead of second argument since 4.4.', ExpressionLanguage::class, __METHOD__), E_USER_DEPRECATED); + $expressionLanguage = func_get_arg(1); + } + } + $this->expressionLanguage = $expressionLanguage; } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php index 7e1b460a80..e1507fa8e9 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/ExpressionValidatorTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Validator\Tests\Constraints; +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Symfony\Component\Validator\Constraints\Expression; use Symfony\Component\Validator\Constraints\ExpressionValidator; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; @@ -253,6 +254,34 @@ class ExpressionValidatorTest extends ConstraintValidatorTestCase 'expression' => 'false', ]); + $expressionLanguage = $this->getMockBuilder(ExpressionLanguage::class)->getMock(); + + $used = false; + + $expressionLanguage->method('evaluate') + ->willReturnCallback(function () use (&$used) { + $used = true; + + return true; + }); + + $validator = new ExpressionValidator($expressionLanguage); + $validator->initialize($this->createContext()); + $validator->validate(null, $constraint); + + $this->assertTrue($used, 'Failed asserting that custom ExpressionLanguage instance is used.'); + } + + /** + * @group legacy + * @expectedDeprecation The "Symfony\Component\ExpressionLanguage\ExpressionLanguage" instance should be passed as "Symfony\Component\Validator\Constraints\ExpressionValidator::__construct" first argument instead of second argument since 4.4. + */ + public function testLegacyExpressionLanguageUsage() + { + $constraint = new Expression([ + 'expression' => 'false', + ]); + $expressionLanguage = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ExpressionLanguage')->getMock(); $used = false; @@ -271,6 +300,15 @@ class ExpressionValidatorTest extends ConstraintValidatorTestCase $this->assertTrue($used, 'Failed asserting that custom ExpressionLanguage instance is used.'); } + /** + * @group legacy + * @expectedDeprecation The "Symfony\Component\Validator\Constraints\ExpressionValidator::__construct" first argument must be an instance of "Symfony\Component\ExpressionLanguage\ExpressionLanguage" or null since 4.4. "string" given + */ + public function testConstructorInvalidType() + { + new ExpressionValidator('foo'); + } + public function testPassingCustomValues() { $constraint = new Expression([ From ecded5ed03bb95b0f9ee1a405eeb0a25ccf0ad64 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 14 Jun 2019 15:29:59 +0200 Subject: [PATCH 5/7] prevent double deprecation message --- .../Validator/Constraints/ExpressionValidator.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php b/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php index 0fb43cdddc..58ce1606a9 100644 --- a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php @@ -27,15 +27,16 @@ class ExpressionValidator extends ConstraintValidator public function __construct(/*ExpressionLanguage */$expressionLanguage = null) { - if (!$expressionLanguage instanceof ExpressionLanguage) { - if (null !== $expressionLanguage) { - @trigger_error(sprintf('The "%s" first argument must be an instance of "%s" or null since 4.4. "%s" given', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage)), E_USER_DEPRECATED); - } + if (\func_num_args() > 1) { + @trigger_error(sprintf('The "%s" instance should be passed as "%s" first argument instead of second argument since 4.4.', ExpressionLanguage::class, __METHOD__), E_USER_DEPRECATED); - if (\func_num_args() > 1 && func_get_arg(1) instanceof ExpressionLanguage) { - @trigger_error(sprintf('The "%s" instance should be passed as "%s" first argument instead of second argument since 4.4.', ExpressionLanguage::class, __METHOD__), E_USER_DEPRECATED); - $expressionLanguage = func_get_arg(1); + $expressionLanguage = func_get_arg(1); + + if (null !== $expressionLanguage && !$expressionLanguage instanceof ExpressionLanguage) { + throw new \TypeError(sprintf('Argument 2 passed to %s() must be an instance of %s or null, %s given. Since 4.4, passing it as the second argument is deprecated and will trigger a deprecation. Pass it as the first argument instead.', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage))); } + } elseif (null !== $expressionLanguage && !$expressionLanguage instanceof ExpressionLanguage) { + @trigger_error(sprintf('The "%s" first argument must be an instance of "%s" or null since 4.4. "%s" given', __METHOD__, ExpressionLanguage::class, \is_object($expressionLanguage) ? \get_class($expressionLanguage) : \gettype($expressionLanguage)), E_USER_DEPRECATED); } $this->expressionLanguage = $expressionLanguage; From 7cf3fb4a21be7b2124c940bd427dbf5f86e73d60 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 15 Jun 2019 00:30:02 +0200 Subject: [PATCH 6/7] Prepare for PHP 7.4 preload --- ...tyServiceSubscriberInterface.contracts.php | 21 +++++ ...ilityServiceSubscriberInterface.legacy.php | 21 +++++ ...ompatibilityServiceSubscriberInterface.php | 15 +--- ...tyServiceSubscriberInterface.contracts.php | 21 +++++ ...ilityServiceSubscriberInterface.legacy.php | 21 +++++ ...ompatibilityServiceSubscriberInterface.php | 15 +--- .../Cache/Exception/CacheException+psr16.php | 19 +++++ .../Cache/Exception/CacheException-psr16.php | 18 +++++ .../Cache/Exception/CacheException.php | 9 +-- .../InvalidArgumentException+psr16.php | 19 +++++ .../InvalidArgumentException-psr16.php | 18 +++++ .../Exception/InvalidArgumentException.php | 9 +-- .../Cache/Exception/LogicException+psr16.php | 19 +++++ .../Cache/Exception/LogicException-psr16.php | 18 +++++ .../Cache/Exception/LogicException.php | 11 +-- .../Contracts/EventDispatcher/Event+psr14.php | 54 +++++++++++++ .../Contracts/EventDispatcher/Event-psr14.php | 52 ++++++++++++ .../Contracts/EventDispatcher/Event.php | 80 +------------------ .../EventDispatcherInterface+psr14.php | 35 ++++++++ .../EventDispatcherInterface-psr14.php | 33 ++++++++ .../EventDispatcherInterface.php | 42 +--------- 21 files changed, 384 insertions(+), 166 deletions(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php create mode 100644 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php create mode 100644 src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php create mode 100644 src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php create mode 100644 src/Symfony/Component/Cache/Exception/CacheException+psr16.php create mode 100644 src/Symfony/Component/Cache/Exception/CacheException-psr16.php create mode 100644 src/Symfony/Component/Cache/Exception/InvalidArgumentException+psr16.php create mode 100644 src/Symfony/Component/Cache/Exception/InvalidArgumentException-psr16.php create mode 100644 src/Symfony/Component/Cache/Exception/LogicException+psr16.php create mode 100644 src/Symfony/Component/Cache/Exception/LogicException-psr16.php create mode 100644 src/Symfony/Contracts/EventDispatcher/Event+psr14.php create mode 100644 src/Symfony/Contracts/EventDispatcher/Event-psr14.php create mode 100644 src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface+psr14.php create mode 100644 src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface-psr14.php diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php new file mode 100644 index 0000000000..abe621908e --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; + +use Symfony\Contracts\Service\ServiceSubscriberInterface; + +/** + * @internal + */ +interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface +{ +} diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php new file mode 100644 index 0000000000..af5dab3db5 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; + +use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface; + +/** + * @internal + */ +interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface +{ +} diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php index 41d4aa81e9..4ed5bac6a6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php @@ -12,20 +12,9 @@ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface; -use Symfony\Contracts\Service\ServiceSubscriberInterface; if (interface_exists(LegacyServiceSubscriberInterface::class)) { - /** - * @internal - */ - interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.legacy.php'; } else { - /** - * @internal - */ - interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.contracts.php'; } diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php new file mode 100644 index 0000000000..4f30bf63a0 --- /dev/null +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.contracts.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\TwigBundle\DependencyInjection; + +use Symfony\Contracts\Service\ServiceSubscriberInterface; + +/** + * @internal + */ +interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface +{ +} diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php new file mode 100644 index 0000000000..494e8f5c51 --- /dev/null +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.legacy.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\TwigBundle\DependencyInjection; + +use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface; + +/** + * @internal + */ +interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface +{ +} diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php index 967f732ff5..8afe2f61ef 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php @@ -12,20 +12,9 @@ namespace Symfony\Bundle\TwigBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface; -use Symfony\Contracts\Service\ServiceSubscriberInterface; if (interface_exists(LegacyServiceSubscriberInterface::class)) { - /** - * @internal - */ - interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.legacy.php'; } else { - /** - * @internal - */ - interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.contracts.php'; } diff --git a/src/Symfony/Component/Cache/Exception/CacheException+psr16.php b/src/Symfony/Component/Cache/Exception/CacheException+psr16.php new file mode 100644 index 0000000000..e87b2db8fe --- /dev/null +++ b/src/Symfony/Component/Cache/Exception/CacheException+psr16.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Exception; + +use Psr\Cache\CacheException as Psr6CacheInterface; +use Psr\SimpleCache\CacheException as SimpleCacheInterface; + +class CacheException extends \Exception implements Psr6CacheInterface, SimpleCacheInterface +{ +} diff --git a/src/Symfony/Component/Cache/Exception/CacheException-psr16.php b/src/Symfony/Component/Cache/Exception/CacheException-psr16.php new file mode 100644 index 0000000000..1dca75f16d --- /dev/null +++ b/src/Symfony/Component/Cache/Exception/CacheException-psr16.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Exception; + +use Psr\Cache\CacheException as Psr6CacheInterface; + +class CacheException extends \Exception implements Psr6CacheInterface +{ +} diff --git a/src/Symfony/Component/Cache/Exception/CacheException.php b/src/Symfony/Component/Cache/Exception/CacheException.php index d2e975b2bc..c052a12c84 100644 --- a/src/Symfony/Component/Cache/Exception/CacheException.php +++ b/src/Symfony/Component/Cache/Exception/CacheException.php @@ -11,15 +11,10 @@ namespace Symfony\Component\Cache\Exception; -use Psr\Cache\CacheException as Psr6CacheInterface; use Psr\SimpleCache\CacheException as SimpleCacheInterface; if (interface_exists(SimpleCacheInterface::class)) { - class CacheException extends \Exception implements Psr6CacheInterface, SimpleCacheInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'CacheException+psr16.php'; } else { - class CacheException extends \Exception implements Psr6CacheInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'CacheException-psr16.php'; } diff --git a/src/Symfony/Component/Cache/Exception/InvalidArgumentException+psr16.php b/src/Symfony/Component/Cache/Exception/InvalidArgumentException+psr16.php new file mode 100644 index 0000000000..828bf3ed77 --- /dev/null +++ b/src/Symfony/Component/Cache/Exception/InvalidArgumentException+psr16.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Exception; + +use Psr\Cache\InvalidArgumentException as Psr6CacheInterface; +use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInterface; + +class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface, SimpleCacheInterface +{ +} diff --git a/src/Symfony/Component/Cache/Exception/InvalidArgumentException-psr16.php b/src/Symfony/Component/Cache/Exception/InvalidArgumentException-psr16.php new file mode 100644 index 0000000000..5a80c94dab --- /dev/null +++ b/src/Symfony/Component/Cache/Exception/InvalidArgumentException-psr16.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Exception; + +use Psr\Cache\InvalidArgumentException as Psr6CacheInterface; + +class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface +{ +} diff --git a/src/Symfony/Component/Cache/Exception/InvalidArgumentException.php b/src/Symfony/Component/Cache/Exception/InvalidArgumentException.php index 7f9584a264..2c891d7365 100644 --- a/src/Symfony/Component/Cache/Exception/InvalidArgumentException.php +++ b/src/Symfony/Component/Cache/Exception/InvalidArgumentException.php @@ -11,15 +11,10 @@ namespace Symfony\Component\Cache\Exception; -use Psr\Cache\InvalidArgumentException as Psr6CacheInterface; use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInterface; if (interface_exists(SimpleCacheInterface::class)) { - class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface, SimpleCacheInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'InvalidArgumentException+psr16.php'; } else { - class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'InvalidArgumentException-psr16.php'; } diff --git a/src/Symfony/Component/Cache/Exception/LogicException+psr16.php b/src/Symfony/Component/Cache/Exception/LogicException+psr16.php new file mode 100644 index 0000000000..d299673eb2 --- /dev/null +++ b/src/Symfony/Component/Cache/Exception/LogicException+psr16.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Exception; + +use Psr\Cache\CacheException as Psr6CacheInterface; +use Psr\SimpleCache\CacheException as SimpleCacheInterface; + +class LogicException extends \LogicException implements Psr6CacheInterface, SimpleCacheInterface +{ +} diff --git a/src/Symfony/Component/Cache/Exception/LogicException-psr16.php b/src/Symfony/Component/Cache/Exception/LogicException-psr16.php new file mode 100644 index 0000000000..fc330ffaf9 --- /dev/null +++ b/src/Symfony/Component/Cache/Exception/LogicException-psr16.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Cache\Exception; + +use Psr\Cache\CacheException as Psr6CacheInterface; + +class LogicException extends \LogicException implements Psr6CacheInterface +{ +} diff --git a/src/Symfony/Component/Cache/Exception/LogicException.php b/src/Symfony/Component/Cache/Exception/LogicException.php index 9ffa7ed695..2a69ebe655 100644 --- a/src/Symfony/Component/Cache/Exception/LogicException.php +++ b/src/Symfony/Component/Cache/Exception/LogicException.php @@ -11,15 +11,10 @@ namespace Symfony\Component\Cache\Exception; -use Psr\Cache\CacheException as Psr6CacheInterface; -use Psr\SimpleCache\CacheException as SimpleCacheInterface; +use Psr\SimpleCache\LogicException as SimpleCacheInterface; if (interface_exists(SimpleCacheInterface::class)) { - class LogicException extends \LogicException implements Psr6CacheInterface, SimpleCacheInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'LogicException-psr16.php'; } else { - class LogicException extends \LogicException implements Psr6CacheInterface - { - } + require __DIR__.\DIRECTORY_SEPARATOR.'LogicException-psr16.php'; } diff --git a/src/Symfony/Contracts/EventDispatcher/Event+psr14.php b/src/Symfony/Contracts/EventDispatcher/Event+psr14.php new file mode 100644 index 0000000000..26ca47377a --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/Event+psr14.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\EventDispatcher; + +use Psr\EventDispatcher\StoppableEventInterface; + +/** + * Event is the base class for classes containing event data. + * + * This class contains no event data. It is used by events that do not pass + * state information to an event handler when an event is raised. + * + * You can call the method stopPropagation() to abort the execution of + * further listeners in your event listener. + * + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek + * @author Nicolas Grekas + */ +class Event implements StoppableEventInterface +{ + private $propagationStopped = false; + + /** + * Returns whether further event listeners should be triggered. + */ + public function isPropagationStopped(): bool + { + return $this->propagationStopped; + } + + /** + * Stops the propagation of the event to further event listeners. + * + * If multiple event listeners are connected to the same event, no + * further event listener will be triggered once any trigger calls + * stopPropagation(). + */ + public function stopPropagation(): void + { + $this->propagationStopped = true; + } +} diff --git a/src/Symfony/Contracts/EventDispatcher/Event-psr14.php b/src/Symfony/Contracts/EventDispatcher/Event-psr14.php new file mode 100644 index 0000000000..7636c8bf17 --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/Event-psr14.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\EventDispatcher; + +/** + * Event is the base class for classes containing event data. + * + * This class contains no event data. It is used by events that do not pass + * state information to an event handler when an event is raised. + * + * You can call the method stopPropagation() to abort the execution of + * further listeners in your event listener. + * + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek + * @author Nicolas Grekas + */ +class Event +{ + private $propagationStopped = false; + + /** + * Returns whether further event listeners should be triggered. + */ + public function isPropagationStopped(): bool + { + return $this->propagationStopped; + } + + /** + * Stops the propagation of the event to further event listeners. + * + * If multiple event listeners are connected to the same event, no + * further event listener will be triggered once any trigger calls + * stopPropagation(). + */ + public function stopPropagation(): void + { + $this->propagationStopped = true; + } +} diff --git a/src/Symfony/Contracts/EventDispatcher/Event.php b/src/Symfony/Contracts/EventDispatcher/Event.php index 84f60f3ed0..3574fd44e9 100644 --- a/src/Symfony/Contracts/EventDispatcher/Event.php +++ b/src/Symfony/Contracts/EventDispatcher/Event.php @@ -14,83 +14,7 @@ namespace Symfony\Contracts\EventDispatcher; use Psr\EventDispatcher\StoppableEventInterface; if (interface_exists(StoppableEventInterface::class)) { - /** - * Event is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass - * state information to an event handler when an event is raised. - * - * You can call the method stopPropagation() to abort the execution of - * further listeners in your event listener. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Nicolas Grekas - */ - class Event implements StoppableEventInterface - { - private $propagationStopped = false; - - /** - * Returns whether further event listeners should be triggered. - */ - public function isPropagationStopped(): bool - { - return $this->propagationStopped; - } - - /** - * Stops the propagation of the event to further event listeners. - * - * If multiple event listeners are connected to the same event, no - * further event listener will be triggered once any trigger calls - * stopPropagation(). - */ - public function stopPropagation(): void - { - $this->propagationStopped = true; - } - } + require __DIR__.\DIRECTORY_SEPARATOR.'Event+psr14.php'; } else { - /** - * Event is the base class for classes containing event data. - * - * This class contains no event data. It is used by events that do not pass - * state information to an event handler when an event is raised. - * - * You can call the method stopPropagation() to abort the execution of - * further listeners in your event listener. - * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Nicolas Grekas - */ - class Event - { - private $propagationStopped = false; - - /** - * Returns whether further event listeners should be triggered. - */ - public function isPropagationStopped(): bool - { - return $this->propagationStopped; - } - - /** - * Stops the propagation of the event to further event listeners. - * - * If multiple event listeners are connected to the same event, no - * further event listener will be triggered once any trigger calls - * stopPropagation(). - */ - public function stopPropagation(): void - { - $this->propagationStopped = true; - } - } + require __DIR__.\DIRECTORY_SEPARATOR.'Event-psr14.php'; } diff --git a/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface+psr14.php b/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface+psr14.php new file mode 100644 index 0000000000..fcfa91c700 --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface+psr14.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\EventDispatcher; + +use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface; + +/** + * Allows providing hooks on domain-specific lifecycles by dispatching events. + */ +interface EventDispatcherInterface extends PsrEventDispatcherInterface +{ + /** + * Dispatches an event to all registered listeners. + * + * For BC with Symfony 4, the $eventName argument is not declared explicitly on the + * signature of the method. Implementations that are not bound by this BC constraint + * MUST declare it explicitly, as allowed by PHP. + * + * @param object $event The event to pass to the event handlers/listeners + * @param string|null $eventName The name of the event to dispatch. If not supplied, + * the class of $event should be used instead. + * + * @return object The passed $event MUST be returned + */ + public function dispatch($event/*, string $eventName = null*/); +} diff --git a/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface-psr14.php b/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface-psr14.php new file mode 100644 index 0000000000..a630339bdc --- /dev/null +++ b/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface-psr14.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\EventDispatcher; + +/** + * Allows providing hooks on domain-specific lifecycles by dispatching events. + */ +interface EventDispatcherInterface +{ + /** + * Dispatches an event to all registered listeners. + * + * For BC with Symfony 4, the $eventName argument is not declared explicitly on the + * signature of the method. Implementations that are not bound by this BC constraint + * MUST declare it explicitly, as allowed by PHP. + * + * @param object $event The event to pass to the event handlers/listeners + * @param string|null $eventName The name of the event to dispatch. If not supplied, + * the class of $event should be used instead. + * + * @return object The passed $event MUST be returned + */ + public function dispatch($event/*, string $eventName = null*/); +} diff --git a/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface.php b/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface.php index 2d470af920..ef8be54b5a 100644 --- a/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface.php +++ b/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface.php @@ -14,45 +14,7 @@ namespace Symfony\Contracts\EventDispatcher; use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface; if (interface_exists(PsrEventDispatcherInterface::class)) { - /** - * Allows providing hooks on domain-specific lifecycles by dispatching events. - */ - interface EventDispatcherInterface extends PsrEventDispatcherInterface - { - /** - * Dispatches an event to all registered listeners. - * - * For BC with Symfony 4, the $eventName argument is not declared explicitly on the - * signature of the method. Implementations that are not bound by this BC constraint - * MUST declare it explicitly, as allowed by PHP. - * - * @param object $event The event to pass to the event handlers/listeners - * @param string|null $eventName The name of the event to dispatch. If not supplied, - * the class of $event should be used instead. - * - * @return object The passed $event MUST be returned - */ - public function dispatch($event/*, string $eventName = null*/); - } + require __DIR__.\DIRECTORY_SEPARATOR.'EventDispatcherInterface+psr14.php'; } else { - /** - * Allows providing hooks on domain-specific lifecycles by dispatching events. - */ - interface EventDispatcherInterface - { - /** - * Dispatches an event to all registered listeners. - * - * For BC with Symfony 4, the $eventName argument is not declared explicitly on the - * signature of the method. Implementations that are not bound by this BC constraint - * MUST declare it explicitly, as allowed by PHP. - * - * @param object $event The event to pass to the event handlers/listeners - * @param string|null $eventName The name of the event to dispatch. If not supplied, - * the class of $event should be used instead. - * - * @return object The passed $event MUST be returned - */ - public function dispatch($event/*, string $eventName = null*/); - } + require __DIR__.\DIRECTORY_SEPARATOR.'EventDispatcherInterface-psr14.php'; } From 5491d5347c7e1326628f38f979f499928f9262d1 Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Sat, 15 Jun 2019 19:01:39 +0200 Subject: [PATCH 7/7] [PhpUnitBridge] Bump PHPUnit 7+8 --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php index da9e11c985..1a14169f22 100644 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php @@ -47,9 +47,12 @@ $getEnvVar = function ($name, $default = false) { return $default; }; -if (PHP_VERSION_ID >= 70100) { +if (PHP_VERSION_ID >= 70200) { + // PHPUnit 8 requires PHP 7.2+ + $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '8.2'); +} elseif (PHP_VERSION_ID >= 70100) { // PHPUnit 7 requires PHP 7.1+ - $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '7.4'); + $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '7.5'); } elseif (PHP_VERSION_ID >= 70000) { // PHPUnit 6 requires PHP 7.0+ $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '6.5');