You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when i see var/cache/devSymfony/Framework/RouterConfig.php, i have this code in toArray():
if (null !== $this->strictRequirements) {
$output['strict_requirements'] = $this->strictRequirements;
}
Problem: final value will not be null as configured and expected, but true, because it's the default value.
I can configure it in yaml, it works, and it's the default configuration when we create a project:
framework:
router:
strict_requirements: null
How to reproduce
Create a new project, then add in src/Kernel.php to read PHP configuration files:
This PR was merged into the 5.4 branch.
Discussion
----------
[Config] Fix using null values with config builders
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#45782
| License | MIT
| Doc PR | -
The generated config builders will no longer discard `null` values.
Commits
-------
1264225 [Config] Fix using null values with config builders
Symfony version(s) affected
6.0.5
Description
When i change yaml configuration file format to PHP in
config/packages
directory, i have this code forrouting.php
:But when i see
var/cache/devSymfony/Framework/RouterConfig.php
, i have this code intoArray()
:Problem: final value will not be
null
as configured and expected, buttrue
, because it's the default value.I can configure it in yaml, it works, and it's the default configuration when we create a project:
How to reproduce
Create a new project, then add in
src/Kernel.php
to read PHP configuration files:Another little problem: in the documentation (https://symfony.com/doc/current/configuration.html#using-php-configbuilders) we may think PHP configuration files are always readed, but that's not the case, we need to modify the Kernel to take this files into account.
Possible Solution
Allow passing
null
when configuration allow this value?Additional Context
No response
The text was updated successfully, but these errors were encountered: