Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusnordlander committed Oct 18, 2015
1 parent 8095a0a commit 45e506b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ValidationFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
class ValidationFailedException extends \RuntimeException
{
protected $violations;
protected $message;
protected $violatingMessage;

public function __construct($message, ConstraintViolationListInterface $violations)
public function __construct($violatingMessage, ConstraintViolationListInterface $violations)
{
$this->message = $message;
$this->violatingMessage = $violatingMessage;
$this->violations = $violations;

parent::__construct($this->__toString());
}

public function __toString()
{
return sprintf("Message of type %s failed validation\n\n%s", get_class($this->message), (string)$this->violations);
return sprintf("Message of type %s failed validation\n\n%s", get_class($this->violatingMessage), (string)$this->violations);
}

public function getMessage()
public function getViolatingMessage()
{
return $this->message;
return $this->violatingMessage;
}

public function getViolations()
Expand Down

0 comments on commit 45e506b

Please sign in to comment.