Replace various array type hints with more specific string[]

There are many, many more. I touch only a few where I'm sure it's
never anything but an array of strings.

Change-Id: I8b798f2e9d48f07a241b95ce0ace8fa9d981695d
This commit is contained in:
thiemowmde 2022-09-27 09:22:15 +02:00
parent 1e60c7337a
commit d81f01e417
3 changed files with 18 additions and 19 deletions

View file

@ -41,11 +41,11 @@ class ContentSecurityPolicy {
/** @var WebResponse */
private $response;
/** @var array */
/** @var string[] */
private $extraDefaultSrc = [];
/** @var array */
/** @var string[] */
private $extraScriptSrc = [];
/** @var array */
/** @var string[] */
private $extraStyleSrc = [];
/** @var HookRunner */
@ -73,7 +73,7 @@ class ContentSecurityPolicy {
*
* @note Most callers will probably want ContentSecurityPolicy::sendHeaders() instead.
* @internal
* @param array $csp ContentSecurityPolicy configuration
* @param array|bool $csp ContentSecurityPolicy configuration
* @param int $reportOnly self::*_MODE constant
*/
public function sendCSPHeader( $csp, $reportOnly ) {
@ -361,7 +361,7 @@ class ContentSecurityPolicy {
}
/**
* @return array Additional sources for loading scripts from
* @return string[] Additional sources for loading scripts from
*/
private function getAdditionalSelfUrlsScript() {
$additionalUrls = [];

View file

@ -153,7 +153,7 @@ class OutputPage extends ContextSource {
protected $mIndicators = [];
/**
* @var array Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page')
* @var string[] Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page')
*/
private $mLanguageLinks = [];
@ -181,7 +181,7 @@ class OutputPage extends ContextSource {
protected $mAdditionalHtmlClasses = [];
/**
* @var array Array of elements in "<head>". Parser might add its own headers!
* @var string[] Array of elements in "<head>". Parser might add its own headers!
* @deprecated since 1.38; will be made private (T301020)
*/
protected $mHeadItems = [];
@ -701,7 +701,7 @@ class OutputPage extends ContextSource {
/**
* Get an array of head items
*
* @return array
* @return string[]
*/
public function getHeadItemsArray() {
return $this->mHeadItems;

View file

@ -80,8 +80,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
private $mText = null;
/**
* @var array List of the full text of language links,
* in the order they appear.
* @var string[] List of the full text of language links, in the order they appear.
*/
private $mLanguageLinks;
@ -91,7 +90,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
private $mCategories;
/**
* @var array Page status indicators, usually displayed in top-right corner.
* @var string[] Page status indicators, usually displayed in top-right corner.
*/
private $mIndicators = [];
@ -162,7 +161,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
private $mNoGallery = false;
/**
* @var array Items to put in the <head> section
* @var string[] Items to put in the <head> section
*/
private $mHeadItems = [];
@ -261,17 +260,17 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
private $mPreventClickjacking = false;
/**
* @var array Extra script-src for CSP
* @var string[] Extra script-src for CSP
*/
private $mExtraScriptSrcs = [];
/**
* @var array Extra default-src for CSP [Everything but script and style]
* @var string[] Extra default-src for CSP [Everything but script and style]
*/
private $mExtraDefaultSrcs = [];
/**
* @var array Extra style-src for CSP
* @var string[] Extra style-src for CSP
*/
private $mExtraStyleSrcs = [];
@ -714,7 +713,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
}
/**
* @return array
* @return string[]
* @since 1.25
*/
public function getIndicators() {
@ -851,7 +850,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
/**
* Get extra Content-Security-Policy 'default-src' directives
* @since 1.35
* @return array
* @return string[]
*/
public function getExtraCSPDefaultSrcs() {
return $this->mExtraDefaultSrcs;
@ -860,7 +859,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
/**
* Get extra Content-Security-Policy 'script-src' directives
* @since 1.35
* @return array
* @return string[]
*/
public function getExtraCSPScriptSrcs() {
return $this->mExtraScriptSrcs;
@ -869,7 +868,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
/**
* Get extra Content-Security-Policy 'style-src' directives
* @since 1.35
* @return array
* @return string[]
*/
public function getExtraCSPStyleSrcs() {
return $this->mExtraStyleSrcs;