From ab601a2ca7152f6776762fa0de8f78ff43a5d28a Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 16 Mar 2019 22:39:09 -0700 Subject: [PATCH] Upgrade to newer phan Bug: T216933 Change-Id: If8a63da99343597b7f8c131f3656945eaf67d819 --- {tests/phan => .phan}/config.php | 6 +++--- composer.json | 2 +- includes/ExprParser.php | 2 ++ includes/ExtParserFunctions.php | 12 ++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) rename {tests/phan => .phan}/config.php (56%) diff --git a/tests/phan/config.php b/.phan/config.php similarity index 56% rename from tests/phan/config.php rename to .phan/config.php index 83214eee..b122a73e 100644 --- a/tests/phan/config.php +++ b/.phan/config.php @@ -1,18 +1,18 @@ expand( $args[0] ) ) : ''; - $then = isset( $args[1] ) ? $args[1] : ''; - $else = isset( $args[2] ) ? $args[2] : ''; + $then = $args[1] ?? ''; + $else = $args[2] ?? ''; $result = self::ifexpr( $parser, $expr, $then, $else ); if ( is_object( $result ) ) { $result = trim( $frame->expand( $result ) ); @@ -156,8 +156,8 @@ class ExtParserFunctions { */ public static function iferrorObj( $parser, $frame, $args ) { $test = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; - $then = isset( $args[1] ) ? $args[1] : false; - $else = isset( $args[2] ) ? $args[2] : false; + $then = $args[1] ?? false; + $else = $args[2] ?? false; $result = self::iferror( $parser, $test, $then, $else ); if ( $result === false ) { return ''; @@ -379,8 +379,8 @@ class ExtParserFunctions { */ public static function ifexistObj( $parser, $frame, $args ) { $title = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; - $then = isset( $args[1] ) ? $args[1] : null; - $else = isset( $args[2] ) ? $args[2] : null; + $then = $args[1] ?? null; + $else = $args[2] ?? null; $result = self::ifexistCommon( $parser, $frame, $title, $then, $else ); if ( $result === null ) {