From 72d37221d15fa593e209a628a989781e22f49a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dariusz=20Rumi=C5=84ski?= Date: Sun, 7 Dec 2014 00:51:18 +0100 Subject: [PATCH] CS Fixes: lowercase null constants --- .../Component/DependencyInjection/Dumper/PhpDumper.php | 5 +++++ .../DependencyInjection/Tests/Fixtures/php/services8.php | 2 +- .../Tests/Fixtures/php/services9_compiled.php | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 11cae7a97ad56..5b266ba9edc04 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1072,6 +1072,11 @@ private function exportParameters($parameters, $path = '', $indent = 12) throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key)); } else { $value = $this->export($value); + + // If exported value is `null` then standardize it: `true` and `false` are exported in lower-case, so let do the same with `null`. + if ('NULL' === $value) { + $value = 'null'; + } } $php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php index a6de38e381bae..067128e423ac6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php @@ -31,7 +31,7 @@ public function __construct() 'values' => array( 0 => true, 1 => false, - 2 => NULL, + 2 => null, 3 => 0, 4 => 1000.3, 5 => 'true', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php index 7d03bd5b8b0d8..4f58969522571 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php @@ -268,8 +268,8 @@ protected function getMethodCall1Service() $this->services['method_call1'] = $instance = new \Bar\FooClass(); $instance->setBar($this->get('foo')); - $instance->setBar(NULL); - $instance->setBar(($this->get("foo")->foo() . (($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default")))); + $instance->setBar(null); + $instance->setBar(($this->get("foo")->foo().(($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default")))); return $instance; }