Skip to content

Commit

Permalink
Doc update: switch from array() to []
Browse files Browse the repository at this point in the history
  • Loading branch information
Nek- committed May 13, 2024
1 parent 9d4cd4f commit 069e672
Show file tree
Hide file tree
Showing 19 changed files with 99 additions and 99 deletions.
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Here, an example where we customize the `CKEditor config`_::

use FOS\CKEditorBundle\Form\Type\CKEditorType;

$builder->add('field', CKEditorType::class, array(
'config' => array(
$builder->add('field', CKEditorType::class, [
'config' => [
'uiColor' => '#ffffff',
//...
),
));
],
]);

Installation
------------
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ If you're using Symfony < 4.0, update your ``app/AppKernel.php``:
{
public function registerBundles()
{
$bundles = array(
$bundles = [
new FOS\CKEditorBundle\FOSCKEditorBundle(),
// ...
);
];
// ...
}
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/autoinline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Or you can disable it for a specific widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array('auto_inline' => false));
$builder->add('field', 'ckeditor', ['auto_inline' => false]);
.. note::

Expand Down
10 changes: 5 additions & 5 deletions docs/usage/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ When you have defined a config, you can use it with the ``config_name`` option:

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

.. code-block:: php
$builder->add('field', 'ckeditor', array(
$builder->add('field', 'ckeditor', [
'config_name' => 'my_config',
'config' => array('uiColor' => '#ffffff'),
));
'config' => ['uiColor' => '#ffffff'],
]);
Define default configuration
----------------------------
Expand Down
28 changes: 14 additions & 14 deletions docs/usage/file-browse-upload.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ Or you can configure it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'filebrowsers' => array(
$builder->add('field', 'ckeditor', [
'filebrowsers' => [
'VideoUpload',
'VideoBrowse',
),
));
],
]);
Routing Options
---------------
Expand Down Expand Up @@ -88,13 +88,13 @@ Or you can configure it your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'config' => array(
$builder->add('field', 'ckeditor', [
'config' => [
'filebrowserBrowseRoute' => 'my_route',
'filebrowserBrowseRouteParameters' => array('slug' => 'my-slug'),
'filebrowserBrowseRouteParameters' => ['slug' => 'my-slug'],
'filebrowserBrowseRouteType' => UrlGeneratorInterface::ABSOLUTE_URL,
),
));
],
]);
Dynamic Routing
~~~~~~~~~~~~~~~
Expand All @@ -108,17 +108,17 @@ but much more powerful closure and so make it aware of your dependencies:
// A blog post...
$post = $manager->find($id);
$builder->add('field', 'ckeditor', array(
'config' => array(
$builder->add('field', 'ckeditor', [
'config' => [
'filebrowserBrowseHandler' => function (RouterInterface $router) use ($post) {
return $router->generate(
'my_route',
array('slug' => $post->getSlug()),
['slug' => $post->getSlug()],
UrlGeneratorInterface::ABSOLUTE_URL
);
},
),
));
],
]);
Integration with Other Projects
-------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/inline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Or you can configure it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array('inline' => true));
$builder->add('field', 'ckeditor', ['inline' => true]);
.. _`Classic Editing`: http://docs.ckeditor.com/#!/guide/dev_framed
.. _`Inline Editing`: http://docs.ckeditor.com/#!/guide/dev_inline
4 changes: 2 additions & 2 deletions docs/usage/jquery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Or you can do it in your widget:

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

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

Expand Down
10 changes: 5 additions & 5 deletions docs/usage/json-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ pass your values as first argument:

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

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

Append one value
~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -94,16 +94,16 @@ Example
// {"0":"foo","1":bar}
echo $builder
->setJsonEncodeOptions(JSON_FORCE_OBJECT)
->setValues(array('foo'))
->setValues(['foo'])
->setValue('[1]', 'bar', false)
->build();
// {"foo":["bar"],"baz":bat}
echo $builder
->reset()
->setValues(array('foo' => array('bar')))
->setValues(['foo' => ['bar']])
->setValue('[baz]', 'bat', false)
->build();
.. _`PHP documentation for json_decode()`: http://php.net/manual/en/function.json-encode.php
.. _`PropertyAccess Component`: http://symfony.com/doc/current/components/property_access/index.html
.. _`PropertyAccess Component`: http://symfony.com/doc/current/components/property_access/index.html
4 changes: 2 additions & 2 deletions docs/usage/language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Or you can do it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array('config' => array(
$builder->add('field', 'ckeditor', ['config' => [
'language' => 'fr',
)));
]]);
6 changes: 3 additions & 3 deletions docs/usage/loading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Or you can disable it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array('autoload' => false));
$builder->add('field', 'ckeditor', ['autoload' => false]);
.. note::

Expand Down Expand Up @@ -54,10 +54,10 @@ Or you can configure it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
$builder->add('field', 'ckeditor', [
'autoload' => false,
'async' => true,
));
]);
Then, install the third party bundles as explained in its
`documentation <https://github.com/egeloen/IvoryFormExtraBundle/blob/master/Resources/doc/installation.md>`_.
Expand Down
16 changes: 8 additions & 8 deletions docs/usage/plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ Or you can do it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'config' => array(
$builder->add('field', 'ckeditor', [
'config' => [
'extraPlugins' => 'wordcount',
),
'plugins' => array(
'wordcount' => array(
],
'plugins' => [
'wordcount' => [
'path' => '/bundles/mybundle/wordcount/', // with trailing slash
'filename' => 'plugin.js',
),
),
));
],
],
]);
Plugin dependency
-----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/require-js.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Or you can configure it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array('require_js' => true));
$builder->add('field', 'ckeditor', ['require_js' => true]);
6 changes: 3 additions & 3 deletions docs/usage/skin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Or you can do it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'config' => array('skin' => 'skin_name,/bundles/mybundle/skins/skin_name/'),
));
$builder->add('field', 'ckeditor', [
'config' => ['skin' => 'skin_name,/bundles/mybundle/skins/skin_name/'],
]);
.. note::

Expand Down
24 changes: 12 additions & 12 deletions docs/usage/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ Or you can define them in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'config' => array(
$builder->add('field', 'ckeditor', [
'config' => [
'stylesSet' => 'my_styles',
),
'styles' => array(
'my_styles' => array(
array('name' => 'Blue Title', 'element' => 'h2', 'styles' => array('color' => 'Blue')),
array('name' => 'CSS Style', 'element' => 'span', 'attributes' => array('class' => 'my_style')),
array('name' => 'Multiple Element Style', 'element' => array('h2', 'span'), 'attributes' => array('class' => 'my_class')),
array('name' => 'Widget Style', 'type' => 'widget' , 'widget' => 'my_widget', 'attributes' => array('class' => 'my_widget_style')),
),
),
));
],
'styles' => [
'my_styles' => [
['name' => 'Blue Title', 'element' => 'h2', 'styles' => ['color' => 'Blue']],
['name' => 'CSS Style', 'element' => 'span', 'attributes' => ['class' => 'my_style']],
['name' => 'Multiple Element Style', 'element' => ['h2', 'span'], 'attributes' => ['class' => 'my_class']],
['name' => 'Widget Style', 'type' => 'widget' , 'widget' => 'my_widget', 'attributes' => ['class' => 'my_widget_style']],
],
],
]);
58 changes: 29 additions & 29 deletions docs/usage/template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Or you can define it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'config' => array(
$builder->add('field', 'ckeditor', [
'config' => [
'extraPlugins' => 'templates',
),
));
],
]);
Configure your templates
------------------------
Expand Down Expand Up @@ -53,26 +53,26 @@ Or you can define them in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'config' => array(
$builder->add('field', 'ckeditor', [
'config' => [
'extraPlugins' => 'templates',
'templates' => 'my_template',
),
'templates' => array(
'my_template' => array(
],
'templates' => [
'my_template' => [
'imagesPath' => '/bundles/mybundle/templates/images',
'templates' => array(
array(
'templates' => [
[
'title' => 'My Template',
'image' => 'images.jpg',
'description' => 'My awesome template',
'html' => '<p>Crazy template :)</p>',
),
],
// ...
),
),
),
));
],
],
],
]);
Use a dedicated template
------------------------
Expand Down Expand Up @@ -107,24 +107,24 @@ Or you can define them in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array(
'config' => array(
$builder->add('field', 'ckeditor', [
'config' => [
'extraPlugins' => 'templates',
'templates' => 'my_template',
),
'templates' => array(
'my_template' => array(
],
'templates' => [
'my_template' => [
'imagesPath' => '/bundles/mybundle/templates/images',
'templates' => array(
array(
'templates' => [
[
'title' => 'My Template',
'image' => 'images.jpg',
'description' => 'My awesome template',
'template' => 'AppBundle:CKEditor:template.html.twig',
'template_parameters' => array('foo' => 'bar'),
),
'template_parameters' => ['foo' => 'bar'],
],
// ...
),
),
),
));
],
],
],
]);
2 changes: 1 addition & 1 deletion docs/usage/textarea-fallback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Or you can disable it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array('enable' => false));
$builder->add('field', 'ckeditor', ['enable' => false]);
2 changes: 1 addition & 1 deletion docs/usage/textarea-sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Or you can do it in your widget:

.. code-block:: php
$builder->add('field', 'ckeditor', array('input_sync' => true));
$builder->add('field', 'ckeditor', ['input_sync' => true]);
Loading

0 comments on commit 069e672

Please sign in to comment.