Skip to content

Commit

Permalink
minor #4934 Fixes for 2.3 branch (ifdattic)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Fixes for 2.3 branch

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

611a011 Fix typos
3fe41fd Misc changes
3f24f8e Fix typo
b04f311 Fix typos
a21042c Fix typo
  • Loading branch information
wouterj committed Jan 31, 2015
2 parents 99d225b + 611a011 commit 83696b8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion components/finder.rst
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
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
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
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
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

0 comments on commit 83696b8

Please sign in to comment.