Skip to content

Commit

Permalink
Merge branch '2.6' into 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Feb 1, 2015
2 parents bc29584 + a49ffcc commit d71fe6d
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 38 deletions.
2 changes: 1 addition & 1 deletion book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ version as the second argument of the ``create-project`` command:

.. code-block:: bash
$ composer create-project symfony/framework-standard-edition my_project_name '2.3.*'
$ composer create-project symfony/framework-standard-edition my_project_name "2.3.*"
.. tip::

Expand Down
6 changes: 5 additions & 1 deletion components/event_dispatcher/traceable_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ to register event listeners and dispatch events::
// register an event listener
$eventListener = ...;
$priority = ...;
$traceableEventDispatcher->addListener('event.the_name', $eventListener, $priority);
$traceableEventDispatcher->addListener(
'event.the_name',
$eventListener,
$priority
);

// dispatch an event
$event = ...;
Expand Down
3 changes: 2 additions & 1 deletion components/finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ The contents of returned files can be read with

foreach ($finder as $file) {
$contents = $file->getContents();
...
// ...
}

.. _strtotime: http://www.php.net/manual/en/datetime.formats.php
Expand Down
7 changes: 5 additions & 2 deletions components/form/form_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ The ``FormEvents::PRE_SUBMIT`` event is dispatched at the beginning of the

It can be used to:

* Change data from the request, before submitting the data to the form.
* Change data from the request, before submitting the data to the form;
* Add or remove form fields, before submitting the data to the form.

:ref:`Form Events Information Table<component-form-event-table>`
Expand Down Expand Up @@ -309,7 +309,10 @@ callback for better readability::
{
$builder->add('username', 'text');
$builder->add('show_email', 'checkbox');
$builder->addEventListener(FormEvents::PRE_SET_DATA, array($this, 'onPreSetData'));
$builder->addEventListener(
FormEvents::PRE_SET_DATA,
array($this, 'onPreSetData')
);
}

public function onPreSetData(FormEvent $event)
Expand Down
24 changes: 13 additions & 11 deletions components/form/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,17 @@ to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension
// this file comes with TwigBridge
$defaultFormTheme = 'form_div_layout.html.twig';

$vendorDir = realpath(__DIR__ . '/../vendor');
$vendorDir = realpath(__DIR__.'/../vendor');
// the path to TwigBridge so Twig can locate the
// form_div_layout.html.twig file
$vendorTwigBridgeDir =
$vendorDir . '/symfony/twig-bridge/Symfony/Bridge/Twig';
$vendorDir.'/symfony/twig-bridge/Symfony/Bridge/Twig';
// the path to your other templates
$viewsDir = realpath(__DIR__ . '/../views');
$viewsDir = realpath(__DIR__.'/../views');

$twig = new Twig_Environment(new Twig_Loader_Filesystem(array(
$viewsDir,
$vendorTwigBridgeDir . '/Resources/views/Form',
$vendorTwigBridgeDir.'/Resources/views/Form',
)));
$formEngine = new TwigRendererEngine(array($defaultFormTheme));
$formEngine->setEnvironment($twig);
Expand Down Expand Up @@ -315,24 +315,24 @@ Your integration with the Validation component will look something like this::
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
use Symfony\Component\Validator\Validation;

$vendorDir = realpath(__DIR__ . '/../vendor');
$vendorFormDir = $vendorDir . '/symfony/form/Symfony/Component/Form';
$vendorDir = realpath(__DIR__.'/../vendor');
$vendorFormDir = $vendorDir.'/symfony/form/Symfony/Component/Form';
$vendorValidatorDir =
$vendorDir . '/symfony/validator/Symfony/Component/Validator';
$vendorDir.'/symfony/validator/Symfony/Component/Validator';

// create the validator - details will vary
$validator = Validation::createValidator();

// there are built-in translations for the core error messages
$translator->addResource(
'xlf',
$vendorFormDir . '/Resources/translations/validators.en.xlf',
$vendorFormDir.'/Resources/translations/validators.en.xlf',
'en',
'validators'
);
$translator->addResource(
'xlf',
$vendorValidatorDir . '/Resources/translations/validators.en.xlf',
$vendorValidatorDir.'/Resources/translations/validators.en.xlf',
'en',
'validators'
);
Expand Down Expand Up @@ -671,10 +671,12 @@ method to access the list of errors. It returns a

// ...

// a FormErrorIterator instance, but only errors attached to this form level (e.g. "global errors)
// a FormErrorIterator instance, but only errors attached to this
// form level (e.g. "global errors)
$errors = $form->getErrors();

// a FormErrorIterator instance, but only errors attached to the "firstName" field
// a FormErrorIterator instance, but only errors attached to the
// "firstName" field
$errors = $form['firstName']->getErrors();

// a FormErrorIterator instance in a flattened structure
Expand Down
4 changes: 2 additions & 2 deletions components/form/type_guesser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Start by creating the class and these methods. Next, you'll learn how to fill ea
use Symfony\Component\Form\FormTypeGuesserInterface;
class PhpdocTypeGuesser implements FormTypeGuesserInterface
class PHPDocTypeGuesser implements FormTypeGuesserInterface
{
public function guessType($class, $property)
{
Expand Down Expand Up @@ -92,7 +92,7 @@ With this knowledge, you can easily implement the ``guessType`` method of the
use Symfony\Component\Form\Guess\Guess;
use Symfony\Component\Form\Guess\TypeGuess;

class PhpdocTypeGuesser implements FormTypeGuesserInterface
class PHPDocTypeGuesser implements FormTypeGuesserInterface
{
public function guessType($class, $property)
{
Expand Down
6 changes: 3 additions & 3 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ by using the following methods:
:method:`Symfony\\Component\\HttpFoundation\\Request::getCharsets`
Returns the list of accepted charsets ordered by descending quality.

* :method:`Symfony\\Component\\HttpFoundation\\Request::getEncodings`:
returns the list of accepted charsets ordered by descending quality;
:method:`Symfony\\Component\\HttpFoundation\\Request::getEncodings`
Returns the list of accepted encodings ordered by descending quality.

.. versionadded:: 2.4
The ``getEncodings()`` method was introduced in Symfony 2.4.
Expand Down Expand Up @@ -331,7 +331,7 @@ code, and an array of HTTP headers::
array('content-type' => 'text/html')
);

These information can also be manipulated after the Response object creation::
This information can also be manipulated after the Response object creation::

$response->setContent('Hello World');

Expand Down
10 changes: 7 additions & 3 deletions components/http_foundation/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,12 @@ data is an array, for example a set of tokens. In this case, managing the array
becomes a burden because you have to retrieve the array then process it and
store it again::

$tokens = array('tokens' => array('a' => 'a6c1e0b6',
'b' => 'f4a7b1f3'));
$tokens = array(
'tokens' => array(
'a' => 'a6c1e0b6',
'b' => 'f4a7b1f3',
),
);

So any processing of this might quickly get ugly, even simply adding a token to
the array::
Expand All @@ -201,7 +205,7 @@ the array::
$session->set('tokens', $tokens);

With structured namespacing, the key can be translated to the array
structure like this using a namespace character (defaults to `/`)::
structure like this using a namespace character (defaults to ``/``)::

$session->set('tokens/c', $value);

Expand Down
4 changes: 2 additions & 2 deletions components/intl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Installation

You can install the component in two different ways:

* Using the official Git repository (https://github.com/symfony/Intl);
* :doc:`Install it via Composer</components/using_components>` (``symfony/intl`` on `Packagist`_).
* :doc:`Install it via Composer</components/using_components>` (``symfony/intl`` on `Packagist`_);
* Using the official Git repository (https://github.com/symfony/Intl).

If you install the component via Composer, the following classes and functions
of the intl extension will be automatically provided if the intl extension is
Expand Down
12 changes: 6 additions & 6 deletions components/options_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ is thrown if an unknown option is passed::
'usernme' => 'johndoe',
));

// UndefinedOptionsException: The option "usernme" does not exist. Known
// options are: "host", "password", "port", "username"
// UndefinedOptionsException: The option "usernme" does not exist.
// Known options are: "host", "password", "port", "username"

The rest of your code can access the values of the options without boilerplate
code::
Expand Down Expand Up @@ -354,8 +354,8 @@ is thrown::
'host' => 25,
));

// InvalidOptionsException: The option "host" with value "25" is expected to
// be of type "string"
// InvalidOptionsException: The option "host" with value "25" is
// expected to be of type "string"

In sub-classes, you can use :method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::addAllowedTypes`
to add additional allowed types without erasing the ones already set.
Expand Down Expand Up @@ -395,8 +395,8 @@ is thrown::
'transport' => 'send-mail',
));

// InvalidOptionsException: The option "transport" has the value "send-mail",
// but is expected to be one of "sendmail", "mail", "smtp"
// InvalidOptionsException: The option "transport" has the value
// "send-mail", but is expected to be one of "sendmail", "mail", "smtp"

For options with more complicated validation schemes, pass a closure which
returns ``true`` for acceptable values and ``false`` for invalid values::
Expand Down
4 changes: 2 additions & 2 deletions components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Stopping a Process

Any asynchronous process can be stopped at any time with the
:method:`Symfony\\Component\\Process\\Process::stop` method. This method takes
two arguments : a timeout and a signal. Once the timeout is reached, the signal
two arguments: a timeout and a signal. Once the timeout is reached, the signal
is sent to the running process. The default signal sent to a process is ``SIGKILL``.
Please read the :ref:`signal documentation below<reference-process-signal>`
to find out more about signal handling in the Process component::
Expand Down Expand Up @@ -249,7 +249,7 @@ Process Signals
.. versionadded:: 2.3
The ``signal`` method was introduced in Symfony 2.3.

When running a program asynchronously, you can send it posix signals with the
When running a program asynchronously, you can send it POSIX signals with the
:method:`Symfony\\Component\\Process\\Process::signal` method::

use Symfony\Component\Process\Process;
Expand Down
4 changes: 2 additions & 2 deletions components/routing/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ calls a closure and uses the result as a :class:`Symfony\\Component\\Routing\\Ro

use Symfony\Component\Routing\Loader\ClosureLoader;

$closure = function() {
$closure = function () {
return new RouteCollection();
};

Expand All @@ -303,7 +303,7 @@ out here.
The all-in-one Router
~~~~~~~~~~~~~~~~~~~~~

The :class:`Symfony\\Component\\Routing\\Router` class is a all-in-one package
The :class:`Symfony\\Component\\Routing\\Router` class is an all-in-one package
to quickly use the Routing component. The constructor expects a loader instance,
a path to the main route definition and some other settings::

Expand Down
6 changes: 4 additions & 2 deletions cookbook/form/use_empty_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ your form. For example::
{
$blog = ...;

// $blog is passed in as the data, so the empty_data option is not needed
// $blog is passed in as the data, so the empty_data
// option is not needed
$form = $this->createForm(new BlogType(), $blog);

// no data is passed in, so empty_data is used to get the "starting data"
// no data is passed in, so empty_data is
// used to get the "starting data"
$form = $this->createForm(new BlogType());
}

Expand Down

0 comments on commit d71fe6d

Please sign in to comment.