/**
* @param array $names
*/
- function __construct( $names = [] ) {
+ public function __construct( $names = [] ) {
$this->names = $names;
}
* Get a 2-d hashtable for this array
* @return array
*/
- function getHash() {
+ public function getHash() {
if ( is_null( $this->hash ) ) {
global $wgContLang;
$this->hash = [ 0 => [], 1 => [] ];
* Get the base regex
* @return array
*/
- function getBaseRegex() {
+ public function getBaseRegex() {
if ( is_null( $this->baseRegex ) ) {
$this->baseRegex = [ 0 => '', 1 => '' ];
foreach ( $this->names as $name ) {
* Get an unanchored regex that does not match parameters
* @return array
*/
- function getRegex() {
+ public function getRegex() {
if ( is_null( $this->regex ) ) {
$base = $this->getBaseRegex();
$this->regex = [ '', '' ];
*
* @return string
*/
- function getVariableRegex() {
+ public function getVariableRegex() {
return str_replace( "\\$1", "(.*?)", $this->getRegex() );
}
*
* @return array
*/
- function getRegexStart() {
+ public function getRegexStart() {
$base = $this->getBaseRegex();
$newRegex = [ '', '' ];
if ( $base[0] !== '' ) {
*
* @return array
*/
- function getVariableStartToEndRegex() {
+ public function getVariableStartToEndRegex() {
$base = $this->getBaseRegex();
$newRegex = [ '', '' ];
if ( $base[0] !== '' ) {
* @throws MWException
* @return array
*/
- function parseMatch( $m ) {
+ public function parseMatch( $m ) {
reset( $m );
while ( list( $key, $value ) = each( $m ) ) {
if ( $key === 0 || $value === '' ) {