Skip to content

Reducing some code sample line lengths to stop horizontal scrolling #1969

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 2 commits into from
Nov 26, 2012
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
8 changes: 6 additions & 2 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ Access the attribute value of the first node of the current selection::

Extract attribute and/or node values from the list of nodes::

$attributes = $crawler->filterXpath('//body/p')->extract(array('_text', 'class'));
$attributes = $crawler
->filterXpath('//body/p')
->extract(array('_text', 'class'))
;

.. note::

Expand Down Expand Up @@ -242,7 +245,8 @@ You can virtually set and get values on the form::
// get back an array of values - in the "flat" array like above
$values = $form->getValues();

// returns the values like PHP would see them, where "registration" is its own array
// returns the values like PHP would see them,
// where "registration" is its own array
$values = $form->getPhpValues();

To work with multi-dimensional fields::
Expand Down
6 changes: 3 additions & 3 deletions components/event_dispatcher/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ that serves to define and document your event:
* The store.order event is thrown each time an order is created
* in the system.
*
* The event listener receives an Acme\StoreBundle\Event\FilterOrderEvent
* instance.
* The event listener receives an
* Acme\StoreBundle\Event\FilterOrderEvent instance.
*
* @var string
*/
Expand Down Expand Up @@ -490,4 +490,4 @@ be called.
.. _`Symfony2 HttpKernel component`: https://github.com/symfony/HttpKernel
.. _Closures: http://php.net/manual/en/functions.anonymous.php
.. _PHP callable: http://www.php.net/manual/en/language.pseudo-types.php#language.types.callback
.. _Packagist: https://packagist.org/packages/symfony/event-dispatcher
.. _Packagist: https://packagist.org/packages/symfony/event-dispatcher
25 changes: 20 additions & 5 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ variables with
which is almost equivalent to the more verbose, but also more flexible,
:method:`Symfony\\Component\\HttpFoundation\\Request::__construct` call::

$request = new Request($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
$request = new Request(
$_GET,
$_POST,
array(),
$_COOKIE,
$_FILES,
$_SERVER
);

Accessing Request Data
~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -184,7 +191,11 @@ Simulating a Request
Instead of creating a Request based on the PHP globals, you can also simulate
a Request::

$request = Request::create('/hello-world', 'GET', array('name' => 'Fabien'));
$request = Request::create(
'/hello-world',
'GET',
array('name' => 'Fabien')
);

The :method:`Symfony\\Component\\HttpFoundation\\Request::create` method
creates a request based on a path info, a method and some parameters (the
Expand Down Expand Up @@ -245,7 +256,11 @@ code, and an array of HTTP headers::

use Symfony\Component\HttpFoundation\Response;

$response = new Response('Content', 200, array('content-type' => 'text/html'));
$response = new Response(
'Content',
200,
array('content-type' => 'text/html')
);

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

Expand Down Expand Up @@ -358,7 +373,7 @@ Any type of response can be created via the
right content and headers. A JSON response might look like this::

use Symfony\Component\HttpFoundation\Response;

$response = new Response();
$response->setContent(json_encode(array(
'data' => 123
Expand All @@ -371,4 +386,4 @@ Session
TBD -- This part has not been written yet as it will probably be refactored
soon in Symfony 2.1.

.. _Packagist: https://packagist.org/packages/symfony/http-foundation
.. _Packagist: https://packagist.org/packages/symfony/http-foundation
6 changes: 4 additions & 2 deletions components/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ When using the ClassLoader component following code is sufficient to supplement
if (!function_exists('intl_get_error_code')) {
require __DIR__.'/path/to/src/Symfony/Component/Locale/Resources/stubs/functions.php';

$loader->registerPrefixFallbacks(array(__DIR__.'/path/to/src/Symfony/Component/Locale/Resources/stubs'));
$loader->registerPrefixFallbacks(
array(__DIR__.'/path/to/src/Symfony/Component/Locale/Resources/stubs')
);
}

:class:`Symfony\\Component\\Locale\\Locale` class enriches native :phpclass:`Locale` class with additional features:
Expand All @@ -67,4 +69,4 @@ When using the ClassLoader component following code is sufficient to supplement
$icuVersion = Locale::getIcuVersion();
$icuDataVersion = Locale::getIcuDataVersion();

.. _Packagist: https://packagist.org/packages/symfony/locale
.. _Packagist: https://packagist.org/packages/symfony/locale
7 changes: 5 additions & 2 deletions components/yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ array to its YAML representation:

use Symfony\Component\Yaml\Dumper;

$array = array('foo' => 'bar', 'bar' => array('foo' => 'bar', 'bar' => 'baz'));
$array = array(
'foo' => 'bar',
'bar' => array('foo' => 'bar', 'bar' => 'baz')
);

$dumper = new Dumper();

Expand Down Expand Up @@ -472,4 +475,4 @@ Comments can be added in YAML by prefixing them with a hash mark (``#``):
indented according to the current level of nesting in a collection.

.. _YAML: http://yaml.org/
.. _Packagist: https://packagist.org/packages/symfony/yaml
.. _Packagist: https://packagist.org/packages/symfony/yaml