Skip to content

Commit 72d3722

Browse files
committed
CS Fixes: lowercase null constants
1 parent c4a8041 commit 72d3722

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

+5
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,11 @@ private function exportParameters($parameters, $path = '', $indent = 12)
10721072
throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain expressions. Expression "%s" found in "%s".', $value, $path.'/'.$key));
10731073
} else {
10741074
$value = $this->export($value);
1075+
1076+
// If exported value is `null` then standardize it: `true` and `false` are exported in lower-case, so let do the same with `null`.
1077+
if ('NULL' === $value) {
1078+
$value = 'null';
1079+
}
10751080
}
10761081

10771082
$php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value);

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct()
3131
'values' => array(
3232
0 => true,
3333
1 => false,
34-
2 => NULL,
34+
2 => null,
3535
3 => 0,
3636
4 => 1000.3,
3737
5 => 'true',

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ protected function getMethodCall1Service()
268268
$this->services['method_call1'] = $instance = new \Bar\FooClass();
269269

270270
$instance->setBar($this->get('foo'));
271-
$instance->setBar(NULL);
272-
$instance->setBar(($this->get("foo")->foo() . (($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
271+
$instance->setBar(null);
272+
$instance->setBar(($this->get("foo")->foo().(($this->hasparameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
273273

274274
return $instance;
275275
}

0 commit comments

Comments
 (0)