Change-Id: Ib00dc8585e8ba599491e51e0b99a8667c3b4cd63
* @param array $matches
* @return mixed
*/
- public function replace( $matches ) {
+ public function replace( array $matches ) {
return str_replace( $this->from, $this->to, $matches[$this->index] );
}
}
* @param array $matches
* @return mixed
*/
- public function replace( $matches ) {
+ public function replace( array $matches ) {
return $this->table[$matches[$this->index]];
}
}
* @param array $matches
* @return string
*/
- public function replace( $matches ) {
+ public function replace( array $matches ) {
$pairs = array();
foreach ( $matches as $i => $match ) {
$pairs["\$$i"] = $match;
* Base class for "replacers", objects used in preg_replace_callback() and
* StringUtils::delimiterReplaceCallback()
*/
-class Replacer {
+abstract class Replacer {
/**
* @return array
*/
public function cb() {
return array( &$this, 'replace' );
}
+
+ /**
+ * @param array $matches
+ * @return string
+ */
+ abstract public function replace( array $matches );
}