Skip to content

Commit

Permalink
minor #29778 remove no longer needed PHP version checks (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.1 branch.

Discussion
----------

remove no longer needed PHP version checks

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

7a132fe remove no longer needed PHP version checks
  • Loading branch information
fabpot committed Jan 4, 2019
2 parents 2d84041 + 7a132fe commit 34c8a8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Expand Up @@ -155,21 +155,16 @@ 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'),
'callable_4' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\CallableClass::staticMethod',
'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;
}
}

Expand Down
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 34c8a8b

Please sign in to comment.