Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
- Re-add parts of exception messages that were removed
- Remove unnecessary else blocks
  • Loading branch information
weierophinney committed Aug 16, 2012
1 parent 5a68afc commit d19b2a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,30 +159,30 @@ public function createInput($inputSpecification)
case 'filters':
if (!is_array($value) && !$value instanceof Traversable && !$value instanceof FilterChain) {
throw new Exception\RuntimeException(sprintf(
'%s expects the value associated with "filters" to be an array/Traversable of filters or a FilterChain; received "%s"',
'%s expects the value associated with "filters" to be an array/Traversable of filters or filter specifications, or a FilterChain; received "%s"',
__METHOD__,
(is_object($value) ? get_class($value) : gettype($value))
));
}
if ($value instanceof FilterChain) {
$input->setFilterChain($value);
} else {
$this->populateFilters($input->getFilterChain(), $value);
break;
}
$this->populateFilters($input->getFilterChain(), $value);
break;
case 'validators':
if (!is_array($value) && !$value instanceof Traversable && !$value instanceof ValidatorChain) {
throw new Exception\RuntimeException(sprintf(
'%s expects the value associated with "validators" to be an array/Traversable of validators or a ValidatorChain; received "%s"',
'%s expects the value associated with "validators" to be an array/Traversable of validators or validator specifications, or a ValidatorChain; received "%s"',
__METHOD__,
(is_object($value) ? get_class($value) : gettype($value))
));
}
if ($value instanceof ValidatorChain) {
$input->setValidatorChain($value);
} else {
$this->populateValidators($input->getValidatorChain(), $value);
break;
}
$this->populateValidators($input->getValidatorChain(), $value);
break;
default:
// ignore unknown keys
Expand Down

0 comments on commit d19b2a6

Please sign in to comment.