src/classes/CCValidator.php
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."'." );
	}
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."'." );
	}
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 . "'." ) ; }
Run an validation call

@param string 		$rule
@param array 			$params
@return bool
Run an validation call