From 945a7871cd62fb5496b4b5da78e29340a89f5b98 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 21 Oct 2023 20:38:47 +0200 Subject: [PATCH] Replace empty() with isset() The property is set to true or is unset, isset is easier to understand in that case Change-Id: Ib98e387ae1a2352556f57aee93da92bdf5453633 --- includes/Scribunto.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Scribunto.php b/includes/Scribunto.php index 65aceed8..b349a66b 100644 --- a/includes/Scribunto.php +++ b/includes/Scribunto.php @@ -57,7 +57,7 @@ class Scribunto { * @return ScribuntoEngineBase */ 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->setTitle( $parser->getTitle() ); } @@ -71,7 +71,7 @@ class Scribunto { * @return bool */ 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 */ public static function resetParserEngine( Parser $parser ) { - if ( !empty( $parser->scribunto_engine ) ) { + if ( isset( $parser->scribunto_engine ) ) { $parser->scribunto_engine->destroy(); $parser->scribunto_engine = null; }