Skip to content

Commit

Permalink
Update ValueValidatorBase.php
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenDeDauw authored Jan 22, 2021
1 parent 9b4fabe commit 193075a
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions src/PackagePrivate/ValueValidatorBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@
use ValueValidators\ValueValidator;

/**
* ValueValidator that holds base validation functions for any type of object.
*
* @since 0.1
*
* @license GPL-2.0+
* @author Jeroen De Dauw < [email protected] >
* @internal
*/
abstract class ValueValidatorBase implements ValueValidator {

/**
* A list of allowed values. This means the parameters value(s) must be in the list
* during validation. False for no restriction.
*
* @since 0.1
*
* @var array|false
*/
protected $allowedValues = false;
Expand All @@ -32,22 +25,16 @@ abstract class ValueValidatorBase implements ValueValidator {
* A list of prohibited values. This means the parameters value(s) must
* not be in the list during validation. False for no restriction.
*
* @since 0.1
*
* @var array|false
*/
protected $prohibitedValues = false;

/**
* @since 0.1
*
* @var array
*/
protected $options = [];

/**
* @since 0.1
*
* @var Error[]
*/
protected $errors = [];
Expand Down Expand Up @@ -78,8 +65,6 @@ final public function validate( $value ) {
/**
* Checks the value against the allowed values and prohibited values lists in case they are set.
*
* @since 0.1
*
* @param mixed $value
*/
protected function valueIsAllowed( $value ) {
Expand All @@ -95,8 +80,6 @@ protected function valueIsAllowed( $value ) {
/**
* @see ValueValidator::validate
*
* @since 0.1
*
* @param mixed $value
*/
abstract public function doValidation( $value );
Expand Down Expand Up @@ -124,8 +107,6 @@ public function setOptions( array $param ) {
/**
* Registers an error message.
*
* @since 0.1
*
* @param string $errorMessage
*/
protected function addErrorMessage( $errorMessage ) {
Expand All @@ -135,8 +116,6 @@ protected function addErrorMessage( $errorMessage ) {
/**
* Registers an error.
*
* @since 0.1
*
* @param Error $error
*/
protected function addError( Error $error ) {
Expand All @@ -146,8 +125,6 @@ protected function addError( Error $error ) {
/**
* Registers a list of errors.
*
* @since 0.1
*
* @param Error[] $errors
*/
protected function addErrors( array $errors ) {
Expand All @@ -160,8 +137,6 @@ protected function addErrors( array $errors ) {
* the $optionMap parameter in which keys are source names and values are target
* names.
*
* @since 0.1
*
* @param mixed $value
* @param ValueValidator $validator
* @param string|null $property
Expand Down Expand Up @@ -196,8 +171,6 @@ protected function runSubValidator(
/**
* If the "values" and "excluding" arguments should be held into account.
*
* @since 0.1
*
* @return bool
*/
protected function enableWhitelistRestrictions() {
Expand All @@ -210,8 +183,6 @@ protected function enableWhitelistRestrictions() {
* TODO: think about how to access set options in general and if we want to have
* whitelist and baclklist values in the validator objects to begin with.
*
* @since 0.1
*
* @return array|bool false
*/
public function getWhitelistedValues() {
Expand Down

0 comments on commit 193075a

Please sign in to comment.