Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / tests / parser / ParserTestRunner.php
index ce1dae6..97175da 100644 (file)
@@ -143,8 +143,7 @@ class ParserTestRunner {
 
                $this->keepUploads = !empty( $options['keep-uploads'] );
 
-               $this->fileBackendName = isset( $options['file-backend'] ) ?
-                       $options['file-backend'] : false;
+               $this->fileBackendName = $options['file-backend'] ?? false;
 
                $this->runDisabled = !empty( $options['run-disabled'] );
                $this->runParsoid = !empty( $options['run-parsoid'] );
@@ -465,7 +464,7 @@ class ParserTestRunner {
                        if ( is_int( $name ) ) {
                                $value();
                        } else {
-                               $saved[$name] = isset( $GLOBALS[$name] ) ? $GLOBALS[$name] : null;
+                               $saved[$name] = $GLOBALS[$name] ?? null;
                                $GLOBALS[$name] = $value;
                        }
                }
@@ -537,7 +536,7 @@ class ParserTestRunner {
         * @return bool
         */
        public function isSetupDone( $funcName ) {
-               return isset( $this->setupDone[$funcName] ) ? $this->setupDone[$funcName] : false;
+               return $this->setupDone[$funcName] ?? false;
        }
 
        /**
@@ -837,7 +836,7 @@ class ParserTestRunner {
                }
 
                $local = isset( $opts['local'] );
-               $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
+               $preprocessor = $opts['preprocessor'] ?? null;
                $parser = $this->getParser( $preprocessor );
                $title = Title::newFromText( $titleText );