@@ -37,6 +37,51 @@ public function getRawData()
37
37
return $ this ->data ;
38
38
}
39
39
40
+ /**
41
+ * Returns a depth limited clone of $this.
42
+ *
43
+ * @param int $maxDepth The max dumped depth level.
44
+ *
45
+ * @return self A clone of $this.
46
+ */
47
+ public function withMaxDepth ($ maxDepth )
48
+ {
49
+ $ data = clone $ this ;
50
+ $ data ->maxDepth = (int ) $ maxDepth ;
51
+
52
+ return $ data ;
53
+ }
54
+
55
+ /**
56
+ * Limits the numbers of elements per depth level.
57
+ *
58
+ * @param int $maxItemsPerDepth The max number of items dumped per depth level.
59
+ *
60
+ * @return self A clone of $this.
61
+ */
62
+ public function withMaxItemsPerDepth ($ maxItemsPerDepth )
63
+ {
64
+ $ data = clone $ this ;
65
+ $ data ->maxItemsPerDepth = (int ) $ maxItemsPerDepth ;
66
+
67
+ return $ data ;
68
+ }
69
+
70
+ /**
71
+ * Enables/disables objects' identifiers tracking.
72
+ *
73
+ * @param bool $useRefHandles False to hide global ref. handles.
74
+ *
75
+ * @return self A clone of $this.
76
+ */
77
+ public function withRefHandles ($ useRefHandles )
78
+ {
79
+ $ data = clone $ this ;
80
+ $ data ->useRefHandles = $ useRefHandles ? -1 : 0 ;
81
+
82
+ return $ data ;
83
+ }
84
+
40
85
/**
41
86
* Returns a depth limited clone of $this.
42
87
*
@@ -45,9 +90,13 @@ public function getRawData()
45
90
* @param bool $useRefHandles False to hide ref. handles.
46
91
*
47
92
* @return self A depth limited clone of $this.
93
+ *
94
+ * @deprecated since Symfony 2.7, to be removed in 3.0. Use withMaxDepth, withMaxItemsPerDepth or withRefHandles instead.
48
95
*/
49
96
public function getLimitedClone ($ maxDepth , $ maxItemsPerDepth , $ useRefHandles = true )
50
97
{
98
+ trigger_error ('The ' .__METHOD__ .' method is deprecated since Symfony 2.7 and will be removed in 3.0. Use withMaxDepth, withMaxItemsPerDepth or withRefHandles methods instead. ' , E_USER_DEPRECATED );
99
+
51
100
$ data = clone $ this ;
52
101
$ data ->maxDepth = (int ) $ maxDepth ;
53
102
$ data ->maxItemsPerDepth = (int ) $ maxItemsPerDepth ;
0 commit comments