diff --git a/src/BaseInputFilter.php b/src/BaseInputFilter.php index 3b3f7284..8d8f1f45 100644 --- a/src/BaseInputFilter.php +++ b/src/BaseInputFilter.php @@ -15,7 +15,7 @@ use Zend\Stdlib\ArrayUtils; /** - * @todo How should we deal with required input when data is missing? + * @todo How should we deal with required input when data is missing? * should a message be returned? if so, what message? * @category Zend * @package Zend_InputFilter @@ -32,7 +32,7 @@ class BaseInputFilter implements InputFilterInterface * Countable: number of inputs in this input filter * * Only details the number of direct children. - * + * * @return int */ public function count() @@ -76,8 +76,8 @@ public function add($input, $name = null) /** * Retrieve a named input - * - * @param string $name + * + * @param string $name * @return InputInterface|InputFilterInterface */ public function get($name) @@ -94,8 +94,8 @@ public function get($name) /** * Test if an input or input filter by the given name is attached - * - * @param string $name + * + * @param string $name * @return bool */ public function has($name) @@ -105,8 +105,8 @@ public function has($name) /** * Set data to use when validating and filtering - * - * @param array|Traversable $data + * + * @param array|Traversable $data * @return InputFilterInterface */ public function setData($data) @@ -128,7 +128,7 @@ public function setData($data) /** * Is the data set valid? - * + * * @return bool */ public function isValid() @@ -143,11 +143,11 @@ public function isValid() $this->validInputs = array(); $this->invalidInputs = array(); $valid = true; - + $inputs = $this->validationGroup ?: array_keys($this->inputs); //var_dump($inputs); foreach ($inputs as $name) { - $input = $this->inputs[$name]; + $input = $this->inputs[$name]; if (!array_key_exists($name, $this->data) || (is_string($this->data[$name]) && strlen($this->data[$name]) === 0)) { if($input instanceof InputInterface) { // - test if input is required @@ -203,8 +203,8 @@ public function isValid() * * Implementations should allow passing a single array value, or multiple arguments, * each specifying a single input. - * - * @param mixed $name + * + * @param mixed $name * @return InputFilterInterface */ public function setValidationGroup($name) @@ -247,7 +247,7 @@ public function setValidationGroup($name) * * Implementations should return an associative array of name/input pairs * that failed validation. - * + * * @return InputInterface[] */ public function getInvalidInput() @@ -260,7 +260,7 @@ public function getInvalidInput() * * Implementations should return an associative array of name/input pairs * that passed validation. - * + * * @return InputInterface[] */ public function getValidInput() @@ -270,8 +270,8 @@ public function getValidInput() /** * Retrieve a value from a named input - * - * @param string $name + * + * @param string $name * @return mixed */ public function getValue($name) @@ -292,7 +292,7 @@ public function getValue($name) * * List should be an associative array, with the values filtered. If * validation failed, this should raise an exception. - * + * * @return array */ public function getValues() @@ -313,8 +313,8 @@ public function getValues() /** * Retrieve a raw (unfiltered) value from a named input - * - * @param string $name + * + * @param string $name * @return mixed */ public function getRawValue($name) @@ -335,7 +335,7 @@ public function getRawValue($name) * * List should be an associative array of named input/value pairs, * with the values unfiltered. - * + * * @return array */ public function getRawValues() @@ -356,7 +356,7 @@ public function getRawValues() * * Should return an associative array of named input/message list pairs. * Pairs should only be returned for inputs that failed validation. - * + * * @return array */ public function getMessages() @@ -370,8 +370,8 @@ public function getMessages() /** * Ensure all names of a validation group exist as input in the filter - * - * @param array $inputs + * + * @param array $inputs * @return void * @throws Exception\InvalidArgumentException */ @@ -389,7 +389,7 @@ protected function validateValidationGroup(array $inputs) /** * Populate the values of all attached inputs - * + * * @return void */ protected function populate() diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index b3eb74a7..bf370700 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -15,6 +15,6 @@ * @package Zend_InputFilter * @subpackage Exception */ -class InvalidArgumentException extends \InvalidArgumentException implements +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface {} diff --git a/src/Factory.php b/src/Factory.php index 46dc690b..c5aea31c 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -36,7 +36,7 @@ public function setDefaultFilterChain(FilterChain $filterChain) $this->defaultFilterChain = $filterChain; return $this; } - + /** * Get default filter chain, if any * @@ -49,7 +49,7 @@ public function getDefaultFilterChain() /** * Clear the default filter chain (i.e., don't inject one into new inputs) - * + * * @return void */ public function clearDefaultFilterChain() @@ -68,7 +68,7 @@ public function setDefaultValidatorChain(ValidatorChain $validatorChain) $this->defaultValidatorChain = $validatorChain; return $this; } - + /** * Get default validator chain, if any * @@ -81,7 +81,7 @@ public function getDefaultValidatorChain() /** * Clear the default validator chain (i.e., don't inject one into new inputs) - * + * * @return void */ public function clearDefaultValidatorChain() @@ -91,8 +91,8 @@ public function clearDefaultValidatorChain() /** * Factory for input objects - * - * @param array|Traversable $inputSpecification + * + * @param array|Traversable $inputSpecification * @return InputInterface|InputFilterInterface */ public function createInput($inputSpecification) @@ -187,8 +187,8 @@ public function createInput($inputSpecification) /** * Factory for input filters - * - * @param array|Traversable $inputFilterSpecification + * + * @param array|Traversable $inputFilterSpecification * @return InputFilterInterface */ public function createInputFilter($inputFilterSpecification) diff --git a/src/InputFilter.php b/src/InputFilter.php index 8ee115e8..a6721608 100644 --- a/src/InputFilter.php +++ b/src/InputFilter.php @@ -25,8 +25,8 @@ class InputFilter extends BaseInputFilter /** * Set factory to use when adding inputs and filters by spec - * - * @param Factory $factory + * + * @param Factory $factory * @return InputFilter */ public function setFactory(Factory $factory) @@ -39,7 +39,7 @@ public function setFactory(Factory $factory) * Get factory to use when adding inputs and filters by spec * * Lazy-loads a Factory instance if none attached. - * + * * @return Factory */ public function getFactory() @@ -52,9 +52,9 @@ public function getFactory() /** * Add an input to the input filter - * - * @param array|Traversable|InputInterface|InputFilterInterface $input - * @param null|string $name + * + * @param array|Traversable|InputInterface|InputFilterInterface $input + * @param null|string $name * @return InputFilter */ public function add($input, $name = null) diff --git a/src/InputFilterAwareInterface.php b/src/InputFilterAwareInterface.php index c6fd9709..6dce79d5 100644 --- a/src/InputFilterAwareInterface.php +++ b/src/InputFilterAwareInterface.php @@ -18,15 +18,15 @@ interface InputFilterAwareInterface { /** * Set input filter - * - * @param InputFilterInterface $inputFilter + * + * @param InputFilterInterface $inputFilter * @return InputFilterAwareInterface */ public function setInputFilter(InputFilterInterface $inputFilter); /** * Retrieve input filter - * + * * @return InputFilterInterface */ public function getInputFilter(); diff --git a/src/InputFilterInterface.php b/src/InputFilterInterface.php index f4ace5f3..089ba203 100644 --- a/src/InputFilterInterface.php +++ b/src/InputFilterInterface.php @@ -22,8 +22,8 @@ interface InputFilterInterface extends Countable /** * Add an input to the input filter - * - * @param InputInterface|InputFilterInterface $input + * + * @param InputInterface|InputFilterInterface $input * @param null|string $name Name used to retrieve this input * @return InputFilterInterface */ @@ -31,31 +31,31 @@ public function add($input, $name = null); /** * Retrieve a named input - * - * @param string $name + * + * @param string $name * @return InputInterface|InputFilterInterface */ public function get($name); /** * Test if an input or input filter by the given name is attached - * - * @param string $name + * + * @param string $name * @return bool */ public function has($name); /** * Set data to use when validating and filtering - * - * @param array|Traversable $data + * + * @param array|Traversable $data * @return InputFilterInterface */ public function setData($data); /** * Is the data set valid? - * + * * @return bool */ public function isValid(); @@ -70,8 +70,8 @@ public function isValid(); * * Implementations should allow passing a single array value, or multiple arguments, * each specifying a single input. - * - * @param mixed $name + * + * @param mixed $name * @return InputFilterInterface */ public function setValidationGroup($name); @@ -81,7 +81,7 @@ public function setValidationGroup($name); * * Implementations should return an associative array of name/input pairs * that failed validation. - * + * * @return InputInterface[] */ public function getInvalidInput(); @@ -91,15 +91,15 @@ public function getInvalidInput(); * * Implementations should return an associative array of name/input pairs * that passed validation. - * + * * @return InputInterface[] */ public function getValidInput(); /** * Retrieve a value from a named input - * - * @param string $name + * + * @param string $name * @return mixed */ public function getValue($name); @@ -109,15 +109,15 @@ public function getValue($name); * * List should be an associative array, with the values filtered. If * validation failed, this should raise an exception. - * + * * @return array */ public function getValues(); /** * Retrieve a raw (unfiltered) value from a named input - * - * @param string $name + * + * @param string $name * @return mixed */ public function getRawValue($name); @@ -127,7 +127,7 @@ public function getRawValue($name); * * List should be an associative array of named input/value pairs, * with the values unfiltered. - * + * * @return array */ public function getRawValues(); @@ -137,7 +137,7 @@ public function getRawValues(); * * Should return an associative array of named input/message list pairs. * Pairs should only be returned for inputs that failed validation. - * + * * @return array */ public function getMessages(); diff --git a/src/InputFilterProviderInterface.php b/src/InputFilterProviderInterface.php index 630fe4ec..2759a918 100644 --- a/src/InputFilterProviderInterface.php +++ b/src/InputFilterProviderInterface.php @@ -17,9 +17,9 @@ interface InputFilterProviderInterface { /** - * Should return an array specification compatible with + * Should return an array specification compatible with * {@link Zend\InputFilter\Factory::createInputFilter()}. - * + * * @return array */ public function getInputFilterSpecification(); diff --git a/src/InputProviderInterface.php b/src/InputProviderInterface.php index fa254c34..98290605 100644 --- a/src/InputProviderInterface.php +++ b/src/InputProviderInterface.php @@ -17,9 +17,9 @@ interface InputProviderInterface { /** - * Should return an array specification compatible with + * Should return an array specification compatible with * {@link Zend\InputFilter\Factory::createInput()}. - * + * * @return array */ public function getInputSpecification(); diff --git a/test/BaseInputFilterTest.php b/test/BaseInputFilterTest.php index 12cfd4b0..5dec9f4c 100644 --- a/test/BaseInputFilterTest.php +++ b/test/BaseInputFilterTest.php @@ -67,11 +67,11 @@ public function getInputFilter() $bar = new Input(); $bar->getFilterChain()->attachByName('stringtrim'); $bar->getValidatorChain()->addValidator(new Validator\Digits()); - + $baz = new Input(); $baz->setRequired(false); $baz->getFilterChain()->attachByName('stringtrim'); - $baz->getValidatorChain()->addValidator(new Validator\StringLength(1, 6)); + $baz->getValidatorChain()->addValidator(new Validator\StringLength(1, 6)); $filter->add($foo, 'foo') ->add($bar, 'bar') @@ -98,7 +98,7 @@ public function getChildInputFilter() $baz->setRequired(false); $baz->getFilterChain()->attachByName('stringtrim'); $baz->getValidatorChain()->addValidator(new Validator\StringLength(1, 6)); - + $filter->add($foo, 'foo') ->add($bar, 'bar') ->add($baz, 'baz'); @@ -322,7 +322,7 @@ public function testCanConditionallyInvokeValidators() */ /** - * Idea for this one is that validation may need to rely on context -- e.g., a "password confirmation" + * Idea for this one is that validation may need to rely on context -- e.g., a "password confirmation" * field may need to know what the original password entered was in order to compare. */ public function testValidationCanUseContext() diff --git a/test/FactoryTest.php b/test/FactoryTest.php index 80332946..adecdd20 100644 --- a/test/FactoryTest.php +++ b/test/FactoryTest.php @@ -215,7 +215,7 @@ public function testFactoryWillCreateInputWithSuggestedRequiredFlagAndAlternativ $this->assertInstanceOf('Zend\InputFilter\InputInterface', $input); $this->assertFalse($input->isRequired()); $this->assertFalse($input->allowEmpty()); - + } public function testFactoryWillCreateInputWithSuggestedAllowEmptyFlagAndImpliesRequiredFlag() @@ -314,7 +314,7 @@ public function testFactoryWillCreateInputFilterAndAllInputObjectsFromGivenConfi )); $this->assertInstanceOf('Zend\InputFilter\InputFilter', $inputFilter); $this->assertEquals(4, count($inputFilter)); - + foreach (array('foo', 'bar', 'baz', 'bat') as $name) { $input = $inputFilter->get($name);