8000 minor #7017 Add empty parentheses to method names (bocharsky-bw) · symfony/symfony-docs@440ef36 · GitHub
[go: up one dir, main page]

Skip to content

Commit 440ef36

Browse files
committed
minor #7017 Add empty parentheses to method names (bocharsky-bw)
This PR was merged into the 2.7 branch. Discussion ---------- Add empty parentheses to method names Commits ------- 3cfaf38 Add empty parentheses to method names
2 parents bb31450 + 3cfaf38 commit 440ef36

File tree

96 files changed

+242
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+242
-242
lines changed

best_practices/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Using Expressions for Complex Security Restrictions
129129

130130
If your security logic is a little bit more complex, you can use an :doc:`expression </components/expression_language>`
131131
inside ``@Security``. In the following example, a user can only access the
132-
controller if their email matches the value returned by the ``getAuthorEmail``
132+
controller if their email matches the value returned by the ``getAuthorEmail()``
133133
method on the ``Post`` object:
134134

135135
.. code-block:: php
@@ -258,7 +258,7 @@ of magnitude easier than :doc:`ACLs </security/acl>` and will give
258258
you the flexibility you need in almost all cases.
259259

260260
First, create a voter class. The following example shows a voter that implements
261-
the same ``getAuthorEmail`` logic you used above:
261+
the same ``getAuthorEmail()`` logic you used above:
262262

263263
.. code-block:: php
264264

bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ but it is more common if you put these definitions in a configuration file
9090
the extension!
9191

9292
For instance, assume you have a file called ``services.xml`` in the
93-
``Resources/config`` directory of your bundle, your load method looks like::
93+
``Resources/config`` directory of your bundle, your ``load()`` method looks like::
9494

9595
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9696
use Symfony\Component\Config\FileLocator;

bundles/inheritance.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ simply by creating a file with the same name.
4040
Overriding Controllers
4141
~~~~~~~~~~~~~~~~~~~~~~
4242

43-
Suppose you want to add some functionality to the ``registerAction`` of a
43+
Suppose you want to add some functionality to the ``registerAction()`` of a
4444
``RegistrationController`` that lives inside FOSUserBundle. To do so,
4545
just create your own ``RegistrationController.php`` file, override the bundle's
4646
original method, and change its functionality::

changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Minor Documentation Changes
260260
* `#30 <https://github.com/symfony/symfony-docs/pull/30>`_ Moved the rest of the book chapters (javiereguiluz)
261261
* `#24 <https://github.com/symfony/symfony-docs/pull/24>`_ Moved book chapters out of the book (javiereguiluz)
262262
* `#20 <https://github.com/symfony/symfony-docs/pull/20>`_ Creating the Controller topic (xabbuh)
263-
* `#6747 <https://github.com/symfony/symfony-docs/pull/6747>`_ Correcting reference to ``isSuccessful`` method for Process (aedmonds)
263+
* `#6747 <https://github.com/symfony/symfony-docs/pull/6747>`_ Correcting reference to ``isSuccessful()`` method for Process (aedmonds)
264264
* `#6600 <https://github.com/symfony/symfony-docs/pull/6600>`_ Removing some extra details from #6444 (weaverryan)
265265
* `#6715 <https://github.com/symfony/symfony-docs/pull/6715>`_ [Book] Remove DI extension info and link the cookbook article instead (WouterJ)
266266
* `#6745 <https://github.com/symfony/symfony-docs/pull/6745>`_ Branch fix (Talita Kocjan Zager, weaverryan)

components/config/definition.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ methods::
475475
->defaultFalse()
476476
;
477477

478-
The ``canBeDisabled`` method looks about the same except that the section
478+
The ``canBeDisabled()`` method looks about the same except that the section
479479
would be enabled by default.
480480

481481
Merging Options
@@ -655,7 +655,7 @@ a second argument::
655655
->end()
656656
;
657657

658-
As well as fixing this, ``fixXmlConfig`` ensures that single XML elements
658+
As well as fixing this, ``fixXmlConfig()`` ensures that single XML elements
659659
are still turned into an array. So you may have:
660660

661661
.. code-block:: xml
@@ -671,7 +671,7 @@ and sometimes only:
671671
672672
By default ``connection`` would be an array in the first case and a string
673673
in the second making it difficult to validate. You can ensure it is always
674-
an array with ``fixXmlConfig``.
674+
an array with ``fixXmlConfig()``.
675675

676676
You can further control the normalization process if you need to. For example,
677677
you may want to allow a string to be set and used as a particular key or

components/console/changing_default_command.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Changing the Default Command
66

77
The Console component will always run the ``ListCommand`` when no command name is
88
passed. In order to change the default command you just need to pass the command
9-
name to the ``setDefaultCommand`` method::
9+
name to the ``setDefaultCommand()`` method::
1010

1111
namespace Acme\Console\Command;
1212

components/console/helpers/dialoghelper.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ Let the User Choose from a List of Answers
177177
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178178

179179
If you have a predefined set of answers the user can choose from, you
180-
could use the ``ask`` method described above or, to make sure the user
181-
provided a correct answer, the ``askAndValidate`` method. Both have
180+
could use the ``ask()`` method described above or, to make sure the user
181+
provided a correct answer, the ``askAndValidate()`` method. Both have
182182
the disadvantage that you need to handle incorrect values yourself.
183183

184184
Instead, you can use the

components/console/helpers/progresshelper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Progress Helper
55
===============
66

77
.. versionadded:: 2.3
8-
The ``setCurrent`` method was introduced in Symfony 2.3.
8+
The ``setCurrent()`` method was introduced in Symfony 2.3.
99

1010
.. caution::
1111

components/css_selector.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ long and unwieldy expressions.
3434

3535
Many developers -- particularly web developers -- are more comfortable
3636
using CSS selectors to find elements. As well as working in stylesheets,
37-
CSS selectors are used in JavaScript with the ``querySelectorAll`` function
37+
CSS selectors are used in JavaScript with the ``querySelectorAll()`` function
3838
and in popular JavaScript libraries such as jQuery, Prototype and MooTools.
3939

4040
CSS selectors are less powerful than XPath, but far easier to write, read

components/dependency_injection/compilation.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ and can be registered with the container with::
4444

4545
$container->registerExtension($extension);
4646

47-
The main work of the extension is done in the ``load`` method. In the ``load``
47+
The main work of the extension is done in the ``load()`` method. In the ``load()``
4848
method you can load configuration from one or more configuration files as
4949
well as manipulate the container definitions using the methods shown in
5050
:doc:`/service_container/definitions`.
5151

52-
The ``load`` method is passed a fresh container to set up, which is then
52+
The ``load()`` method is passed a fresh container to set up, which is then
5353
merged afterwards into the container it is registered with. This allows
5454
you to have several extensions managing container definitions independently.
5555
The extensions do not add to the containers configuration when they are
56-
added but are processed when the container's ``compile`` method is called.
56+
added but are processed when the container's ``compile()`` method is called.
5757

5858
A very simple extension may just load configuration files into the container::
5959

@@ -85,7 +85,7 @@ sections of config files loaded directly into the container as being for
8585
a particular extension. These sections on the config will not be processed
8686
directly by the container but by the relevant Extension.
8787

88-
The Extension must specify a ``getAlias`` method to implement the interface::
88+
The Extension must specify a ``getAlias()`` method to implement the interface::
8989

9090
// ...
9191

@@ -100,7 +100,7 @@ The Extension must specify a ``getAlias`` method to implement the interface::
100100
}
101101

102102
For YAML configuration files specifying the alias for the extension as a
103-
key will mean that those values are passed to the Extension's ``load`` method:
103+
key will mean that those values are passed to the Extension's ``load()`` method:
104104

105105
.. code-block:: yaml
106106
@@ -133,7 +133,7 @@ are loaded::
133133
or an exception will be thrown.
134134

135135
The values from those sections of the config files are passed into the first
136-
argument of the ``load`` method of the extension::
136+
argument of the ``load()`` method of the extension::
137137

138138
public function load(array $configs, ContainerBuilder $container)
139139
{
@@ -190,7 +190,7 @@ the XML configuration::
190190

191191
.. note::
192192

193-
XSD validation is optional, returning ``false`` from the ``getXsdValidationBasePath``
193+
XSD validation is optional, returning ``false`` from the ``getXsdValidationBasePath()``
194194
method will disable it.
195195

196196
The XML version of the config would then look like this:
@@ -316,7 +316,7 @@ interface. The compiler pass gives you an opportunity to manipulate the
316316
service definitions that have been compiled. This can be very powerful,
317317
but is not something needed in everyday use.
318318

319-
The compiler pass must have the ``process`` method which is passed the container
319+
The compiler pass must have the ``process()`` method which is passed the container
320320
being compiled::
321321

322322
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;

components/dom_crawler.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,13 @@ and :phpclass:`DOMNode` objects:
298298

299299
$html = $crawler->html();
300300

301-
The ``html`` method is new in Symfony 2.3.
301+
The ``html()`` method is new in Symfony 2.3.
302302

303303
Links
304304
~~~~~
305305

306306
To find a link by name (or a clickable image by its ``alt`` attribute), use
307-
the ``selectLink`` method on an existing crawler. This returns a Crawler
307+
the ``selectLink()`` method on an existing crawler. This returns a Crawler
308308
instance with just the selected link(s). Calling ``link()`` gives you a special
309309
:class:`Symfony\\Component\\DomCrawler\\Link` object::
310310

components/event_dispatcher.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ The ``addListener()`` method takes up to three arguments:
152152
A `PHP callable`_ is a PHP variable that can be used by the
153153
``call_user_func()`` function and returns ``true`` when passed to the
154154
``is_callable()`` function. It can be a ``\Closure`` instance, an object
155-
implementing an ``__invoke`` method (which is what closures are in fact),
155+
implementing an ``__invoke()`` method (which is what closures are in fact),
156156
a string representing a function or an array representing an object
157157
method or a class method.
158158

components/event_dispatcher/immutable_dispatcher.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Now, inject that into an ``ImmutableEventDispatcher``::
3535
You'll need to use this new dispatcher in your project.
3636

3737
If you are trying to execute one of the methods which modifies the dispatcher
38-
(e.g. ``addListener``), a ``BadMethodCallException`` is thrown.
38+
(e.g. ``addListener()``), a ``BadMethodCallException`` is thrown.

components/filesystem/lock_handler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ second argument of the constructor.
5454

5555
The :method:`Symfony\\Component\\Filesystem\\LockHandler::lock` method tries to
5656
acquire the lock. If the lock is acquired, the method returns ``true``,
57-
``false`` otherwise. If the ``lock`` method is called several times on the same
57+
``false`` otherwise. If the ``lock()`` method is called several times on the same
5858
instance it will always return ``true`` if the lock was acquired on the first
5959
call.
6060

components/form.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ Creating a simple Form
369369
If you're using the Symfony Framework, then the form factory is available
370370
automatically as a service called ``form.factory``. Also, the default
371371
base controller class has a :method:`Symfony\\Bundle\\FrameworkBundle\\Controller::createFormBuilder`
372-
method, which is a shortcut to fetch the form factory and call ``createBuilder``
372+
method, which is a shortcut to fetch the form factory and call ``createBuilder()``
373373
on it.
374374

375375
Creating a form is done via a :class:`Symfony\\Component\\Form\\FormBuilder`
@@ -414,8 +414,8 @@ is created from the form factory.
414414
}
415415
}
416416
417-
As you can see, creating a form is like writing a recipe: you call ``add``
418-
for each new field you want to create. The first argument to ``add`` is the
417+
As you can see, creating a form is like writing a recipe: you call ``add()``
418+
for each new field you want to create. The first argument to ``add()`` is the
419419
name of your field, and the second is the field "type". The Form component
420420
comes with a lot of :doc:`built-in types </reference/forms/types>`.
421421

@@ -685,7 +685,7 @@ method to access the list of errors. It returns a
685685

686686
$errorsAsArray = iterator_to_array($form->getErrors());
687687

688-
This is useful, for example, if you want to use PHP's ``array_`` function
688+
This is useful, for example, if you want to use PHP's ``array_*()`` function
689689
on the form errors.
690690

691691
Learn more

components/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The HttpFoundation Component
1111

1212
In PHP, the request is represented by some global variables (``$_GET``,
1313
``$_POST``, ``$_FILES``, ``$_COOKIE``, ``$_SESSION``, ...) and the response is
14-
generated by some functions (``echo``, ``header``, ``setcookie``, ...).
14+
generated by some functions (``echo``, ``header()``, ``setcookie()``, ...).
1515

1616
The Symfony HttpFoundation component replaces these default PHP global
1717
variables and functions by an object-oriented layer.

components/http_kernel.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ and is one of the constructor arguments to ``HttpKernel``.
209209
:align: center
210210

211211
Your job is to create a class that implements the interface and fill in its
212-
two methods: ``getController`` and ``getArguments``. In fact, one default
212+
two methods: ``getController()`` and ``getArguments()``. In fact, one default
213213
implementation already exists, which you can use directly or learn from:
214214
:class:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver`.
215215
This implementation is explained more in the sidebar below::
@@ -225,7 +225,7 @@ This implementation is explained more in the sidebar below::
225225
public function getArguments(Request $request, $controller);
226226
}
227227

228-
Internally, the ``HttpKernel::handle`` method first calls
228+
Internally, the ``HttpKernel::handle()`` method first calls
229229
:method:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface::getController`
230230
on the controller resolver. This method is passed the ``Request`` and is responsible
231231
for somehow determining and returning a PHP callable (the controller) based
@@ -260,7 +260,7 @@ will be called after another event - ``kernel.controller`` - is dispatched.
260260
constructor arguments.
261261

262262
c) If the controller implements :class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface`,
263-
``setContainer`` is called on the controller object and the container
263+
``setContainer()`` is called on the controller object and the container
264264
is passed to it. This step is also specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver`
265265
sub-class used by the Symfony Framework.
266266

@@ -274,7 +274,7 @@ the controller is executed.
274274

275275
:ref:`Kernel Events Information Table <component-http-kernel-event-table>`
276276

277-
After the controller callable has been determined, ``HttpKernel::handle``
277+
After the controller callable has been determined, ``HttpKernel::handle()``
278278
dispatches the ``kernel.controller`` event. Listeners to this event might initialize
279279
some part of the system that needs to be initialized after certain things
280280
have been determined (e.g. the controller, routing information) but before
@@ -306,10 +306,10 @@ on the event object that's passed to listeners on this event.
306306
4) Getting the Controller Arguments
307307
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308308

309-
Next, ``HttpKernel::handle`` calls
309+
Next, ``HttpKernel::handle()`` calls
310310
:method:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface::getArguments`.
311-
Remember that the controller returned in ``getController`` is a callable.
312-
The purpose of ``getArguments`` is to return the array of arguments that
311+
Remember that the controller returned in ``getController()`` is a callable.
312+
The purpose of ``getArguments()`` is to return the array of arguments that
313313
should be passed to that controller. Exactly how this is done is completely
314314
up to your design, though the built-in :class:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver`
315315
is a good example.
@@ -343,7 +343,7 @@ of arguments that should be passed when executing that callable.
343343
5) Calling the Controller
344344
~~~~~~~~~~~~~~~~~~~~~~~~~
345345

346-
The next step is simple! ``HttpKernel::handle`` executes the controller.
346+
The next step is simple! ``HttpKernel::handle()`` executes the controller.
347347

348348
.. image:: /_images/components/http_kernel/08-call-controller.png
349349
:align: center
@@ -464,7 +464,7 @@ been streamed to the user
464464
:ref:`Kernel Events Information Table <component-http-kernel-event-table>`
465465

466466
The final event of the HttpKernel process is ``kernel.terminate`` and is unique
467-
because it occurs *after* the ``HttpKernel::handle`` method, and after the
467+
because it occurs *after* the ``HttpKernel::handle()`` method, and after the
468468
response is sent to the user. Recall from above, then the code that uses
469469
the kernel, ends like this::
470470

@@ -509,8 +509,8 @@ Handling Exceptions: the ``kernel.exception`` Event
509509

510510
:ref:`Kernel Events Information Table <component-http-kernel-event-table>`
511511

512-
If an exception is thrown at any point inside ``HttpKernel::handle``, another
513-
event - ``kernel.exception`` is thrown. Internally, the body of the ``handle``
512+
If an exception is thrown at any point inside ``HttpKernel::handle()``, another
513+
event - ``kernel.exception`` is thrown. Internally, the body of the ``handle()``
514514
function is wrapped in a try-catch block. When any exception is thrown, the
515515
``kernel.exception`` event is dispatched so that your system can somehow respond
516516
to the exception.
@@ -554,7 +554,7 @@ below for more details).
554554

555555
2) If the original exception implements
556556
:class:`Symfony\\Component\\HttpKernel\\Exception\\HttpExceptionInterface`,
557-
then ``getStatusCode`` and ``getHeaders`` are called on the exception
557+
then ``getStatusCode()`` and ``getHeaders()`` are called on the exception
558558
and used to populate the headers and status code of the ``FlattenException``
559559
object. The idea is that these are used in the next step when creating
560560
the final response.
@@ -577,7 +577,7 @@ Creating an Event Listener
577577
--------------------------
578578

579579
As you've seen, you can create and attach event listeners to any of the events
580-
dispatched during the ``HttpKernel::handle`` cycle. Typically a listener is a PHP
580+
dispatched during the ``HttpKernel::handle()`` cycle. Typically a listener is a PHP
581581
class with a method that's executed, but it can be anything. For more information
582582
on creating and attaching event listeners, see :doc:`/components/event_dispatcher`.
583583

@@ -653,7 +653,7 @@ a built-in ControllerResolver that can be used to create a working example::
653653
Sub Requests
654654
------------
655655

656-
In addition to the "main" request that's sent into ``HttpKernel::handle``,
656+
In addition to the "main" request that's sent into ``HttpKernel::handle()``,
657657
you can also send so-called "sub request". A sub request looks and acts like
658658
any other request, but typically serves to render just one small portion of
659659
a page instead of a full page. You'll most commonly make sub-requests from
@@ -663,7 +663,7 @@ your controller).
663663
.. image:: /_images/components/http_kernel/sub-request.png
664664
:align: center
665665

666-
To execute a sub request, use ``HttpKernel::handle``, but change the second
666+
To execute a sub request, use ``HttpKernel::handle()``, but change the second
667667
argument as follows::
668668

669669
use Symfony\Component\HttpFoundation\Request;

components/phpunit_bridge.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ There are four ways to mark a test as legacy:
7979

8080
* Make its class name start with the ``Legacy`` prefix;
8181

82-
* Make its method name start with ``testLegacy`` instead of ``test``;
82+
* Make its method name start with ``testLegacy*()`` instead of ``test*()``;
8383

84-
* Make its data provider start with ``provideLegacy`` or ``getLegacy``.
84+
* Make its data provider start with ``provideLegacy*()`` or ``getLegacy*()``.
8585

8686
Configuration
8787
-------------

0 commit comments

Comments
 (0)
0