diff --git a/book/controller.rst b/book/controller.rst index f80bb7d88a0..6a451037e7b 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -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:: diff --git a/components/dependency_injection/definitions.rst b/components/dependency_injection/definitions.rst index f1c7278cedd..04c96bba872 100644 --- a/components/dependency_injection/definitions.rst +++ b/components/dependency_injection/definitions.rst @@ -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 ~~~~~~~~~~~~ diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 00f578402e3..762d26ff902 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -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 diff --git a/contributing/code/conventions.rst b/contributing/code/conventions.rst index 32f50481ee4..35d850bb627 100644 --- a/contributing/code/conventions.rst +++ b/contributing/code/conventions.rst @@ -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: diff --git a/cookbook/console/commands_as_services.rst b/cookbook/console/commands_as_services.rst index 09bfe12d77b..60f22824686 100644 --- a/cookbook/console/commands_as_services.rst +++ b/cookbook/console/commands_as_services.rst @@ -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; } diff --git a/install.sh b/install.sh index 315f9671e60..c50451959a0 100644 --- a/install.sh +++ b/install.sh @@ -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 @@ -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