Index: trunk/phase3/includes/StringUtils.php |
— | — | @@ -36,7 +36,11 @@ |
37 | 37 | * This implementation is slower than hungryDelimiterReplace but uses far less |
38 | 38 | * memory. The delimiters are literal strings, not regular expressions. |
39 | 39 | * |
40 | | - * @param string $flags Regular expression flags |
| 40 | + * @param $startDelim String: start delimiter |
| 41 | + * @param $endDelim String: end delimiter |
| 42 | + * @param $callback Callback: function to call on each match |
| 43 | + * @param $subject String |
| 44 | + * @param $flags String: regular expression flags |
41 | 45 | */ |
42 | 46 | # If the start delimiter ends with an initial substring of the end delimiter, |
43 | 47 | # e.g. in the case of C-style comments, the behaviour differs from the model |
— | — | @@ -116,12 +120,12 @@ |
117 | 121 | * |
118 | 122 | * preg_replace( "!$startDelim(.*)$endDelim!$flags", $replace, $subject ) |
119 | 123 | * |
120 | | - * @param string $startDelim Start delimiter regular expression |
121 | | - * @param string $endDelim End delimiter regular expression |
122 | | - * @param string $replace Replacement string. May contain $1, which will be |
123 | | - * replaced by the text between the delimiters |
124 | | - * @param string $subject String to search |
125 | | - * @return string The string with the matches replaced |
| 124 | + * @param $startDelim String: start delimiter regular expression |
| 125 | + * @param $endDelim String: end delimiter regular expression |
| 126 | + * @param $replace String: replacement string. May contain $1, which will be |
| 127 | + * replaced by the text between the delimiters |
| 128 | + * @param $subject String to search |
| 129 | + * @return String: The string with the matches replaced |
126 | 130 | */ |
127 | 131 | static function delimiterReplace( $startDelim, $endDelim, $replace, $subject, $flags = '' ) { |
128 | 132 | $replacer = new RegexlikeReplacer( $replace ); |
— | — | @@ -132,8 +136,8 @@ |
133 | 137 | /** |
134 | 138 | * More or less "markup-safe" explode() |
135 | 139 | * Ignores any instances of the separator inside <...> |
136 | | - * @param string $separator |
137 | | - * @param string $text |
| 140 | + * @param $separator String |
| 141 | + * @param $text String |
138 | 142 | * @return array |
139 | 143 | */ |
140 | 144 | static function explodeMarkup( $separator, $text ) { |
— | — | @@ -159,8 +163,8 @@ |
160 | 164 | * Escape a string to make it suitable for inclusion in a preg_replace() |
161 | 165 | * replacement parameter. |
162 | 166 | * |
163 | | - * @param string $string |
164 | | - * @return string |
| 167 | + * @param $string String |
| 168 | + * @return String |
165 | 169 | */ |
166 | 170 | static function escapeRegexReplacement( $string ) { |
167 | 171 | $string = str_replace( '\\', '\\\\', $string ); |