Skip to content

[2.6] CS Fixes: lowercase null constants #12879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do the same for TRUE and FALSE, but frankly, we don't care as we are talking about generated code.

if ('NULL' === $value) {
$value = 'null';
}
}

$php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct()
'values' => array(
0 => true,
1 => false,
2 => NULL,
2 => null,
3 => 0,
4 => 1000.3,
5 => 'true',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also generated code so that's going to break the tests.


return $instance;
}
Expand Down