private function parse_diacritics_replacement_string( $custom_replacements ) {
		return self::array_map_assoc(
			function( $key, $replacement ) {
				// Account for single and double quotes in keys in and values, discard everything else.
				if ( \preg_match( '/(?<kquo>"|\')(?<key>(?:(?!\k<kquo>).)+)\k<kquo>\s*=>\s*(?<rquo>"|\')(?<replacement>(?:(?!\k<rquo>).)+)\k<rquo>/', $replacement, $match ) ) {
					$key         = $match['key'];
					$replacement = $match['replacement'];

					return [ $key => $replacement ];
				}

				return [];
			},
			/** RE correct. @scrutinizer ignore-type */
			\preg_split( '/,/', $custom_replacements, -1, PREG_SPLIT_NO_EMPTY )
		);
	}
private function parse_diacritics_replacement_string( $custom_replacements ) {
		return self::array_map_assoc(
			function( $key, $replacement ) {
				// Account for single and double quotes in keys in and values, discard everything else.
				if ( \preg_match( '/(?<kquo>"|\')(?<key>(?:(?!\k<kquo>).)+)\k<kquo>\s*=>\s*(?<rquo>"|\')(?<replacement>(?:(?!\k<rquo>).)+)\k<rquo>/', $replacement, $match ) ) {
					$key         = $match['key'];
					$replacement = $match['replacement'];

					return [ $key => $replacement ];
				}

				return [];
			},
			/** RE correct. @scrutinizer ignore-type */
			\preg_split( '/,/', $custom_replacements, -1, PREG_SPLIT_NO_EMPTY )
		);
	}
private function parse_diacritics_replacement_string ( $ custom_replacements ) { return self :: array_map_assoc ( function ( $ key , $ replacement ) { // Account for single and double quotes in keys in and values, discard everything else. if ( \ preg_match ( '/(?<kquo>"|\')(?<key>(?:(?!\k<kquo>).)+)\k<kquo>\s*=>\s*(?<rquo>"|\')(?<replacement>(?:(?!\k<rquo>).)+)\k<rquo>/' , $ replacement , $ match ) ) { $ key = $ match [ 'key' ] ; $ replacement = $ match [ 'replacement' ] ; return [ $ key => $ replacement ] ; } return [ ] ; } , /** RE correct. @scrutinizer ignore-type */ \ preg_split ( '/,/' , $ custom_replacements , - 1 , PREG_SPLIT_NO_EMPTY ) ) ; }
Parses a custom diacritics replacement string into an array.

@param string $custom_replacements A string formatted `"needle"=>"replacement","needle"=>"replacement",...

@return array
Parses a custom diacritics replacement string into an array .