Skip to content

Commit 0556e40

Browse files
authored
Doc update: switch from array() to [] (#262)
1 parent 3b732f6 commit 0556e40

19 files changed

+99
-99
lines changed

docs/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Here, an example where we customize the `CKEditor config`_::
2020

2121
use FOS\CKEditorBundle\Form\Type\CKEditorType;
2222

23-
$builder->add('field', CKEditorType::class, array(
24-
'config' => array(
23+
$builder->add('field', CKEditorType::class, [
24+
'config' => [
2525
'uiColor' => '#ffffff',
2626
//...
27-
),
28-
));
27+
],
28+
]);
2929

3030
Installation
3131
------------

docs/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ If you're using Symfony < 4.0, update your ``app/AppKernel.php``:
3232
{
3333
public function registerBundles()
3434
{
35-
$bundles = array(
35+
$bundles = [
3636
new FOS\CKEditorBundle\FOSCKEditorBundle(),
3737
// ...
38-
);
38+
];
3939
4040
// ...
4141
}

docs/usage/autoinline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Or you can disable it for a specific widget:
1616

1717
.. code-block:: php
1818
19-
$builder->add('field', 'ckeditor', array('auto_inline' => false));
19+
$builder->add('field', 'ckeditor', ['auto_inline' => false]);
2020
2121
.. note::
2222

docs/usage/config.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ When you have defined a config, you can use it with the ``config_name`` option:
4242

4343
.. code-block:: php
4444
45-
$builder->add('field', 'ckeditor', array(
45+
$builder->add('field', 'ckeditor', [
4646
'config_name' => 'my_config',
47-
));
47+
]);
4848
4949
Override a configuration
5050
------------------------
@@ -54,10 +54,10 @@ If you want to override some parts of the defined config, you can still use the
5454

5555
.. code-block:: php
5656
57-
$builder->add('field', 'ckeditor', array(
57+
$builder->add('field', 'ckeditor', [
5858
'config_name' => 'my_config',
59-
'config' => array('uiColor' => '#ffffff'),
60-
));
59+
'config' => ['uiColor' => '#ffffff'],
60+
]);
6161
6262
Define default configuration
6363
----------------------------

docs/usage/file-browse-upload.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ Or you can configure it in your widget:
4545

4646
.. code-block:: php
4747
48-
$builder->add('field', 'ckeditor', array(
49-
'filebrowsers' => array(
48+
$builder->add('field', 'ckeditor', [
49+
'filebrowsers' => [
5050
'VideoUpload',
5151
'VideoBrowse',
52-
),
53-
));
52+
],
53+
]);
5454
5555
Routing Options
5656
---------------
@@ -88,13 +88,13 @@ Or you can configure it your widget:
8888

8989
.. code-block:: php
9090
91-
$builder->add('field', 'ckeditor', array(
92-
'config' => array(
91+
$builder->add('field', 'ckeditor', [
92+
'config' => [
9393
'filebrowserBrowseRoute' => 'my_route',
94-
'filebrowserBrowseRouteParameters' => array('slug' => 'my-slug'),
94+
'filebrowserBrowseRouteParameters' => ['slug' => 'my-slug'],
9595
'filebrowserBrowseRouteType' => UrlGeneratorInterface::ABSOLUTE_URL,
96-
),
97-
));
96+
],
97+
]);
9898
9999
Dynamic Routing
100100
~~~~~~~~~~~~~~~
@@ -108,17 +108,17 @@ but much more powerful closure and so make it aware of your dependencies:
108108
// A blog post...
109109
$post = $manager->find($id);
110110
111-
$builder->add('field', 'ckeditor', array(
112-
'config' => array(
111+
$builder->add('field', 'ckeditor', [
112+
'config' => [
113113
'filebrowserBrowseHandler' => function (RouterInterface $router) use ($post) {
114114
return $router->generate(
115115
'my_route',
116-
array('slug' => $post->getSlug()),
116+
['slug' => $post->getSlug()],
117117
UrlGeneratorInterface::ABSOLUTE_URL
118118
);
119119
},
120-
),
121-
));
120+
],
121+
]);
122122
123123
Integration with Other Projects
124124
-------------------------------

docs/usage/inline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Or you can configure it in your widget:
1515

1616
.. code-block:: php
1717
18-
$builder->add('field', 'ckeditor', array('inline' => true));
18+
$builder->add('field', 'ckeditor', ['inline' => true]);
1919
2020
.. _`Classic Editing`: http://docs.ckeditor.com/#!/guide/dev_framed
2121
.. _`Inline Editing`: http://docs.ckeditor.com/#!/guide/dev_inline

docs/usage/jquery.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Or you can do it in your widget:
2323

2424
.. code-block:: php
2525
26-
$builder->add('field', 'ckeditor', array('jquery' => true));
26+
$builder->add('field', 'ckeditor', ['jquery' => true]);
2727
2828
Use your Adapter
2929
----------------
@@ -42,7 +42,7 @@ Or you can configure it in your widget:
4242

4343
.. code-block:: php
4444
45-
$builder->add('field', 'ckeditor', array('jquery_path' => 'your/own/jquery.js'));
45+
$builder->add('field', 'ckeditor', ['jquery_path' => 'your/own/jquery.js']);
4646
4747
.. note::
4848

docs/usage/json-builder.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ pass your values as first argument:
3434

3535
.. code-block:: php
3636
37-
$builder->setValues(array('foo' => array('bar')));
37+
$builder->setValues(['foo' => ['bar']]);
3838
3939
Additionally, this method takes as second argument a path prefix (`PropertyAccess Component`_)
4040
which allows you to append your values where you want in the builder graph.
4141
So, the next sample is basically the equivalent of the precedent::
4242

43-
$builder->setValues(array('bar'), '[foo]');
43+
$builder->setValues(['bar'], '[foo]');
4444

4545
Append one value
4646
~~~~~~~~~~~~~~~~
@@ -94,16 +94,16 @@ Example
9494
// {"0":"foo","1":bar}
9595
echo $builder
9696
->setJsonEncodeOptions(JSON_FORCE_OBJECT)
97-
->setValues(array('foo'))
97+
->setValues(['foo'])
9898
->setValue('[1]', 'bar', false)
9999
->build();
100100
101101
// {"foo":["bar"],"baz":bat}
102102
echo $builder
103103
->reset()
104-
->setValues(array('foo' => array('bar')))
104+
->setValues(['foo' => ['bar']])
105105
->setValue('[baz]', 'bat', false)
106106
->build();
107107
108108
.. _`PHP documentation for json_decode()`: http://php.net/manual/en/function.json-encode.php
109-
.. _`PropertyAccess Component`: http://symfony.com/doc/current/components/property_access/index.html
109+
.. _`PropertyAccess Component`: http://symfony.com/doc/current/components/property_access/index.html

docs/usage/language.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ Or you can do it in your widget:
2929

3030
.. code-block:: php
3131
32-
$builder->add('field', 'ckeditor', array('config' => array(
32+
$builder->add('field', 'ckeditor', ['config' => [
3333
'language' => 'fr',
34-
)));
34+
]]);

docs/usage/loading.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Or you can disable it in your widget:
2323

2424
.. code-block:: php
2525
26-
$builder->add('field', 'ckeditor', array('autoload' => false));
26+
$builder->add('field', 'ckeditor', ['autoload' => false]);
2727
2828
.. note::
2929

@@ -54,10 +54,10 @@ Or you can configure it in your widget:
5454

5555
.. code-block:: php
5656
57-
$builder->add('field', 'ckeditor', array(
57+
$builder->add('field', 'ckeditor', [
5858
'autoload' => false,
5959
'async' => true,
60-
));
60+
]);
6161
6262
Then, install the third party bundles as explained in its
6363
`documentation <https://github.com/egeloen/IvoryFormExtraBundle/blob/master/Resources/doc/installation.md>`_.

0 commit comments

Comments
 (0)