Upgrade to newer phan

Bug: T216933
Change-Id: If8a63da99343597b7f8c131f3656945eaf67d819
This commit is contained in:
Kunal Mehta 2019-03-16 22:39:09 -07:00
parent fce9a05cd2
commit ab601a2ca7
4 changed files with 12 additions and 10 deletions

View file

@ -1,18 +1,18 @@
<?php
$cfg = require __DIR__ . '/../../vendor/mediawiki/mediawiki-phan-config/src/config.php';
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
$cfg['directory_list'] = array_merge(
$cfg['directory_list'],
[
'./../../extensions/Scribunto',
'../../extensions/Scribunto',
]
);
$cfg['exclude_analysis_directory_list'] = array_merge(
$cfg['exclude_analysis_directory_list'],
[
'./../../extensions/Scribunto',
'../../extensions/Scribunto',
]
);

View file

@ -4,7 +4,7 @@
"jakub-onderka/php-console-highlighter": "0.3.2",
"mediawiki/mediawiki-codesniffer": "24.0.0",
"mediawiki/minus-x": "0.3.1",
"mediawiki/mediawiki-phan-config": "0.3.0"
"mediawiki/mediawiki-phan-config": "0.5.0"
},
"scripts": {
"fix": [

View file

@ -202,10 +202,12 @@ class ExprParser {
// First the unlimited length classes
// @phan-suppress-next-line PhanParamSuspiciousOrder false positive
if ( false !== strpos( EXPR_WHITE_CLASS, $char ) ) {
// Whitespace
$p += strspn( $expr, EXPR_WHITE_CLASS, $p );
continue;
// @phan-suppress-next-line PhanParamSuspiciousOrder false positive
} elseif ( false !== strpos( EXPR_NUMBER_CLASS, $char ) ) {
// Number
if ( $expecting !== 'expression' ) {

View file

@ -85,8 +85,8 @@ class ExtParserFunctions {
*/
public static function ifexprObj( $parser, $frame, $args ) {
$expr = isset( $args[0] ) ? trim( $frame->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 ) {