Symfony coding standards - arguments and parameters Symfony coding standards - arguments and parameters symfony symfony

Symfony coding standards - arguments and parameters


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.ymlparameters:    my_mailer.class:      Acme\HelloBundle\Mailer    my_mailer.transport:  sendmailservices:    my_mailer:        class:        "%my_mailer.class%"        arguments:    ["%my_mailer.transport%"]