Skip to content

Commit

Permalink
Merge branch '2.4'
Browse files Browse the repository at this point in the history
Conflicts:
	changelog.rst
	components/stopwatch.rst
  • Loading branch information
weaverryan committed Apr 21, 2014
2 parents 98288fc + 863a764 commit c8bfde6
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 42 deletions.
56 changes: 28 additions & 28 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,44 +279,44 @@ the following guidelines in mind while you develop.

* **The order of the controller arguments does not matter**

Symfony is able to match the parameter names from the route to the variable
names in the controller method's signature. In other words, it realizes that
the ``{lastName}`` parameter matches up with the ``$lastName`` argument.
The arguments of the controller could be totally reordered and still work
perfectly::

public function indexAction($lastName, $color, $firstName)
{
// ...
}
Symfony is able to match the parameter names from the route to the variable
names in the controller method's signature. In other words, it realizes that
the ``{lastName}`` parameter matches up with the ``$lastName`` argument.
The arguments of the controller could be totally reordered and still work
perfectly::

public function indexAction($lastName, $color, $firstName)
{
// ...
}

* **Each required controller argument must match up with a routing parameter**

The following would throw a ``RuntimeException`` because there is no ``foo``
parameter defined in the route::
The following would throw a ``RuntimeException`` because there is no ``foo``
parameter defined in the route::

public function indexAction($firstName, $lastName, $color, $foo)
{
// ...
}
public function indexAction($firstName, $lastName, $color, $foo)
{
// ...
}

Making the argument optional, however, is perfectly ok. The following
example would not throw an exception::
Making the argument optional, however, is perfectly ok. The following
example would not throw an exception::

public function indexAction($firstName, $lastName, $color, $foo = 'bar')
{
// ...
}
public function indexAction($firstName, $lastName, $color, $foo = 'bar')
{
// ...
}

* **Not all routing parameters need to be arguments on your controller**

If, for example, the ``lastName`` weren't important for your controller,
you could omit it entirely::
If, for example, the ``lastName`` weren't important for your controller,
you could omit it entirely::

public function indexAction($firstName, $color)
{
// ...
}
public function indexAction($firstName, $color)
{
// ...
}

.. tip::

Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/definitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ In a similar way you can replace an already set argument by index using::
You can also replace all the arguments (or set some if there are none) with
an array of arguments::

$definition->replaceArguments($arguments);
$definition->setArguments($arguments);

Method Calls
~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion components/stopwatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ microtime by yourself. Instead, use the simple
.. versionadded:: 2.5
The ``getEvent()`` method was introduced in Symfony 2.5

The :class:`Symfony\\Component\\Stopwatch\StopwatchEvent` object can be retrieved
The :class:`Symfony\\Component\\Stopwatch\\StopwatchEvent` object can be retrieved
from the :method:`Symfony\\Component\\Stopwatch\\Stopwatch::start`,
:method:`Symfony\\Component\\Stopwatch\\Stopwatch::stop`,
:method:`Symfony\\Component\\Stopwatch\\Stopwatch::lap` and
Expand Down
24 changes: 12 additions & 12 deletions contributing/code/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ Method Names
When an object has a "main" many relation with related "things"
(objects, parameters, ...), the method names are normalized:

* ``get()``
* ``set()``
* ``has()``
* ``all()``
* ``replace()``
* ``remove()``
* ``clear()``
* ``isEmpty()``
* ``add()``
* ``register()``
* ``count()``
* ``keys()``
* ``get()``
* ``set()``
* ``has()``
* ``all()``
* ``replace()``
* ``remove()``
* ``clear()``
* ``isEmpty()``
* ``add()``
* ``register()``
* ``count()``
* ``keys()``

The usage of these methods are only allowed when it is clear that there
is a main relation:
Expand Down
2 changes: 2 additions & 0 deletions cookbook/console/commands_as_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ have some ``NameRepository`` service that you'll use to get your default value::

public function __construct(NameRepository $nameRepository)
{
parent::__construct();
$this->nameRepository = $nameRepository;
}

Expand Down
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function sparse_checkout {
git remote add -f origin http://github.com/$1/$2
echo Resources/doc > .git/info/sparse-checkout
git checkout master
rm -rf ../bundles/$2
mv Resources/doc ../bundles/$2
cd ..
rm -rf sparse_checkout
Expand All @@ -18,5 +19,6 @@ sparse_checkout sensiolabs SensioGeneratorBundle
sparse_checkout doctrine DoctrineFixturesBundle
sparse_checkout doctrine DoctrineMigrationsBundle
sparse_checkout doctrine DoctrineMongoDBBundle
rm -rf cmf
git clone http://github.com/symfony-cmf/symfony-cmf-docs cmf

0 comments on commit c8bfde6

Please sign in to comment.