@@ -40,9 +40,9 @@ as integration of other related components:
4040
4141 .. code-block :: php
4242
43- $container->loadFromExtension('framework', array(
43+ $container->loadFromExtension('framework', [
4444 'form' => true,
45- ) );
45+ ] );
4646
4747 Using the Bundle Extension
4848--------------------------
@@ -81,10 +81,10 @@ allow users to configure it with some configuration that looks like this:
8181 .. code-block :: php
8282
8383 // config/packages/acme_social.php
84- $container->loadFromExtension('acme_social', array(
84+ $container->loadFromExtension('acme_social', [
8585 'client_id' => 123,
8686 'client_secret' => 'your_secret',
87- ) );
87+ ] );
8888
8989 The basic idea is that instead of having the user override individual
9090parameters, you let the user configure just a few, specifically created,
@@ -129,36 +129,36 @@ automatically converts XML and YAML to an array).
129129For the configuration example in the previous section, the array passed to your
130130``load() `` method will look like this::
131131
132- array(
133- array(
134- 'twitter' => array(
132+ [
133+ [
134+ 'twitter' => [
135135 'client_id' => 123,
136136 'client_secret' => 'your_secret',
137- ) ,
138- ) ,
139- )
137+ ] ,
138+ ] ,
139+ ]
140140
141141Notice that this is an *array of arrays *, not just a single flat array of the
142142configuration values. This is intentional, as it allows Symfony to parse several
143143configuration resources. For example, if ``acme_social `` appears in another
144144configuration file - say ``config/packages/dev/acme_social.yaml `` - with
145145different values beneath it, the incoming array might look like this::
146146
147- array(
147+ [
148148 // values from config/packages/acme_social.yaml
149- array(
150- 'twitter' => array(
149+ [
150+ 'twitter' => [
151151 'client_id' => 123,
152152 'client_secret' => 'your_secret',
153- ) ,
154- ) ,
153+ ] ,
154+ ] ,
155155 // values from config/packages/dev/acme_social.yaml
156- array(
157- 'twitter' => array(
156+ [
157+ 'twitter' => [
158158 'client_id' => 456,
159- ) ,
160- ) ,
161- )
159+ ] ,
160+ ] ,
161+ ]
162162
163163The order of the two arrays depends on which one is set first.
164164
@@ -304,7 +304,7 @@ In your extension, you can load this and dynamically set its arguments::
304304
305305 public function load(array $configs, ContainerBuilder $container)
306306 {
307- $config = array() ;
307+ $config = [] ;
308308 // let resources override the previous set value
309309 foreach ($configs as $subConfig) {
310310 $config = array_merge($config, $subConfig);
0 commit comments