Suppress php 7.4 phan false positive

see T298571

This failure only shows up for php 7.4 since that is using
dbal 3.x.x while php 7.2 is using dbal 2.x.x

Phan analysis is being disabled for those files for php 7.2
since those are now failing with 'unused suppression' and
php 7.2 support is going to be dropped in the near future,
so that doesn't matter to much.

Bug: T316518
Change-Id: I74da37dc4329a7dd2c015a9d1fc7037a866f40c9
This commit is contained in:
Zabe 2022-09-06 19:58:55 +02:00
parent d2a8287ed4
commit daa9bfab3b
5 changed files with 29 additions and 0 deletions

View file

@ -104,6 +104,18 @@ $cfg['exclude_analysis_directory_list'] = [
'includes/PHPVersionCheck.php',
];
if ( version_compare( PHP_VERSION, '7.4.0', '<' ) ) {
$cfg['exclude_analysis_directory_list'] = array_merge(
$cfg['exclude_analysis_directory_list'],
[
'includes/libs/rdbms/dbal/MWMySQLPlatform.php',
'includes/libs/rdbms/dbal/MWMySQLPlatformCompat.php',
'includes/libs/rdbms/dbal/MWPostgreSqlPlatform.php',
'includes/libs/rdbms/dbal/MWPostgreSqlPlatformCompat.php',
]
);
}
// Do not use aliases in core.
// Use the correct name, because we don't need backward compatibility
$cfg['enable_class_alias_support'] = false;

View file

@ -2,6 +2,10 @@
namespace Wikimedia\Rdbms;
/**
* @phan-file-suppress PhanCommentAbstractOnInheritedMethod T298571
*/
/**
* @suppress PhanRedefinedExtendedClass
*/

View file

@ -1,5 +1,10 @@
<?php
// phpcs:ignoreFile -- This is a very temporary file
/**
* @phan-file-suppress PhanCommentAbstractOnInheritedMethod T298571
*/
namespace Wikimedia\Rdbms;
// T270740 - HACK: In doctrine/dbal 3.0.0, they renamed MySql -> MySQL

View file

@ -1,5 +1,9 @@
<?php
/**
* @phan-file-suppress PhanCommentAbstractOnInheritedMethod T298571
*/
namespace Wikimedia\Rdbms;
use Wikimedia\Timestamp\ConvertibleTimestamp;

View file

@ -1,5 +1,9 @@
<?php
/**
* @phan-file-suppress PhanCommentAbstractOnInheritedMethod T298571
*/
namespace Wikimedia\Rdbms;
// T270740 - HACK