From d520e82d9ebd8c9cf59ffd5abe97ad4fc35e8818 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 2 Sep 2016 18:11:02 +0200 Subject: [PATCH] [Bridge] Fix function names is* implies Boolean return values, which is not true for these functions --- lib/Bridge.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/Bridge.php b/lib/Bridge.php index 831a4f4..789289b 100644 --- a/lib/Bridge.php +++ b/lib/Bridge.php @@ -143,7 +143,7 @@ abstract class BridgeAbstract implements BridgeInterface { return $this->items; } - protected function isValidTextValue($value, $pattern = null){ + protected function validateTextValue($value, $pattern = null){ if(!is_null($pattern)){ $filteredValue = filter_var($value, FILTER_VALIDATE_REGEXP, array('options' => array( @@ -160,7 +160,7 @@ abstract class BridgeAbstract implements BridgeInterface { return $filteredValue; } - protected function isValidNumberValue($value){ + protected function validateNumberValue($value){ $filteredValue = filter_var($value, FILTER_VALIDATE_INT); if($filteredValue === false && !empty($value)) @@ -169,7 +169,7 @@ abstract class BridgeAbstract implements BridgeInterface { return $filteredValue; } - protected function isValidCheckboxValue($value){ + protected function validateCheckboxValue($value){ $filteredValue = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); if(is_null($filteredValue)) @@ -178,7 +178,7 @@ abstract class BridgeAbstract implements BridgeInterface { return $filteredValue; } - protected function isValidListValue($value, $expectedValues){ + protected function validateListValue($value, $expectedValues){ $filteredValue = filter_var($value); if($filteredValue === false) @@ -211,20 +211,20 @@ abstract class BridgeAbstract implements BridgeInterface { switch($set[$name]['type']){ case 'number': - $data[$name] = $this->isValidNumberValue($value); + $data[$name] = $this->validateNumberValue($value); break; case 'checkbox': - $data[$name] = $this->isValidCheckboxValue($value); + $data[$name] = $this->validateCheckboxValue($value); break; case 'list': - $data[$name] = $this->isValidListValue($value, $set[$name]['values']); + $data[$name] = $this->validateListValue($value, $set[$name]['values']); break; default: case 'text': if(isset($set[$name]['pattern'])){ - $data[$name] = $this->isValidTextValue($value, $set[$name]['pattern']); + $data[$name] = $this->validateTextValue($value, $set[$name]['pattern']); } else { - $data[$name] = $this->isValidTextValue($value); + $data[$name] = $this->validateTextValue($value); } break; }