Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
authorFomafix <fomafix@googlemail.com>
Mon, 11 Jun 2018 17:23:15 +0000 (19:23 +0200)
committerFomafix <fomafix@googlemail.com>
Mon, 11 Jun 2018 17:23:15 +0000 (19:23 +0200)
This is a followup to 485f66f1.

Change-Id: I7a2a44b7e933103178929b3cdc015859612c8b35

includes/GlobalFunctions.php
includes/changetags/ChangeTags.php
includes/db/DatabaseOracle.php

index 335451e..d9996f4 100644 (file)
@@ -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'];
        }
index 0c81144..09d1b81 100644 (file)
@@ -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,
                                        ]
                                );
 
index 3362f0f..f4f04f1 100644 (file)
@@ -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;
        }
 
        /**