From 7a132fe1561efb31d861b5bfbc69fa6583a3f3e2 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 4 Jan 2019 16:09:47 +0100 Subject: [PATCH] remove no longer needed PHP version checks --- .../Tests/Console/Descriptor/ObjectsProvider.php | 9 ++------- .../Tests/Debug/WrappedListenerTest.php | 13 ++++--------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php index 12e81898bf5f..7cb887684fea 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php @@ -155,7 +155,7 @@ public static function getEventDispatchers() public static function getCallables() { - $callables = array( + return array( 'callable_1' => 'array_key_exists', 'callable_2' => array('Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass', 'staticMethod'), 'callable_3' => array(new CallableClass(), 'method'), @@ -163,13 +163,8 @@ public static function getCallables() 'callable_5' => array('Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\ExtendedCallableClass', 'parent::staticMethod'), 'callable_6' => function () { return 'Closure'; }, 'callable_7' => new CallableClass(), + 'callable_from_callable' => \Closure::fromCallable(new CallableClass()), ); - - if (\PHP_VERSION_ID >= 70100) { - $callables['callable_from_callable'] = \Closure::fromCallable(new CallableClass()); - } - - return $callables; } } diff --git a/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php b/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php index f743f148d2d2..3847a1553c76 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/Debug/WrappedListenerTest.php @@ -30,21 +30,16 @@ public function testListenerDescription(callable $listener, $expected) public function provideListenersToDescribe() { - $listeners = array( + return array( array(new FooListener(), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::__invoke'), array(array(new FooListener(), 'listen'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'), array(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'), array('var_dump', 'var_dump'), array(function () {}, 'closure'), + array(\Closure::fromCallable(array(new FooListener(), 'listen')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'), + array(\Closure::fromCallable(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'), + array(\Closure::fromCallable(function () {}), 'closure'), ); - - if (\PHP_VERSION_ID >= 70100) { - $listeners[] = array(\Closure::fromCallable(array(new FooListener(), 'listen')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'); - $listeners[] = array(\Closure::fromCallable(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'); - $listeners[] = array(\Closure::fromCallable(function () {}), 'closure'); - } - - return $listeners; } }