diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2024-12-19 17:33:11 +0100 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2024-12-19 18:15:53 +0000 |
commit | b9e38a957fdafbf9ab233e14605b44b4833b32dd (patch) | |
tree | 5ccf59f606f4a0d62212281be3214323868c2ecc /includes/api/ApiMain.php | |
parent | 1471c51a0076854148fde8e4dcb37ff8feefecc7 (diff) | |
download | mediawikicore-b9e38a957fdafbf9ab233e14605b44b4833b32dd.tar.gz mediawikicore-b9e38a957fdafbf9ab233e14605b44b4833b32dd.zip |
Replace isset() with falsy checks
isset() should only be used to suppress errors, not for null check.
When the property is always defined, there is no need to use isset.
Found by a new phan plugin (2efea9f989)
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset
Change-Id: I186e799256fbaf5ee77558bd146f9418dd5eaacc
Diffstat (limited to 'includes/api/ApiMain.php')
-rw-r--r-- | includes/api/ApiMain.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index d2c3ea5df6f2..8956e86ee018 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -1336,7 +1336,7 @@ class ApiMain extends ApiBase { * Create the printer for error output */ private function createErrorPrinter() { - if ( !isset( $this->mPrinter ) ) { + if ( !$this->mPrinter ) { $value = $this->getRequest()->getVal( 'format', self::API_DEFAULT_FORMAT ); if ( !$this->mModuleMgr->isDefined( $value, 'format' ) ) { $value = self::API_DEFAULT_FORMAT; |