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

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into feat…
Browse files Browse the repository at this point in the history
…ure/console
  • Loading branch information
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 73 deletions.
50 changes: 25 additions & 25 deletions src/BaseInputFilter.php
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -128,7 +128,7 @@ public function setData($data)

/**
* Is the data set valid?
*
*
* @return bool
*/
public function isValid()
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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)
Expand All @@ -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()
Expand All @@ -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)
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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
*/
Expand All @@ -389,7 +389,7 @@ protected function validateValidationGroup(array $inputs)

/**
* Populate the values of all attached inputs
*
*
* @return void
*/
protected function populate()
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidArgumentException.php
Expand Up @@ -15,6 +15,6 @@
* @package Zend_InputFilter
* @subpackage Exception
*/
class InvalidArgumentException extends \InvalidArgumentException implements
class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
{}
16 changes: 8 additions & 8 deletions src/Factory.php
Expand Up @@ -36,7 +36,7 @@ public function setDefaultFilterChain(FilterChain $filterChain)
$this->defaultFilterChain = $filterChain;
return $this;
}

/**
* Get default filter chain, if any
*
Expand All @@ -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()
Expand All @@ -68,7 +68,7 @@ public function setDefaultValidatorChain(ValidatorChain $validatorChain)
$this->defaultValidatorChain = $validatorChain;
return $this;
}

/**
* Get default validator chain, if any
*
Expand All @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions src/InputFilter.php
Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/InputFilterAwareInterface.php
Expand Up @@ -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();
Expand Down

0 comments on commit d67242e

Please sign in to comment.