protected function parse_string_rules( $rules ) {
		$split_rules = explode( '|', $rules );
		$parse_rules = [];

		foreach ( $split_rules as $rule ) {
			$parameters = [];

			// Format rule and parameters follows {rule}:{parameters}.
			if ( strpos( $rule, ':' ) !== false ) {
				list( $rule, $parameter ) = explode( ':', $rule, 2 );

				$parameter = false !== strpos( $parameter, ',' )
					? str_getcsv( $parameter )
					: [ $parameter ];

				$parameters = $this->wrap_parameters( $rule, $parameter );
			}

			$parse_rules[] = [ $this->normalize( $rule ), $parameters ];
		}

		return $parse_rules;
	}
protected function parse_string_rules( $rules ) {
		$split_rules = explode( '|', $rules );
		$parse_rules = [];

		foreach ( $split_rules as $rule ) {
			$parameters = [];

			// Format rule and parameters follows {rule}:{parameters}.
			if ( strpos( $rule, ':' ) !== false ) {
				list( $rule, $parameter ) = explode( ':', $rule, 2 );

				$parameter = false !== strpos( $parameter, ',' )
					? str_getcsv( $parameter )
					: [ $parameter ];

				$parameters = $this->wrap_parameters( $rule, $parameter );
			}

			$parse_rules[] = [ $this->normalize( $rule ), $parameters ];
		}

		return $parse_rules;
	}
protected function parse_string_rules ( $ rules ) { $ split_rules = explode ( '|' , $ rules ) ; $ parse_rules = [ ] ; foreach ( $ split_rules as $ rule ) { $ parameters = [ ] ; // Format rule and parameters follows {rule}:{parameters}. if ( strpos ( $ rule , ':' ) !== false ) { list ( $ rule , $ parameter ) = explode ( ':' , $ rule , 2 ) ; $ parameter = false !== strpos ( $ parameter , ',' ) ? str_getcsv ( $ parameter ) : [ $ parameter ] ; $ parameters = $ this -> wrap_parameters ( $ rule , $ parameter ) ; } $ parse_rules [ ] = [ $ this -> normalize ( $ rule ) , $ parameters ] ; } return $ parse_rules ; }
Parse a string based rules.

@param  string $rules String rules set.
@return array
Parse a string based rules .