. * * @file * @ingroup Skins */ declare( strict_types=1 ); namespace MediaWiki\Skins\Citizen\Partials; /** * Title partial of Skin Citizen */ final class Title extends Partial { /** * Wrap text within parenthesis with a span tag * * @param string $data title of the page * @return string */ public function decorateTitle( $data ) { // Sometimes it can be empty if ( empty( $data ) ) { return $data; } $pattern = '/(\(.+\))/'; $replacement = '$1'; return preg_replace( $pattern, $replacement, $data ); } }