mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-27 09:10:05 +00:00
Replace isset() with null check in HtmlTags
Found usage of isset() on expression self::$allowedHtmlTags that appears to be always set. isset() should only be used to suppress errors. Check whether the expression is null instead. See https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset Change-Id: I21483aab05292cfb802ff6a5e63013ecc02f5c13
This commit is contained in:
parent
2c9b5f0356
commit
91848725e7
|
@ -22,16 +22,16 @@ namespace MediaWiki\Linter;
|
|||
|
||||
class HtmlTags {
|
||||
/**
|
||||
* @var array
|
||||
* @var array|null
|
||||
*/
|
||||
private static $allowedHtmlTags;
|
||||
private static $allowedHtmlTags = null;
|
||||
|
||||
/**
|
||||
* @param SpecialLintErrors|LintErrorsPager $parent
|
||||
*/
|
||||
public function __construct( $parent ) {
|
||||
// reuse the allowed html tags array once constructed
|
||||
if ( !isset( self::$allowedHtmlTags ) ) {
|
||||
if ( self::$allowedHtmlTags === null ) {
|
||||
$tagOptionAll = $parent->msg( 'linter-form-tag-option-all' )->escaped();
|
||||
self::$allowedHtmlTags = $this->createAllowedHTMLTags();
|
||||
|
||||
|
|
Loading…
Reference in a new issue