mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-23 15:56:55 +00:00
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:
parent
1eea8281c9
commit
945a7871cd
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue