Validate all method

@return bool|\WP_Error
179224
public static function validate() {
		$instance = static::get_instance();
		$error = new \WP_Error();
		foreach ( get_class_methods( $instance ) as $method ) {
			$repl = new \ReflectionMethod( get_called_class(), $method );
			// Check if method is public.
			if ( ! $repl->isPublic() ) {
				continue;
			}
			// Check if method start with 'test_'.
			if ( 0 !== strpos( $method, 'test_' ) ) {
				continue;
			}
			$result = call_user_func( [ $instance, $method ] );
			if ( is_wp_error( $result ) ) {
				$error->add( $result->get_error_code(), $result->get_error_message() );
			}
		}
		return $error->get_error_messages()? $error : true;
	}
432637
public function validate() {
        global $DB;
        $params = array_keys($this->params);
        $method = ($this->method == BADGE_CRITERIA_AGGREGATION_ALL);
        $singleparam = (count($params) == 1);

        foreach ($params as $param) {
            // Perform check if there only one parameter with any type of aggregation,
            // Or there are more than one parameter with aggregation ALL.
            if (($singleparam || $method) && !$DB->record_exists('cohort', array('id' => $param))) {
                return array(false, get_string('error:invalidparamcohort', 'badges'));
            }
        }

        return array(true, '');
    }
227876
function validate() {

		// Is this an ODT?
		if ( ! $this->isOdt( $this->outputPath ) ) {

			$this->logError( \Pressbooks\Utility\get_contents( $this->logfile ) );

			return false;
		}

		return true;
	}
1234143
public function errors(): ValidationErrors
    {
        $errors = new ValidationErrors();
        foreach ($this as $key => $element) {
            if ($element instanceof HasValueValidationInterface) {
                $e = $element->errors();
                if (!$e->empty()) {
                    $errors[$key] = $e;
                }
            }
        }
        return $errors;
    }
369459
public function validate()
    {
        foreach ($this->inputValidations as $name => $data) {
            $validator = $data['callback'];
            $result = $validator($this);
            if ($result === false) {
                $this->logDebug("Validation FAILED: $name");
                $onError = $data['soundOnError'];
                if (is_array($onError)) {
                    foreach ($onError as $msg) {
                        $this->addPrePromptMessage($msg);
                    }
                } elseif (is_string($onError)) {
                    $this->addPrePromptMessage($onError);
                } else {
                    $this->logDebug("Ignoring validation sound: " . print_r($onError, true));
                }
                return false;
            }
            $this->logDebug("Validation OK: $name");
        }
        return true;
    }
80910
public function validate()
    {
        $result = parent::validate();

        //whitelist allowed URL schemes
        $allowed_schemes = array('http', 'https');
        if ($matches = parse_url($this->IFrameURL)) {
            if (isset($matches['scheme']) && !in_array($matches['scheme'], $allowed_schemes)) {
                $result->addError(_t(__CLASS__ . '.VALIDATION_BANNEDURLSCHEME', "This URL scheme is not allowed."));
            }
        }

        return $result;
    }
732623
public function get_wp_error() {
		return $this->wp_error ? $this->wp_error : new \WP_Error( $this->code, $this->message, $this );
	}
1084701
public function error()
    {
        $errors = $this->validator->errors();

        $this->error = empty($errors) ?: array_pop($errors)[0];

        return $this->error;
    }
932048
public function validate()
    {
        $errors = [];

        foreach ($this->fields as $field) {
            $result = $field->validate();

            if ($result->isFailure()) {
                $errors[] = $result;
            }
        }

        if ($errors) {
            $this->setErrors($errors);

            return false;
        }

        return true;
    }
1208394
protected function validate_by_callbacks( array $data, array $callbacks ) {
		foreach ( $callbacks as $key => $callback ) {
			$validity = new WP_Error;

			$value = array_key_exists( $key, $data ) ? $data[ $key ] : null;
			$callback( $validity, $value );

			if ( is_wp_error( $validity ) && count( $validity->errors ) > 0 ) {
				$this->add_error( $key, $validity->get_error_messages() );
			}
		}
	}
550788
public function validate() {
        $status = new ValidationResult();

        // Check if the form is loaded
        if (!$this->form instanceof \bootbuilder\Form) {
            $status->setError(true);
            return $status;
        }

        // Validate form controls (and panes)
        foreach ($this->form->getRawControls() as $nr => $control) {
            if(!$this->validateControl($control, $status)) {
                $status->setError(true);
                $control->setErrorState(true);
            }
            
            $this->form->replaceControl($nr, $control);
        }
        
        return $status;
    }
222468
public function isValid() : bool
    {
        if (false === $this->validated) {
            $this->validate();
        }
        return (count($this->validation_errors) === 0);
    }
667785
public function validate()
    {
        $steps = [
            'PrivateKey',
            'IdpMetadata',
            'SpMetadata'
        ];

        foreach ($steps as $step) {
            $method = 'validate' . $step;
            if (!$this->$method()) {
                return false;
            }
        }

        return true;
    }
1107324
public function validate() {
		$this->buildUrl();

		$json = (new Request($this->url))->run();

		// If we got errors, add them to the errors property.
		if (isset($json->{"error-codes"})) {
			$this->errors = $json->{"error-codes"};
		}

		return (bool) $json->success;
	}
298434
public function validate() {
        if (!$this->_rules) {
            return true;
        }

        if (!$this->_file) {
            throw new IoException('No file present for validation');
        }

        foreach ($this->_rules as $rule) {
            $method = $rule['method'];

            if (!method_exists($this, $method)) {
                throw new BadMethodCallException(sprintf('Validation method %s does not exist', $method));
            }

            if (!call_user_func_array(array($this, $method), $rule['params'])) {
                throw new ValidationException($rule['message']);
            }
        }

        return true;
    }
357073
private static function validate_method( $method ) {

		if ( $method && isset( $method[0] ) && isset( $method[1] ) ) {
			if ( method_exists( $method[0], $method[1] ) ) {
				return true;
			}
		}

		return false;
	}
1293044
public function validate()
    {
        $validator = Validator::make($this->toArray(), $this->rules,
            $this->messages);
        if ($validator->fails()) {
            $this->errors = $validator->messages();

            return false;
        } else return true;
    }