src/classes/CCValidator.php
public function rules()
	{
		$args = func_get_args();

		$key = array_shift( $args );

		if ( !is_array( reset( $args ) ) )
		{
			$rules = $args;
		}
		else 
		{
			$rules = array_shift( $args );
		}

		$success = true;

		foreach( $rules as $rule )
		{
			$rule = explode( ':', $rule );
			$params = array();

			if ( array_key_exists( 1, $rule ) )
			{
				$params = explode( ',', $rule[1] );
			}

			$rule = reset( $rule );

			array_unshift( $params, $key );

			if ( !call_user_func_array( array( $this, $rule ), $params ) )
			{
				$success = false;
			}
		}

		return $success;
	}
public function rules()
	{
		$args = func_get_args();

		$key = array_shift( $args );

		if ( !is_array( reset( $args ) ) )
		{
			$rules = $args;
		}
		else 
		{
			$rules = array_shift( $args );
		}

		$success = true;

		foreach( $rules as $rule )
		{
			$rule = explode( ':', $rule );
			$params = array();

			if ( array_key_exists( 1, $rule ) )
			{
				$params = explode( ',', $rule[1] );
			}

			$rule = reset( $rule );

			array_unshift( $params, $key );

			if ( !call_user_func_array( array( $this, $rule ), $params ) )
			{
				$success = false;
			}
		}

		return $success;
	}
public function rules ( ) { $ args = func_get_args ( ) ; $ key = array_shift ( $ args ) ; if ( ! is_array ( reset ( $ args ) ) ) { $ rules = $ args ; } else { $ rules = array_shift ( $ args ) ; } $ success = true ; foreach ( $ rules as $ rule ) { $ rule = explode ( ':' , $ rule ) ; $ params = array ( ) ; if ( array_key_exists ( 1 , $ rule ) ) { $ params = explode ( ',' , $ rule [ 1 ] ) ; } $ rule = reset ( $ rule ) ; array_unshift ( $ params , $ key ) ; if ( ! call_user_func_array ( array ( $ this , $ rule ) , $ params ) ) { $ success = false ; } } return $ success ; }
Apply multiple rules to one attribute

@param ...string
@return bool
Apply multiple rules to one attribute