Skip to content

Commit

Permalink
update country validator
Browse files Browse the repository at this point in the history
  • Loading branch information
ojhaujjwal committed Aug 16, 2014
1 parent e74f42b commit c6acf59
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Validator/CountryValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
*/
class CountryValidator extends AbstractValidator
{
const INVALID = 'countryInvalid';
const COUNTRY_NOT_FOUND = 'countryNotFound';
const INVALID = 'countryInvalid';
const COUNTRY_NOT_FOUND = 'countryNotFound';

/**
* @var array
*/
protected $messageTemplates = array(
self::INVALID => 'Invalid type given. String expected',
self::INVALID => 'Invalid type given. String expected',
self::COUNTRY_NOT_FOUND => 'Country %value% was not found',
);

Expand Down Expand Up @@ -73,6 +73,8 @@ public function getLoader()
*/
public function isValid($value)
{
$this->setValue($value);

if ($value instanceof CountryInterface) {
return true;
}
Expand Down

0 comments on commit c6acf59

Please sign in to comment.