Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Commit

Permalink
Fix undefined property error
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed May 21, 2016
1 parent 358fd15 commit b875573
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Mapping/BindResult.php
Expand Up @@ -49,21 +49,24 @@ public static function fromFormErrorSequence(FormErrorSequence $formErrorSequenc

public function isSuccess()
{
return null === $this->formErrors;
return null === $this->formErrorSequence;
}

/**
* @return mixed
*/
public function getValue()
{
Assertion::same(null, $this->formErrors, 'Value can only be retrieved when bind result was successful');
Assertion::same(null, $this->formErrorSequence, 'Value can only be retrieved when bind result was successful');
return $this->value;
}

public function getFormErrorSequence() : FormErrorSequence
{
Assertion::notNull($this->formErrors, 'Form errors can only be retrieved when bind result was not successful');
Assertion::notNull(
$this->formErrorSequence,
'Form errors can only be retrieved when bind result was not successful'
);
return $this->formErrors;
}
}

0 comments on commit b875573

Please sign in to comment.