Skip to content

Commit 1547b4c

Browse files
committed
Turn Factory::coerce() into an alias of Factory::check()
1 parent 002afba commit 1547b4c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/JsonSchema/Validator.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,9 @@ public function check(&$value, $schema = null, JsonPointer $path = null, $i = nu
4545
*
4646
* {@inheritDoc}
4747
*/
48-
public function coerce(&$value, $schema = null, JsonPointer $path = null, $i = null)
48+
public function coerce(&$value, $schema = null)
4949
{
5050
$this->factory->setConfig(array('coerce-types' => true));
51-
$validator = $this->factory->createInstanceFor('schema');
52-
$validator->check($value, $schema);
53-
54-
$this->addErrors(array_unique($validator->getErrors(), SORT_REGULAR));
51+
return $this->check($value, $schema);
5552
}
5653
}

0 commit comments

Comments
 (0)