Replace empty() with isset()

The property is set to true or is unset,
isset is easier to understand in that case

Change-Id: Ib98e387ae1a2352556f57aee93da92bdf5453633
This commit is contained in:
Umherirrender 2023-10-21 20:38:47 +02:00
parent 1eea8281c9
commit 945a7871cd

View file

@ -57,7 +57,7 @@ class Scribunto {
* @return ScribuntoEngineBase * @return ScribuntoEngineBase
*/ */
public static function getParserEngine( Parser $parser ) { public static function getParserEngine( Parser $parser ) {
if ( empty( $parser->scribunto_engine ) ) { if ( !isset( $parser->scribunto_engine ) ) {
$parser->scribunto_engine = self::newDefaultEngine( [ 'parser' => $parser ] ); $parser->scribunto_engine = self::newDefaultEngine( [ 'parser' => $parser ] );
$parser->scribunto_engine->setTitle( $parser->getTitle() ); $parser->scribunto_engine->setTitle( $parser->getTitle() );
} }
@ -71,7 +71,7 @@ class Scribunto {
* @return bool * @return bool
*/ */
public static function isParserEnginePresent( Parser $parser ) { public static function isParserEnginePresent( Parser $parser ) {
return !empty( $parser->scribunto_engine ); return isset( $parser->scribunto_engine );
} }
/** /**
@ -79,7 +79,7 @@ class Scribunto {
* @param Parser $parser * @param Parser $parser
*/ */
public static function resetParserEngine( Parser $parser ) { public static function resetParserEngine( Parser $parser ) {
if ( !empty( $parser->scribunto_engine ) ) { if ( isset( $parser->scribunto_engine ) ) {
$parser->scribunto_engine->destroy(); $parser->scribunto_engine->destroy();
$parser->scribunto_engine = null; $parser->scribunto_engine = null;
} }