diff --git a/composer.json b/composer.json index c66be02..459364e 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,6 @@ "php" : ">=5.3.0", "mouf/utils.cache.apc-cache" : "~2.1", "mouf/utils.cache.file-cache" : "~2.1", - "mouf/utils.common.validators" : "3.*", "mouf/html.htmlelement" : "2.*", "mouf/utils.action.common-action" : "~1.0", "mouf/utils.common.url-interface" : "~1.0", diff --git a/src/Mouf/Mvc/Splash/Services/SplashRequestParameterFetcher.php b/src/Mouf/Mvc/Splash/Services/SplashRequestParameterFetcher.php index b7cdd06..77dc54d 100644 --- a/src/Mouf/Mvc/Splash/Services/SplashRequestParameterFetcher.php +++ b/src/Mouf/Mvc/Splash/Services/SplashRequestParameterFetcher.php @@ -13,11 +13,6 @@ class SplashRequestParameterFetcher implements SplashParameterFetcherInterface { private $key; - /** - * @var array - */ - private $validators = array(); - /** * Whether the parameter is compulsory or not. * @@ -54,16 +49,6 @@ public function getName() return $this->key; } - /** - * Adds a validator to the parameter fetcher. - * - * @param ValidatorInterface $validator - */ - public function registerValidator(ValidatorInterface $validator) - { - $this->validators[] = $validator; - } - /** * We pass the context of the request, the object returns the value to fill. * @@ -84,14 +69,6 @@ public function fetchValue(SplashRequestContext $context) $value = $getVals[$this->key]; } if ($value !== null) { - foreach ($this->validators as $validator) { - /* @var $validator ValidatorInterface */ - $result = $validator->doValidate($value); - if (!$result) { - throw new SplashValidationException($validator->getErrorMessage()); - } - } - return $value; } elseif (!$this->compulsory) { return $this->default; diff --git a/src/Mouf/Mvc/Splash/Services/SplashUrlParameterFetcher.php b/src/Mouf/Mvc/Splash/Services/SplashUrlParameterFetcher.php index d2d3214..5e1dd15 100644 --- a/src/Mouf/Mvc/Splash/Services/SplashUrlParameterFetcher.php +++ b/src/Mouf/Mvc/Splash/Services/SplashUrlParameterFetcher.php @@ -13,11 +13,6 @@ class SplashUrlParameterFetcher implements SplashParameterFetcherInterface { private $key; - /** - * @var array - */ - private $validators = array(); - /** * Constructor. * @@ -38,16 +33,6 @@ public function getName() return $this->key; } - /** - * Adds a validator to the parameter fetcher. - * - * @param ValidatorInterface $validator - */ - public function registerValidator(ValidatorInterface $validator) - { - $this->validators[] = $validator; - } - /** * We pass the context of the request, the object returns the value to fill. * @@ -59,13 +44,6 @@ public function fetchValue(SplashRequestContext $context) { $request = $context->getUrlParameters(); $value = $request[$this->key]; - foreach ($this->validators as $validator) { - /* @var $validator ValidatorInterface */ - $result = $validator->doValidate($value); - if (!$result) { - throw new SplashValidationException($validator->getErrorMessage()); - } - } return $value; } diff --git a/src/Mouf/Mvc/Splash/Services/SplashUtils.php b/src/Mouf/Mvc/Splash/Services/SplashUtils.php index 7b70c89..038ae81 100644 --- a/src/Mouf/Mvc/Splash/Services/SplashUtils.php +++ b/src/Mouf/Mvc/Splash/Services/SplashUtils.php @@ -104,23 +104,6 @@ public static function mapParameters(MoufReflectionMethod $refMethod, URLAnnotat // Then, we should add a "OrValidator" that validate one of the conditions. // Note: a AndValidator might be cool to. // FIXME - // FIXME - // FIXME - // FIXME - // FIXME - // FIXME - // FIXME - // FIXME - // FIXME - /*$type = strtolower($annotation->getTypes()); - if ($type == "float" || $type == "double" || $type == "real" || $type == "number") { - $numericValidator = new NumericValidator(); - $value->registerValidator($numericValidator); - } elseif ($type == "int" || $type == "integer") { - $intValidator = new NumericValidator(); - $intValidator->allowDecimals = false; - $value->registerValidator($intValidator); - }*/ $values[] = $value; $found = true; break; diff --git a/src/Mouf/Mvc/Splash/Store/SplashUrlNode.php b/src/Mouf/Mvc/Splash/Store/SplashUrlNode.php index 759f19d..45cb46c 100644 --- a/src/Mouf/Mvc/Splash/Store/SplashUrlNode.php +++ b/src/Mouf/Mvc/Splash/Store/SplashUrlNode.php @@ -158,7 +158,7 @@ private function walkArray(array $urlParts, ServerRequestInterface $request, ar } else { foreach ($this->parameterizedChildren as $varName => $splashUrlNode) { if (isset($parameters[$varName])) { - throw new SplashException("An error occured while looking at the list URL managed in Splash. In a @URL annotation, the parameter '$parameter' appears twice. That should never happen"); + throw new SplashException("An error occured while looking at the list URL managed in Splash. In a @URL annotation, the parameter '{$parameters[$varName]}' appears twice. That should never happen"); } $newParams = $parameters; $newParams[$varName] = $key;