diff --git a/Service/Validator/AbstractImageValidator.php b/Service/Validator/AbstractImageValidator.php index fce0fed..a6fdf3b 100644 --- a/Service/Validator/AbstractImageValidator.php +++ b/Service/Validator/AbstractImageValidator.php @@ -10,7 +10,7 @@ namespace Jb\Bundle\FileUploaderBundle\Service\Validator; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; use Jb\Bundle\FileUploaderBundle\Exception\ValidationException; /** @@ -23,9 +23,9 @@ abstract class AbstractImageValidator extends AbstractValidator /** * {@inheritdoc} */ - protected function configureOptions(OptionsResolverInterface $resolver) + protected function configureOptions(OptionsResolver $resolver) { - $resolver->setOptional(array( + $resolver->setDefined(array( 'MinWidth', 'MaxWidth', 'MinHeight', diff --git a/Service/Validator/AbstractValidator.php b/Service/Validator/AbstractValidator.php index 296433b..305cd83 100644 --- a/Service/Validator/AbstractValidator.php +++ b/Service/Validator/AbstractValidator.php @@ -11,7 +11,6 @@ namespace Jb\Bundle\FileUploaderBundle\Service\Validator; use Symfony\Component\OptionsResolver\OptionsResolver; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * AbstractValidator @@ -23,9 +22,9 @@ abstract class AbstractValidator /** * Configure the validator * - * @param OptionsResolverInterface $resolver + * @param OptionsResolver $resolver */ - protected function configureOptions(OptionsResolverInterface $resolver) + protected function configureOptions(OptionsResolver $resolver) { } @@ -51,6 +50,7 @@ public function applyValidator($value, array $configuration) * Extract the value used in the validator * * @param mixed $value + * @return mixed|string */ protected function formatValue($value) {