Skip to content

Commit d260a11

Browse files
committed
minor #8155 Document new VarCloner::setMinDepth function (james-johnston-thumbtack)
This PR was merged into the 3.4 branch. Discussion ---------- Document new VarCloner::setMinDepth function Documentation for new ``setMinDepth`` function in the VarDumper component's cloner. (This function is pending code review / merge.) Commits ------- 32ca116 Document new VarCloner::setMinDepth function
2 parents 8f57789 + 32ca116 commit d260a11

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

components/var_dumper/advanced.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,23 @@ 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
56+
Configures the maximum number of items that will be cloned
57+
*past the minimum nesting depth*. Items are counted using a breadth-first
5858
algorithm so that lower level items have higher priority than deeply nested
59-
items;
59+
items. Specifying ``-1`` removes the limit.
6060

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

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

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

0 commit comments

Comments
 (0)