X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMagicWordArray.php;h=7461191fca0007d689217a1a76b606acb4008db0;hb=b663b8eb00c80b47cf4847277b00c2f90ae4f2c4;hp=ee5de6b59f05214fe9be211da9a42381e43886b8;hpb=6a204d4604e3815ce6eeddd96779e8124b3b1ede;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MagicWordArray.php b/includes/MagicWordArray.php index ee5de6b59f..7461191fca 100644 --- a/includes/MagicWordArray.php +++ b/includes/MagicWordArray.php @@ -42,7 +42,7 @@ class MagicWordArray { /** * @param array $names */ - function __construct( $names = [] ) { + public function __construct( $names = [] ) { $this->names = $names; } @@ -70,7 +70,7 @@ class MagicWordArray { * 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 => [] ]; @@ -92,7 +92,7 @@ class MagicWordArray { * 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 ) { @@ -117,7 +117,7 @@ class MagicWordArray { * 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 = [ '', '' ]; @@ -136,7 +136,7 @@ class MagicWordArray { * * @return string */ - function getVariableRegex() { + public function getVariableRegex() { return str_replace( "\\$1", "(.*?)", $this->getRegex() ); } @@ -145,7 +145,7 @@ class MagicWordArray { * * @return array */ - function getRegexStart() { + public function getRegexStart() { $base = $this->getBaseRegex(); $newRegex = [ '', '' ]; if ( $base[0] !== '' ) { @@ -162,7 +162,7 @@ class MagicWordArray { * * @return array */ - function getVariableStartToEndRegex() { + public function getVariableStartToEndRegex() { $base = $this->getBaseRegex(); $newRegex = [ '', '' ]; if ( $base[0] !== '' ) { @@ -192,7 +192,7 @@ class MagicWordArray { * @throws MWException * @return array */ - function parseMatch( $m ) { + public function parseMatch( $m ) { reset( $m ); while ( list( $key, $value ) = each( $m ) ) { if ( $key === 0 || $value === '' ) { @@ -260,7 +260,7 @@ class MagicWordArray { * Returns an associative array, ID => param value, for all items that match * Removes the matched items from the input string (passed by reference) * - * @param string $text + * @param string &$text * * @return array */ @@ -304,7 +304,7 @@ class MagicWordArray { * Return false if no match found and $text is not modified. * Does not match parameters. * - * @param string $text + * @param string &$text * * @return int|bool False on failure */