In the Symfony coding standards it says: >
Use camelCase, not underscores, for variable, function and method names, arguments;
Use underscores for option names and parameter names;
In this context, what is the difference between parameters and arguments?
I think I understand the option names part (i.e. when you have an $options array, like in the code example on that page) but what qualifies as a 'parameter'?
I think that when array values are used as options (have the meaning of), in general.
For example in forms:
public function getDefaultOptions(array $options)
{
return array(
'validation_groups' => array('registration')
);
}
In your bundle configuration:
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('acme_hello');
$rootNode
->children()
->scalarNode('my_type')->defaultValue('bar')->end()
->end();
return $treeBuilder;
}
}
In container parameters:
# app/config/config.yml
parameters:
my_mailer.class: Acme\HelloBundle\Mailer
my_mailer.transport: sendmail
services:
my_mailer:
class: "%my_mailer.class%"
arguments: ["%my_mailer.transport%"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With