src/classes/CCValidator.php
protected function apply_rule( $rule, $callback, $params, $reverse )
	{
		$data_key = array_shift( $params );

		// In case of that the requested data set does not exist
		// we always set the test as failure.
		if ( !array_key_exists( $data_key, $this->data ) )
		{
			return $this->proof_result( $rule, $data_key, ( $reverse ? true : false ) );
		}

		$call_arguments = array( $data_key, $this->data[$data_key] );

		// add the other params to our call parameters
		$call_arguments = array_merge( $call_arguments, $params );

		$result = (bool) call_user_func_array( $callback, $call_arguments );

		if ( $reverse )
		{
			$result = !$result;
		}

		return $this->proof_result( $rule, $data_key, $result );
	}
protected function apply_rule( $rule, $callback, $params, $reverse )
	{
		$data_key = array_shift( $params );

		// In case of that the requested data set does not exist
		// we always set the test as failure.
		if ( !array_key_exists( $data_key, $this->data ) )
		{
			return $this->proof_result( $rule, $data_key, ( $reverse ? true : false ) );
		}

		$call_arguments = array( $data_key, $this->data[$data_key] );

		// add the other params to our call parameters
		$call_arguments = array_merge( $call_arguments, $params );

		$result = (bool) call_user_func_array( $callback, $call_arguments );

		if ( $reverse )
		{
			$result = !$result;
		}

		return $this->proof_result( $rule, $data_key, $result );
	}
protected function apply_rule ( $ rule , $ callback , $ params , $ reverse ) { $ data_key = array_shift ( $ params ) ; // In case of that the requested data set does not exist // we always set the test as failure. if ( ! array_key_exists ( $ data_key , $ this -> data ) ) { return $ this -> proof_result ( $ rule , $ data_key , ( $ reverse ? true : false ) ) ; } $ call_arguments = array ( $ data_key , $ this -> data [ $ data_key ] ) ; // add the other params to our call parameters $ call_arguments = array_merge ( $ call_arguments , $ params ) ; $ result = ( bool ) call_user_func_array ( $ callback , $ call_arguments ) ; if ( $ reverse ) { $ result = ! $ result ; } return $ this -> proof_result ( $ rule , $ data_key , $ result ) ; }
Apply an rule executes the rule and runs the result proof

@param string 		$rule
@param callback		$callback
@param array 			$params
@return bool
Apply an rule executes the rule and runs the result proof