From: Fomafix Date: Mon, 11 Jun 2018 17:23:15 +0000 (+0200) Subject: Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient X-Git-Tag: 1.34.0-rc.0~5119^2 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=3714131b5dc26794512b0e9f59999a9eeb9bf7e2;p=lhc%2Fweb%2Fwiklou.git Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient This is a followup to 485f66f1. Change-Id: I7a2a44b7e933103178929b3cdc015859612c8b35 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 335451e7b7..d9996f426f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2299,7 +2299,7 @@ function wfShellWikiCmd( $script, array $parameters = [], array $options = [] ) // Give site config file a chance to run the script in a wrapper. // The caller may likely want to call wfBasename() on $script. Hooks::run( 'wfShellWikiCmd', [ &$script, &$parameters, &$options ] ); - $cmd = isset( $options['php'] ) ? [ $options['php'] ] : [ $wgPhpCli ]; + $cmd = [ $options['php'] ?? $wgPhpCli ]; if ( isset( $options['wrapper'] ) ) { $cmd[] = $options['wrapper']; } diff --git a/includes/changetags/ChangeTags.php b/includes/changetags/ChangeTags.php index 0c81144531..09d1b81491 100644 --- a/includes/changetags/ChangeTags.php +++ b/includes/changetags/ChangeTags.php @@ -386,7 +386,7 @@ class ChangeTags { 'ct_log_id' => $log_id, 'ct_rev_id' => $rev_id, 'ct_params' => $params, - 'ct_tag_id' => isset( $changeTagMapping[$tag] ) ? $changeTagMapping[$tag] : null, + 'ct_tag_id' => $changeTagMapping[$tag] ?? null, ] ); diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 3362f0f907..f4f04f1ff9 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -675,7 +675,7 @@ class DatabaseOracle extends Database { } $table = strtolower( $this->removeIdentifierQuotes( $this->tableName( $table ) ) ); - return ( isset( $this->sequenceData[$table] ) ) ? $this->sequenceData[$table] : false; + return $this->sequenceData[$table] ?? false; } /**