1 | <?php |
||
11 | class CircularReferenceGuard { |
||
12 | |||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private static $circularRefGuard = array(); |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $namespace = ''; |
||
22 | |||
23 | /** |
||
24 | * @var integer |
||
25 | */ |
||
26 | private $maxRecursionDepth = 1; |
||
27 | |||
28 | /** |
||
29 | * @since 2.2 |
||
30 | * |
||
31 | * @param string $namespace |
||
32 | */ |
||
33 | public function __construct( $namespace = '' ) { |
||
36 | |||
37 | /** |
||
38 | * @since 2.2 |
||
39 | * |
||
40 | * @param integer $maxRecursionDepth |
||
41 | */ |
||
42 | public function setMaxRecursionDepth( $maxRecursionDepth ) { |
||
45 | |||
46 | /** |
||
47 | * @since 2.2 |
||
48 | * |
||
49 | * @param string $hash |
||
50 | */ |
||
51 | public function mark( $hash ) { |
||
59 | |||
60 | /** |
||
61 | * @since 2.2 |
||
62 | * |
||
63 | * @param string $hash |
||
64 | */ |
||
65 | public function unmark( $hash ) { |
||
73 | |||
74 | /** |
||
75 | * @since 2.2 |
||
76 | * |
||
77 | * @param string $hash |
||
78 | * |
||
79 | * @return boolean |
||
80 | */ |
||
81 | public function isCircularByRecursionFor( $hash ) { |
||
84 | |||
85 | /** |
||
86 | * @since 2.2 |
||
87 | * |
||
88 | * @param string $hash |
||
89 | * |
||
90 | * @return integer |
||
91 | */ |
||
92 | public function get( $hash ) { |
||
100 | |||
101 | /** |
||
102 | * @since 2.2 |
||
103 | * |
||
104 | * @param string $namespace |
||
105 | */ |
||
106 | public function reset( $namespace ) { |
||
109 | |||
110 | } |
||
111 |