Skip to content

Add empty parentheses to method names #7017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions best_practices/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Using Expressions for Complex Security Restrictions

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

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

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

.. code-block:: php

Expand Down
2 changes: 1 addition & 1 deletion bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ but it is more common if you put these definitions in a configuration file
the extension!

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

use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Config\FileLocator;
Expand Down
2 changes: 1 addition & 1 deletion bundles/inheritance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ simply by creating a file with the same name.
Overriding Controllers
~~~~~~~~~~~~~~~~~~~~~~

Suppose you want to add some functionality to the ``registerAction`` of a
Suppose you want to add some functionality to the ``registerAction()`` of a
``RegistrationController`` that lives inside FOSUserBundle. To do so,
just create your own ``RegistrationController.php`` file, override the bundle's
original method, and change its functionality::
Expand Down
2 changes: 1 addition & 1 deletion changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Minor Documentation Changes
* `#30 <https://github.com/symfony/symfony-docs/pull/30>`_ Moved the rest of the book chapters (javiereguiluz)
* `#24 <https://github.com/symfony/symfony-docs/pull/24>`_ Moved book chapters out of the book (javiereguiluz)
* `#20 <https://github.com/symfony/symfony-docs/pull/20>`_ Creating the Controller topic (xabbuh)
* `#6747 <https://github.com/symfony/symfony-docs/pull/6747>`_ Correcting reference to ``isSuccessful`` method for Process (aedmonds)
* `#6747 <https://github.com/symfony/symfony-docs/pull/6747>`_ Correcting reference to ``isSuccessful()`` method for Process (aedmonds)
* `#6600 <https://github.com/symfony/symfony-docs/pull/6600>`_ Removing some extra details from #6444 (weaverryan)
* `#6715 <https://github.com/symfony/symfony-docs/pull/6715>`_ [Book] Remove DI extension info and link the cookbook article instead (WouterJ)
* `#6745 <https://github.com/symfony/symfony-docs/pull/6745>`_ Branch fix (Talita Kocjan Zager, weaverryan)
Expand Down
6 changes: 3 additions & 3 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ methods::
->defaultFalse()
;

The ``canBeDisabled`` method looks about the same except that the section
The ``canBeDisabled()`` method looks about the same except that the section
would be enabled by default.

Merging Options
Expand Down Expand Up @@ -655,7 +655,7 @@ a second argument::
->end()
;

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

.. code-block:: xml
Expand All @@ -671,7 +671,7 @@ and sometimes only:

By default ``connection`` would be an array in the first case and a string
in the second making it difficult to validate. You can ensure it is always
an array with ``fixXmlConfig``.
an array with ``fixXmlConfig()``.

You can further control the normalization process if you need to. For example,
you may want to allow a string to be set and used as a particular key or
Expand Down
2 changes: 1 addition & 1 deletion components/console/changing_default_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Changing the Default Command

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

namespace Acme\Console\Command;

Expand Down
4 changes: 2 additions & 2 deletions components/console/helpers/dialoghelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ Let the User Choose from a List of Answers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Instead, you can use the
Expand Down
2 changes: 1 addition & 1 deletion components/console/helpers/progresshelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Progress Helper
===============

.. versionadded:: 2.3
The ``setCurrent`` method was introduced in Symfony 2.3.
The ``setCurrent()`` method was introduced in Symfony 2.3.

.. caution::

Expand Down
2 changes: 1 addition & 1 deletion components/css_selector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ long and unwieldy expressions.

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

CSS selectors are less powerful than XPath, but far easier to write, read
Expand Down
16 changes: 8 additions & 8 deletions components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ and can be registered with the container with::

$container->registerExtension($extension);

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

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

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

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

The Extension must specify a ``getAlias`` method to implement the interface::
The Extension must specify a ``getAlias()`` method to implement the interface::

// ...

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

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

.. code-block:: yaml

Expand Down Expand Up @@ -133,7 +133,7 @@ are loaded::
or an exception will be thrown.

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

public function load(array $configs, ContainerBuilder $container)
{
Expand Down Expand Up @@ -190,7 +190,7 @@ the XML configuration::

.. note::

XSD validation is optional, returning ``false`` from the ``getXsdValidationBasePath``
XSD validation is optional, returning ``false`` from the ``getXsdValidationBasePath()``
method will disable it.

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

The compiler pass must have the ``process`` method which is passed the container
The compiler pass must have the ``process()`` method which is passed the container
being compiled::

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
Expand Down
4 changes: 2 additions & 2 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ and :phpclass:`DOMNode` objects:

$html = $crawler->html();

The ``html`` method is new in Symfony 2.3.
The ``html()`` method is new in Symfony 2.3.

Links
~~~~~

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

Expand Down
2 changes: 1 addition & 1 deletion components/event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ The ``addListener()`` method takes up to three arguments:
A `PHP callable`_ is a PHP variable that can be used by the
``call_user_func()`` function and returns ``true`` when passed to the
``is_callable()`` function. It can be a ``\Closure`` instance, an object
implementing an ``__invoke`` method (which is what closures are in fact),
implementing an ``__invoke()`` method (which is what closures are in fact),
a string representing a function or an array representing an object
method or a class method.

Expand Down
2 changes: 1 addition & 1 deletion components/event_dispatcher/immutable_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Now, inject that into an ``ImmutableEventDispatcher``::
You'll need to use this new dispatcher in your project.

If you are trying to execute one of the methods which modifies the dispatcher
(e.g. ``addListener``), a ``BadMethodCallException`` is thrown.
(e.g. ``addListener()``), a ``BadMethodCallException`` is thrown.
2 changes: 1 addition & 1 deletion components/filesystem/lock_handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ second argument of the constructor.

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

Expand Down
8 changes: 4 additions & 4 deletions components/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ Creating a simple Form
If you're using the Symfony Framework, then the form factory is available
automatically as a service called ``form.factory``. Also, the default
base controller class has a :method:`Symfony\\Bundle\\FrameworkBundle\\Controller::createFormBuilder`
method, which is a shortcut to fetch the form factory and call ``createBuilder``
method, which is a shortcut to fetch the form factory and call ``createBuilder()``
on it.

Creating a form is done via a :class:`Symfony\\Component\\Form\\FormBuilder`
Expand Down Expand Up @@ -414,8 +414,8 @@ is created from the form factory.
}
}

As you can see, creating a form is like writing a recipe: you call ``add``
for each new field you want to create. The first argument to ``add`` is the
As you can see, creating a form is like writing a recipe: you call ``add()``
for each new field you want to create. The first argument to ``add()`` is the
name of your field, and the second is the field "type". The Form component
comes with a lot of :doc:`built-in types </reference/forms/types>`.

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

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

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

Learn more
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The HttpFoundation Component

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

The Symfony HttpFoundation component replaces these default PHP global
variables and functions by an object-oriented layer.
Expand Down
30 changes: 15 additions & 15 deletions components/http_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ and is one of the constructor arguments to ``HttpKernel``.
:align: center

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

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

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

Expand All @@ -274,7 +274,7 @@ the controller is executed.

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

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

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

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

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

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

Expand Down Expand Up @@ -509,8 +509,8 @@ Handling Exceptions: the ``kernel.exception`` Event

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

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

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

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

Expand Down Expand Up @@ -653,7 +653,7 @@ a built-in ControllerResolver that can be used to create a working example::
Sub Requests
------------

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

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

use Symfony\Component\HttpFoundation\Request;
Expand Down
4 changes: 2 additions & 2 deletions components/phpunit_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ There are four ways to mark a test as legacy:

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

* Make its method name start with ``testLegacy`` instead of ``test``;
* Make its method name start with ``testLegacy*()`` instead of ``test*()``;

* Make its data provider start with ``provideLegacy`` or ``getLegacy``.
* Make its data provider start with ``provideLegacy*()`` or ``getLegacy*()``.

Configuration
-------------
Expand Down
Loading