diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2019-06-03 17:52:47 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2019-06-03 17:52:47 +0200 |
commit | e3c1f72bc9068a7b41da3426b04d135ada10c959 (patch) | |
tree | ef59bec047fa6c85d640e5841fefed52e120f88a /includes/MagicWordArray.php | |
parent | 75cffa0b998b300b4d79ab3d1e7f61857d32b1aa (diff) | |
download | mediawikicore-e3c1f72bc9068a7b41da3426b04d135ada10c959.tar.gz mediawikicore-e3c1f72bc9068a7b41da3426b04d135ada10c959.zip |
Improve return types in class MagicWordArray
Change-Id: I63ff4f52d8459ab19dd774ef1dee8435f1eb5cae
Diffstat (limited to 'includes/MagicWordArray.php')
-rw-r--r-- | includes/MagicWordArray.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/includes/MagicWordArray.php b/includes/MagicWordArray.php index 73d5173d0738..831d5b99887f 100644 --- a/includes/MagicWordArray.php +++ b/includes/MagicWordArray.php @@ -30,7 +30,7 @@ use MediaWiki\MediaWikiServices; * @ingroup Parser */ class MagicWordArray { - /** @var array */ + /** @var string[] */ public $names = []; /** @var MagicWordFactory */ @@ -44,7 +44,7 @@ class MagicWordArray { private $regex; /** - * @param array $names + * @param string[] $names * @param MagicWordFactory|null $factory */ public function __construct( $names = [], MagicWordFactory $factory = null ) { @@ -65,7 +65,7 @@ class MagicWordArray { /** * Add a number of magic words by name * - * @param array $names + * @param string[] $names */ public function addArray( $names ) { $this->names = array_merge( $this->names, array_values( $names ) ); @@ -95,7 +95,7 @@ class MagicWordArray { /** * Get the base regex - * @return array + * @return string[] */ public function getBaseRegex() { if ( is_null( $this->baseRegex ) ) { @@ -129,7 +129,7 @@ class MagicWordArray { /** * Get an unanchored regex that does not match parameters - * @return array + * @return string[] */ public function getRegex() { if ( is_null( $this->regex ) ) { @@ -148,7 +148,7 @@ class MagicWordArray { /** * Get a regex for matching variables with parameters * - * @return string + * @return string[] */ public function getVariableRegex() { return str_replace( "\\$1", "(.*?)", $this->getRegex() ); @@ -157,7 +157,7 @@ class MagicWordArray { /** * Get a regex anchored to the start of the string that does not match parameters * - * @return array + * @return string[] */ public function getRegexStart() { $base = $this->getBaseRegex(); @@ -174,7 +174,7 @@ class MagicWordArray { /** * Get an anchored regex for matching variables with parameters * - * @return array + * @return string[] */ public function getVariableStartToEndRegex() { $base = $this->getBaseRegex(); @@ -190,7 +190,7 @@ class MagicWordArray { /** * @since 1.20 - * @return array + * @return string[] */ public function getNames() { return $this->names; |