-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
| Q | A |
|---|---|
| Bug report? | yes |
| Feature request? | no |
| BC Break report? | no |
| RFC? | no |
| Symfony version | 4.0.3 |
Suppose we have defined such configuration in Configuration.php:
public function getConfigTreeBuilder()
{
$tree = new TreeBuilder();
$root = $tree->root('my_bundle');
$root
->children()
->floatNode('float_value')->end()
->end();
return $tree;
}Next we want to use environment variable for this configuration, as described here:
my_bundle:
float_value: "%env(float:MY_VALUE)%"After that we add MY_VALUE into .env file and try to run
php bin/console cache:clearThe execution result will be an error:
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In FloatNode.php line 34:
!!
!! Invalid type for path "my_bundle.float_value"
!! Expected float, but got string.
!!
!!
The command should be executed successfully.
Repository with code to reproduce this situation. The steps:
composer install
bin/console listnesl247, mavimo, lisachenko and ivannemets-sravniru