I believe my configuration to be correct but I want defaults for my redis port and scheme configurations option but they are coming out as nulls?
Can anyone see what the issue is?
Here is my configuration.
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('company_name');
$rootNode
->children()
->arrayNode('cache')
->children()
->arrayNode('redis')
->addDefaultsIfNotSet()
->treatNullLike([
'scheme' => 'tcp',
'port' => 6379,
])
->children()
->scalarNode('scheme')
->defaultValue('tcp')
->end()
->scalarNode('host')
->isRequired()
->cannotBeEmpty()
->end()
->integerNode('port')
->defaultValue(6379)
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
And here is my parameters.yml file
parameters:
company_name:
cache:
redis:
host: dev-sessionstore.companyname.com
schema: ~
port: ~
Console output:
$ php bin/console config:dump-reference CompanyNameCacheBundle
# Default configuration for "CompanyNameCacheBundle"
company_name:
cache:
redis:
namespace: apps
scheme: tcp
host: ~ # Required
port: 6379
apcu:
namespace: phpcache
I want the scheme and port to use default values but what's causing them to be null?
