Add a single validator with message to the validator container

@param $index
@param null $method
@param array $params
@param null $message
@return $this
431821
public function addValidator($index, $method = null, array $params = [], $message = null)
    {
        // set up params
        array_unshift($params, $method);
        array_unshift($params, $index);

        call_user_func_array([$this->getValidator(), 'addRule'], $params);

        // Message management
        if (!is_null($message)) {
            $this->getValidator()->addMessage($index, $message);
        }

        return $this;
    }
995786
public function addRule($rule, $method = null, $params = [], $message = null)
    {

        // construction des paramètres
        array_unshift($params, $rule, $method);

        call_user_func_array([$this->getValidator(), 'addRule'], $params);

        if (!is_null($message)) {
            if(is_array($message)){
                foreach($message as $rule => $message){
                    $this->getValidator()->addMessage($rule, $message);
                }
            }else{
                $this->getValidator()->addMessage($rule, $message);
            }
        }

        return $this;
    }
498702
public function addFilter($index, $method = null, ...$params)
    {
        $this->filters[$index] = [$method, $params];
        return $this;
    }
285925
public function authenticate($params, $method, $headers)
    {
        $email = \Phramework\Validate\EmailValidator::parseStatic($params['email']);
        $password = $params['password'];

        $user = call_user_func(Manager::getUserGetByEmailMethod(), $email);

        if (!$user) {
            return false;
        }

        if (!password_verify($password, $user['password'])) {
            return false;
        }

        /*
         * Create the token as an array
        */
        $data = [
            'id' => $user['id']
        ];

        //copy user attributes to jwt's data
        foreach (Manager::getAttributes() as $attribute) {
            if (!isset($user[$attribute])) {
                throw new \Phramework\Exceptions\ServerException(sprintf(
                    'Attribute "%s" is not set in user object',
                    $attribute
                ));
            }
            $data[$attribute] = $user[$attribute];
        }

        //Convert to object
        $data = (object)$data;

        //Call onAuthenticate callback if set
        if (($callback = Manager::getOnAuthenticateCallback()) !== null) {
            call_user_func(
                $callback,
                $data
            );
        }

        return [$data];
    }
1079072
public function removeValidator(int $index)
    {
        $validators = $this->validators;
        unset($validators[$index]);
        $this->validators = array_values($validators);
        return $this;
    }
481650
public function check( $method = NULL ){
		$method			= $this->method;
		if( $method && $this->validateMethod( $method ) )
			$method		= $method;
		$currentStatus	= $this->status;
		switch( $method ){
			case self::METHOD_SOCKET:
				$this->checkUsingSocket();
				break;
			case self::METHOD_PING:
				$this->checkUsingSystemPing();
				break;
		}
		if( $this->status !== $currentStatus ){
			if( $this->callbackOnChange ){
				call_user_func_array( $this->callbackOnChange, array( $this->status ) );
			}
		}
	}
792313
protected void validateRequired(int index, String errorKey, String errorMessage) {
		String value = controller.getPara(index);
		if (value == null /* || "".equals(value) */) {
			addError(errorKey, errorMessage);
		}
	}
595388
public function notification(string $method, array $parameters)
    {
        if ($this->isSingleRequest) {
            $this->units = [];
        }

        $this->units[] = new Notification($method, $parameters);

        if ($this->isSingleRequest) {
            $this->execute(new InvokeSpec($this->units, true));
            return null;
        }

        return $this;
    }
895857
protected function validate( $method, $params )
	{
		$reverse = false;

		// when the method starts with not we assume that we 
		// have to reverse the validation means only accepting the opposite
		if ( substr( $method, 0, 4 ) === 'not_' )
		{
			$reverse = true; $method = substr( $method, 4 );
		}

		if ( array_key_exists( $method, static::$rules ) )
		{
			return $this->apply_rule( $method, static::$rules[$method], $params, $reverse );
		}

		if ( method_exists( $this, 'rule_'.$method ) )
		{
			return $this->apply_rule( $method, array( $this, 'rule_'.$method ), $params, $reverse );
		}

		throw new \BadMethodCallException( "CCValidator - Invalid rule or method '".$method."'." );
	}
1362912
function( name, method, message ) {
		$.validator.methods[name] = method;
		$.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
		if ( method.length < 3 ) {
			$.validator.addClassRules(name, $.validator.normalizeRule(name));
		}
	}
970151
public function call($method, Array $params = [])
    {
        $rawResult = parent::call($method, $params);

        switch ($method) {
            case 'GetCarBrandAndModel':
                $result = $rawResult->GetCarBrandAndModelReturn->MakeModelBean;
            break;

            case 'GetCarBrand':
                $result = $rawResult->GetCarBrandReturn->x_car_brand->string;
        }

        return $result;
    }
432984
protected function addError(string $name, array $parameters, string $message = '')
    {
        if (array_key_exists('message', $parameters) &&
            Assert::stringNotEmpty($parameters['message'])
        ) {
            $message = trim($parameters['message']);
        }

        $this->validator->addError(sprintf($message, $name));
    }
1001346
public <T> T[] validIndex(final T[] array, final int index, final String message) {
        notNull(array);
        if (index < 0 || index >= array.length) {
            failIndexOutOfBounds(message);
        }
        return array;
    }
456676
protected function makeRequest($endpoint = null, $method, $params)
    {
        $endpoint = $endpoint ?: $this->getEndpoint();

        // Prepend relationship, if one exists.
        if (static::getParentID()) {
            $params = array_merge([
                static::getParentID()
            ], $params);
        }

        $results = call_user_func_array([static::$client->$endpoint(), $method], $params);

        // Set errors from server...if any
        $this->messageBag = static::$client->errors();

        return $results;
    }
142946
public RepeatedFieldBuilder<MType, BType, IType> setMessage(
      int index, MType message) {
    if (message == null) {
      throw new NullPointerException();
    }
    ensureMutableMessageList();
    messages.set(index, message);
    if (builders != null) {
      SingleFieldBuilder<MType, BType, IType> entry =
          builders.set(index, null);
      if (entry != null) {
        entry.dispose();
      }
    }
    onChanged();
    incrementModCounts();
    return this;
  }
145511
private function validateAndCall(&$mapping, $method, ...$params)
    {
        $mapping = $this->makeMapping($mapping);

        if (! method_exists($mapping, $method))
        {
            throw new \BadMethodCallException("EntityMapping [" . get_class($mapping) .
                "] does not implement '$method'."
            );
        }

        return call_user_func_array([$mapping, $method], $params);
    }
961210
public function mergeParams($method, Array $params = [])
    {
        $newParams = [];
        $preparedParams = $this->defaultParams;
        $preparedParams['bean'] = $params;

        $newParams[$method] = $preparedParams;

        return $newParams;
    }