public function extend($fields, $closure, $message) {

		if(false === is_array($fields)) {
			$fields = [(string) $fields];
		}

		if(false === (gettype($closure) === 'object')) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be a valid callback function, "%s" given', __METHOD__, gettype($closure)), E_USER_ERROR);
		}

		if(false === is_string($message)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($message)), E_USER_ERROR);
		}

		foreach($fields as $field) {
			$this -> addRule(null, $field, null, $closure, $message);
		}
	}
public function extend($fields, $closure, $message) {

		if(false === is_array($fields)) {
			$fields = [(string) $fields];
		}

		if(false === (gettype($closure) === 'object')) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be a valid callback function, "%s" given', __METHOD__, gettype($closure)), E_USER_ERROR);
		}

		if(false === is_string($message)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($message)), E_USER_ERROR);
		}

		foreach($fields as $field) {
			$this -> addRule(null, $field, null, $closure, $message);
		}
	}
public function extend ( $ fields , $ closure , $ message ) { if ( false === is_array ( $ fields ) ) { $ fields = [ ( string ) $ fields ] ; } if ( false === ( gettype ( $ closure ) === 'object' ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be a valid callback function, "%s" given' , __METHOD__ , gettype ( $ closure ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ message ) ) { return trigger_error ( sprintf ( 'Argument 3 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ message ) ) , E_USER_ERROR ) ; } foreach ( $ fields as $ field ) { $ this -> addRule ( null , $ field , null , $ closure , $ message ) ; } }
Add custom validation rule to one or multiple fields
@param string|array $field
@param function $closure
@param string $message
Add custom validation rule to one or multiple fields