Skip to content

Commit a38810a

Browse files
committed
Merge pull request symfony#1969 from richardmiller/fixing_line_lengths
Reducing some code sample line lengths to stop horizontal scrolling
2 parents 7670c0c + 41fb5fb commit a38810a

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

components/dom_crawler.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ Access the attribute value of the first node of the current selection::
121121

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

124-
$attributes = $crawler->filterXpath('//body/p')->extract(array('_text', 'class'));
124+
$attributes = $crawler
125+
->filterXpath('//body/p')
126+
->extract(array('_text', 'class'))
127+
;
125128

126129
.. note::
127130

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

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

248252
To work with multi-dimensional fields::

components/event_dispatcher/introduction.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ that serves to define and document your event:
241241
* The store.order event is thrown each time an order is created
242242
* in the system.
243243
*
244-
* The event listener receives an Acme\StoreBundle\Event\FilterOrderEvent
245-
* instance.
244+
* The event listener receives an
245+
* Acme\StoreBundle\Event\FilterOrderEvent instance.
246246
*
247247
* @var string
248248
*/
@@ -490,4 +490,4 @@ be called.
490490
.. _`Symfony2 HttpKernel component`: https://github.com/symfony/HttpKernel
491491
.. _Closures: http://php.net/manual/en/functions.anonymous.php
492492
.. _PHP callable: http://www.php.net/manual/en/language.pseudo-types.php#language.types.callback
493-
.. _Packagist: https://packagist.org/packages/symfony/event-dispatcher
493+
.. _Packagist: https://packagist.org/packages/symfony/event-dispatcher

components/http_foundation/introduction.rst

+20-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ variables with
3838
which is almost equivalent to the more verbose, but also more flexible,
3939
:method:`Symfony\\Component\\HttpFoundation\\Request::__construct` call::
4040

41-
$request = new Request($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
41+
$request = new Request(
42+
$_GET,
43+
$_POST,
44+
array(),
45+
$_COOKIE,
46+
$_FILES,
47+
$_SERVER
48+
);
4249

4350
Accessing Request Data
4451
~~~~~~~~~~~~~~~~~~~~~~
@@ -184,7 +191,11 @@ Simulating a Request
184191
Instead of creating a Request based on the PHP globals, you can also simulate
185192
a Request::
186193

187-
$request = Request::create('/hello-world', 'GET', array('name' => 'Fabien'));
194+
$request = Request::create(
195+
'/hello-world',
196+
'GET',
197+
array('name' => 'Fabien')
198+
);
188199

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

246257
use Symfony\Component\HttpFoundation\Response;
247258

248-
$response = new Response('Content', 200, array('content-type' => 'text/html'));
259+
$response = new Response(
260+
'Content',
261+
200,
262+
array('content-type' => 'text/html')
263+
);
249264

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

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

360375
use Symfony\Component\HttpFoundation\Response;
361-
376+
362377
$response = new Response();
363378
$response->setContent(json_encode(array(
364379
'data' => 123
@@ -371,4 +386,4 @@ Session
371386
TBD -- This part has not been written yet as it will probably be refactored
372387
soon in Symfony 2.1.
373388

374-
.. _Packagist: https://packagist.org/packages/symfony/http-foundation
389+
.. _Packagist: https://packagist.org/packages/symfony/http-foundation

components/locale.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ When using the ClassLoader component following code is sufficient to supplement
4242
if (!function_exists('intl_get_error_code')) {
4343
require __DIR__.'/path/to/src/Symfony/Component/Locale/Resources/stubs/functions.php';
4444
45-
$loader->registerPrefixFallbacks(array(__DIR__.'/path/to/src/Symfony/Component/Locale/Resources/stubs'));
45+
$loader->registerPrefixFallbacks(
46+
array(__DIR__.'/path/to/src/Symfony/Component/Locale/Resources/stubs')
47+
);
4648
}
4749
4850
:class:`Symfony\\Component\\Locale\\Locale` class enriches native :phpclass:`Locale` class with additional features:
@@ -67,4 +69,4 @@ When using the ClassLoader component following code is sufficient to supplement
6769
$icuVersion = Locale::getIcuVersion();
6870
$icuDataVersion = Locale::getIcuDataVersion();
6971
70-
.. _Packagist: https://packagist.org/packages/symfony/locale
72+
.. _Packagist: https://packagist.org/packages/symfony/locale

components/yaml.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ array to its YAML representation:
146146
147147
use Symfony\Component\Yaml\Dumper;
148148
149-
$array = array('foo' => 'bar', 'bar' => array('foo' => 'bar', 'bar' => 'baz'));
149+
$array = array(
150+
'foo' => 'bar',
151+
'bar' => array('foo' => 'bar', 'bar' => 'baz')
152+
);
150153
151154
$dumper = new Dumper();
152155
@@ -472,4 +475,4 @@ Comments can be added in YAML by prefixing them with a hash mark (``#``):
472475
indented according to the current level of nesting in a collection.
473476

474477
.. _YAML: http://yaml.org/
475-
.. _Packagist: https://packagist.org/packages/symfony/yaml
478+
.. _Packagist: https://packagist.org/packages/symfony/yaml

0 commit comments

Comments
 (0)