Skip to content

Commit d97cf3c

Browse files
committed
Merge pull request #92 from AwardWallet/master
added configurable maximum recursion depth
2 parents cb428b3 + ac13166 commit d97cf3c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/JsonSchema/RefResolver.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class RefResolver
2929
*/
3030
protected static $depth = 0;
3131

32+
/**
33+
* maximum references depth
34+
* @var integer
35+
*/
36+
public static $maxDepth = 7;
37+
3238
/**
3339
* @var UriRetrieverInterface
3440
*/
@@ -89,7 +95,7 @@ public function getUriRetriever()
8995
*/
9096
public function resolve($schema, $sourceUri = null)
9197
{
92-
if (self::$depth > 7) {
98+
if (self::$depth > self::$maxDepth) {
9399
return;
94100
}
95101
++self::$depth;

0 commit comments

Comments
 (0)