for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File containing the {@link Request_Param_Validator_Valueslist} class.
*
* @package Application Utils
* @subpackage Request
* @see Request_Param_Validator_Valueslist
*/
declare(strict_types=1);
namespace AppUtils;
* Makes sure that the value is an array.
* @author Sebastian Mordziol <[email protected]>
class Request_Param_Validator_Valueslist extends Request_Param_Validator
{
public function getDefaultOptions() : array
return array(
'values' => array()
);
}
protected function _validate()
if(!is_array($this->value)) {
return array();
$keep = array();
foreach($this->value as $item) {
if(in_array($item, $this->getArrayOption('values'))) {
$keep[] = $item;
return $keep;