https://gerrit.wikimedia.org/r/#/c/mediawiki/tools/phan/+/589603/ changed mediawiki-phan-config to use a new ConfigBuilder class. This new class is used in place of direct array manipulation (details on gerrit). The new config is not compatible with the previous one, so we need to migrate it. I think it's trivial to add a couple regexps to LibUp for common fixes (detailed below), that should work for 99% of the config files (manual review will do the rest).
(Note, the following are just high-level ideas)
Find: return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
Replace: $cfg = require ...;\n return $cfg->make();
Find: $varname['directory_list'] = array_merge( $varname['directory_list'], [ /* only extension PATHS here */ ] );
Replace: $varname->addExtensionDependencies( /*List of extension NAMES extracted from the match above */ );
Find: $varname['exclude_analysis_directory_list'] = array_merge( $varname['exclude_analysis_directory_list'], [ /* only extension PATHS here */ ] );
Replace: ''
Find: $varname['file_list'][] = 'Something';
Replace: $varname->addFiles( 'Something' );
Find: $varname['suppress_issue_types'][] = 'Something';
Replace: $varname->suppressIssueTypes( 'Something' );
Find: $varname['null_casts_as_any_type'] = true;
Replace: $varname->allowNullCastsAsAnyType( true )
Find: $varname['scalar_implicit_cast'] = true;
Replace: $varname->allowScalarImplicitCasts( true )
Find: return $varname;/*end of file*/
Replace: return $varname->make();
The checks above should work fine most of the times, with a few exceptions. Manual review is always necessary, and is not limited to fixing those exceptions. We should also simplify code like
$varname->addFiles( 'File1' ); $varname->addFiles( 'File2' ); $varname->addFiles( 'File3' );
to
$varname->addFiles( 'File1', 'File2', 'File3' );