From be04c5000c1bc7865530228a25b4c57276b550b5 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Sat, 26 Jul 2014 11:54:23 +0200 Subject: [PATCH] Unify null comparisons --- .../Doctrine/ContainerAwareEventManager.php | 2 +- .../DependencyInjection/Configuration.php | 2 +- .../views/Form/choice_widget_collapsed.html.php | 2 +- .../Bundle/FrameworkBundle/Test/WebTestCase.php | 4 ++-- .../Resources/views/Collector/time.html.twig | 2 +- .../Resources/views/Profiler/layout.html.twig | 16 ++++++++-------- .../Tests/Definition/Builder/ExprBuilderTest.php | 2 +- .../Finder/Tests/Iterator/MockSplFileInfo.php | 6 +++--- .../ViolationMapper/ViolationPathTest.php | 2 +- .../RememberMe/AbstractRememberMeServices.php | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php b/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php index ac21ece6e0..5f6902d4a4 100644 --- a/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php +++ b/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php @@ -49,7 +49,7 @@ class ContainerAwareEventManager extends EventManager public function dispatchEvent($eventName, EventArgs $eventArgs = null) { if (isset($this->listeners[$eventName])) { - $eventArgs = $eventArgs === null ? EventArgs::getEmptyInstance() : $eventArgs; + $eventArgs = null === $eventArgs ? EventArgs::getEmptyInstance() : $eventArgs; $initialized = isset($this->initialized[$eventName]); diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 852f8ba424..fc6a6ade56 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -41,7 +41,7 @@ class Configuration implements ConfigurationInterface ->end() ->arrayNode('trusted_proxies') ->beforeNormalization() - ->ifTrue(function ($v) { return !is_array($v) && !is_null($v); }) + ->ifTrue(function ($v) { return !is_array($v) && null !== $v; }) ->then(function ($v) { return is_bool($v) ? array() : preg_split('/\s*,\s*/', $v); }) ->end() ->prototype('scalar') diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php index 345be23b03..be78e46e8c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php @@ -1,5 +1,5 @@