Skip to content

Fixes for 2.3 branch #4934

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 5 commits into from
Jan 31, 2015
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
3 changes: 2 additions & 1 deletion components/finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,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 @@ -131,7 +131,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 @@ -303,7 +303,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 @@ object::

// ...

// an array of FormError objects, but only errors attached to this form level (e.g. "global errors)
// an array of FormError objects, but only errors attached to this
// form level (e.g. "global errors)
$errors = $form->getErrors();

// an array of FormError objects, but only errors attached to the "firstName" field
// an array of FormError objects, but only errors attached to the
// "firstName" field
$errors = $form['firstName']->getErrors();

// a string representation of all errors of the whole form tree
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
4 changes: 2 additions & 2 deletions components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,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 @@ -217,7 +217,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