src/ItePHP/Action/ArgumentEvent.php
private function validateArgument(Request $request , ConfigContainer $config , $position){
		$value=null;
		switch($config->getValue('storage')){
			case 'url':
				$value=$this->validateUrl($request , $config , $position);
			break;
			case 'post':
				$value=$this->validateGetPost($request->getData() , $config , $position);
			break;
			case 'get':
				$value=$this->validateGetPost($request->getQuery() , $config , $position);
			break;
			default:
				throw new InvalidConfigValueException('storage',$config->getValue('storage'));

		}

		$validatorName=$config->getValue('validator');
		if($validatorName!==''){
            /**
             * @var ValidatorAbstract $validatorObject
             */
			$validatorObject=new $validatorName();
			$error=$validatorObject->validate($value);
			if($error){
				throw new InvalidArgumentException($position,$config->getValue('name'),$error);
			}
		}

		$mapperName=$config->getValue('mapper');
		if($mapperName!==''){
            /**
             * @var MapperAbstract $mapper
             */
			$mapper=new $mapperName($this->container);
			$value=$mapper->cast($value);
		}
		$request->setArgument($config->getValue('name'),$value);

	}
private function validateArgument(Request $request , ConfigContainer $config , $position){
		$value=null;
		switch($config->getValue('storage')){
			case 'url':
				$value=$this->validateUrl($request , $config , $position);
			break;
			case 'post':
				$value=$this->validateGetPost($request->getData() , $config , $position);
			break;
			case 'get':
				$value=$this->validateGetPost($request->getQuery() , $config , $position);
			break;
			default:
				throw new InvalidConfigValueException('storage',$config->getValue('storage'));

		}

		$validatorName=$config->getValue('validator');
		if($validatorName!==''){
            /**
             * @var ValidatorAbstract $validatorObject
             */
			$validatorObject=new $validatorName();
			$error=$validatorObject->validate($value);
			if($error){
				throw new InvalidArgumentException($position,$config->getValue('name'),$error);
			}
		}

		$mapperName=$config->getValue('mapper');
		if($mapperName!==''){
            /**
             * @var MapperAbstract $mapper
             */
			$mapper=new $mapperName($this->container);
			$value=$mapper->cast($value);
		}
		$request->setArgument($config->getValue('name'),$value);

	}
Validate argument.

@param Request $request
@param ConfigContainer $config argument
@param int $position
@throws InvalidConfigValueException
@throws InvalidArgumentException