Skip to content

Commit 2ef1b60

Browse files
author
Fabian Becker
committed
Fix format
1 parent 0c46fce commit 2ef1b60

File tree

1 file changed

+43
-42
lines changed

1 file changed

+43
-42
lines changed

components/var_dumper/advanced.rst

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Dumpers
9797

9898
A dumper is responsible for outputting a string representation of a PHP variable,
9999
using a :class:`Symfony\\Component\\VarDumper\\Cloner\\Data` object as input.
100-
The destination and the formatting of this output vary with dumpers.
100+
The destination and the formatting of this output vary with dumpers.
101101

102102
This component comes with an :class:`Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper`
103103
for HTML output and a :class:`Symfony\\Component\\VarDumper\\Dumper\\CliDumper`
@@ -204,70 +204,71 @@ The output format of a dumper can be fine tuned by the two flags
204204
in the third constructor argument. They can also be set via environment
205205
variables when using
206206
:method:`assertDumpEquals($dump, $data, $message) <Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait::assertDumpEquals>`
207-
during unit testing. The flags can be configured in ``phpunit.xml.dist``.
207+
during unit testing. The flags can be configured in the PHPUnit configuration.
208208

209209
* If ``DUMP_STRING_LENGTH`` is set, then the length of a string is displayed
210210
next to its content.
211211

212-
::
212+
.. code-block:: php
213213
214-
use Symfony\Component\VarDumper\Dumper\AbstractDumper;
215-
use Symfony\Component\VarDumper\Dumper\CliDumper;
214+
use Symfony\Component\VarDumper\Dumper\AbstractDumper;
215+
use Symfony\Component\VarDumper\Dumper\CliDumper;
216216
217-
$var = array('test');
218-
$dumper = new CliDumper();
219-
echo $dumper->dump($var, true);
217+
$var = array('test');
218+
$dumper = new CliDumper();
219+
echo $dumper->dump($var, true);
220220
221-
// array:1 [
222-
// 0 => "test"
223-
// ]
221+
// array:1 [
222+
// 0 => "test"
223+
// ]
224224
225-
$dumper = new CliDumper(null, null, AbstractDumper::DUMP_STRING_LENGTH);
226-
echo $dumper->dump($var, true);
225+
$dumper = new CliDumper(null, null, AbstractDumper::DUMP_STRING_LENGTH);
226+
echo $dumper->dump($var, true);
227227
228-
// (added string length before the string)
229-
// array:1 [
230-
// 0 => (4) "test"
231-
// ]
228+
// (added string length before the string)
229+
// array:1 [
230+
// 0 => (4) "test"
231+
// ]
232232
233-
* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are dumped in a shortened format.
233+
* If ``DUMP_LIGHT_ARRAY`` is set, then arrays are dumped in a shortened format
234+
similar to PHP's short array notation.
234235

235-
::
236+
.. code-block:: php
236237
237-
use Symfony\Component\VarDumper\Dumper\AbstractDumper;
238-
use Symfony\Component\VarDumper\Dumper\CliDumper;
238+
use Symfony\Component\VarDumper\Dumper\AbstractDumper;
239+
use Symfony\Component\VarDumper\Dumper\CliDumper;
239240
240-
$var = array('test');
241-
$dumper = new CliDumper();
242-
echo $dumper->dump($var, true);
241+
$var = array('test');
242+
$dumper = new CliDumper();
243+
echo $dumper->dump($var, true);
243244
244-
// array:1 [
245-
// 0 => "test"
246-
// ]
245+
// array:1 [
246+
// 0 => "test"
247+
// ]
247248
248-
$dumper = new CliDumper(null, null, AbstractDumper::DUMP_LIGHT_ARRAY);
249-
echo $dumper->dump($var, true);
249+
$dumper = new CliDumper(null, null, AbstractDumper::DUMP_LIGHT_ARRAY);
250+
echo $dumper->dump($var, true);
250251
251-
// (no more array:1 prefix)
252-
// [
253-
// 0 => "test"
254-
// ]
252+
// (no more array:1 prefix)
253+
// [
254+
// 0 => "test"
255+
// ]
255256
256257
* If you would like to use both options, then you can just
257258
combine them by using a the logical OR operator ``|``.
258259

259-
::
260+
.. code-block:: php
260261
261-
use Symfony\Component\VarDumper\Dumper\AbstractDumper;
262-
use Symfony\Component\VarDumper\Dumper\CliDumper;
262+
use Symfony\Component\VarDumper\Dumper\AbstractDumper;
263+
use Symfony\Component\VarDumper\Dumper\CliDumper;
263264
264-
$var = array('test');
265-
$dumper = new CliDumper(null, null, AbstractDumper::DUMP_STRING_LENGTH | AbstractDumper::DUMP_LIGHT_ARRAY);
266-
echo $dumper->dump($var, true);
265+
$var = array('test');
266+
$dumper = new CliDumper(null, null, AbstractDumper::DUMP_STRING_LENGTH | AbstractDumper::DUMP_LIGHT_ARRAY);
267+
echo $dumper->dump($var, true);
267268
268-
// [
269-
// 0 => (4) "test"
270-
// ]
269+
// [
270+
// 0 => (4) "test"
271+
// ]
271272
272273
Casters
273274
-------

0 commit comments

Comments
 (0)