Skip to content

Commit 89dd756

Browse files
Document new VarCloner::setMinDepth function
1 parent 21f5857 commit 89dd756

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

components/var_dumper/advanced.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,24 @@ Before calling :method:`Symfony\\Component\\VarDumper\\Cloner\\VarCloner::cloneV
5353
you can configure these limits:
5454

5555
:method:`Symfony\\Component\\VarDumper\\Cloner\\VarCloner::setMaxItems`
56-
configures the maximum number of items that will be cloned
57-
*past the first nesting level*. Items are counted using a breadth-first
58-
algorithm so that lower level items have higher priority than deeply nested
59-
items;
56+
Configures the maximum number of items that will be cloned
57+
*past the minimum nesting depth given by ``setMinDepth``*. Items are
58+
counted using a breadth-first algorithm so that lower level items have
59+
higher priority than deeply nested items. Specifying ``-1`` removes
60+
the limit.
6061

61-
:method:`Symfony\\Component\\VarDumper\\Cloner\\VarCloner::setMaxString`
62-
configures the maximum number of characters that will be cloned before
63-
cutting overlong strings;
62+
:method:`Symfony\\Component\\VarDumper\\Cloner\\VarCloner::setMinDepth`
63+
.. versionadded:: 3.4
64+
The ``setMinDepth()`` method was introduced in Symfony 3.4.
65+
66+
Configures the minimum tree depth where we are guaranteed to clone
67+
all the items. After this depth is reached, only ``setMaxItems``
68+
items will be cloned. The default value is ``1``, which is consistent
69+
with older Symfony versions.
6470

65-
In both cases, specifying ``-1`` removes any limit.
71+
:method:`Symfony\\Component\\VarDumper\\Cloner\\VarCloner::setMaxString`
72+
Configures the maximum number of characters that will be cloned before
73+
cutting overlong strings. Specifying ``-1`` removes the limit.
6674

6775
Before dumping it, you can further limit the resulting
6876
:class:`Symfony\\Component\\VarDumper\\Cloner\\Data` object using the following methods:

0 commit comments

Comments
 (0)