mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 09:10:12 +00:00
Replace isset() with null check in DiscussionParser
Found usage of isset() on expression self::$diffParser 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: Iaaad420ad05b8352f8a7f162c746591749c8b3e9
This commit is contained in:
parent
ced572b369
commit
297ed70cb2
|
@ -36,7 +36,7 @@ abstract class DiscussionParser {
|
|||
protected static $revisionInterpretationCache = [];
|
||||
|
||||
/** @var DiffParser|null */
|
||||
protected static $diffParser;
|
||||
protected static $diffParser = null;
|
||||
|
||||
/**
|
||||
* Given a RevisionRecord object, generates Event objects for
|
||||
|
@ -1012,7 +1012,7 @@ abstract class DiscussionParser {
|
|||
* * 'left_pos' and 'right_pos' (in lines) of the change.
|
||||
*/
|
||||
public static function getMachineReadableDiff( $oldText, $newText ) {
|
||||
if ( !isset( self::$diffParser ) ) {
|
||||
if ( self::$diffParser === null ) {
|
||||
self::$diffParser = new DiffParser;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue