Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
23 changes: 0 additions & 23 deletions src/Mouf/Mvc/Splash/Services/SplashRequestParameterFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ class SplashRequestParameterFetcher implements SplashParameterFetcherInterface
{
private $key;

/**
* @var array<ValidatorInterface>
*/
private $validators = array();

/**
* Whether the parameter is compulsory or not.
*
Expand Down Expand Up @@ -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.
*
Expand All @@ -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;
Expand Down
22 changes: 0 additions & 22 deletions src/Mouf/Mvc/Splash/Services/SplashUrlParameterFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ class SplashUrlParameterFetcher implements SplashParameterFetcherInterface
{
private $key;

/**
* @var array<ValidatorInterface>
*/
private $validators = array();

/**
* Constructor.
*
Expand All @@ -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.
*
Expand All @@ -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;
}
Expand Down
17 changes: 0 additions & 17 deletions src/Mouf/Mvc/Splash/Services/SplashUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Mouf/Mvc/Splash/Store/SplashUrlNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down