Skip to content

Commit

Permalink
Reset errors prior to validation (jsonrainbow#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd committed Mar 22, 2017
1 parent 04d8fd9 commit e9c4506
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/JsonSchema/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class Validator extends BaseConstraint
*/
public function validate(&$value, $schema = null, $checkMode = null)
{
// reset errors prior to validation
$this->reset();

// set checkMode
$initialCheckMode = $this->factory->getConfig();
if ($checkMode !== null) {
$this->factory->setConfig($checkMode);
Expand Down

0 comments on commit e9c4506

Please sign in to comment.