77use JsonSchema \ConstraintError ;
88use JsonSchema \Constraints \Constraint ;
99use JsonSchema \Entity \JsonPointer ;
10+ use JsonSchema \SchemaStorage ;
11+ use JsonSchema \Uri \UriRetriever ;
1012
1113class Draft06Constraint extends Constraint
1214{
13- public function __construct ()
15+ public function __construct (\ JsonSchema \ Constraints \ Factory $ factory = null )
1416 {
15- parent ::__construct (new Factory ());
17+
18+ parent ::__construct (new Factory (
19+ $ factory ? $ factory ->getSchemaStorage () : new SchemaStorage (),
20+ $ factory ? $ factory ->getUriRetriever () : new UriRetriever (),
21+ $ factory ? $ factory ->getConfig () : Constraint::CHECK_MODE_NORMAL ,
22+ ));
1623 }
1724
1825 public function check (&$ value , $ schema = null , ?JsonPointer $ path = null , $ i = null ): void
@@ -26,6 +33,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n
2633 }
2734
2835 // Apply defaults
36+ $ this ->checkForKeyword ('ref ' , $ value , $ schema , $ path , $ i );
2937 $ this ->checkForKeyword ('required ' , $ value , $ schema , $ path , $ i );
3038 $ this ->checkForKeyword ('contains ' , $ value , $ schema , $ path , $ i );
3139 $ this ->checkForKeyword ('properties ' , $ value , $ schema , $ path , $ i );
0 commit comments