wp/wp-includes/class-wp-matchesmapregex.php
changeset 21 48c4eec2b7e6
parent 18 be944660c56a
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     9 /**
     9 /**
    10  * Helper class to remove the need to use eval to replace $matches[] in query strings.
    10  * Helper class to remove the need to use eval to replace $matches[] in query strings.
    11  *
    11  *
    12  * @since 2.9.0
    12  * @since 2.9.0
    13  */
    13  */
       
    14 #[AllowDynamicProperties]
    14 class WP_MatchesMapRegex {
    15 class WP_MatchesMapRegex {
    15 	/**
    16 	/**
    16 	 * store for matches
    17 	 * store for matches
    17 	 *
    18 	 *
    18 	 * @var array
    19 	 * @var array
    60 	 * @param string $subject subject
    61 	 * @param string $subject subject
    61 	 * @param array  $matches data used for substitution
    62 	 * @param array  $matches data used for substitution
    62 	 * @return string
    63 	 * @return string
    63 	 */
    64 	 */
    64 	public static function apply( $subject, $matches ) {
    65 	public static function apply( $subject, $matches ) {
    65 		$oSelf = new WP_MatchesMapRegex( $subject, $matches );
    66 		$result = new WP_MatchesMapRegex( $subject, $matches );
    66 		return $oSelf->output;
    67 		return $result->output;
    67 	}
    68 	}
    68 
    69 
    69 	/**
    70 	/**
    70 	 * do the actual mapping
    71 	 * do the actual mapping
    71 	 *
    72 	 *