So that our CI docker image will work.
Disabling new issues (and removing now-unused suppressions) seems better
than attempting to fix all 300 of them.
Bug: T256088
Change-Id: Ide4a93043244fe254befe55e11a19dafd37a5fe8
//after dropping HHVM
// approximate error count: 110
"PhanParamTooMany", // False positives with variargs. Unsuppress after dropping HHVM
+ // New errors in phan 0.8.0, see T256088
+ 'PhanTypeArraySuspiciousNullable',
+ 'PhanEmptyForeach',
] );
// This helps a lot in discovering bad code, but unfortunately it will always fail for
"wikimedia/avro": "1.9.0",
"wikimedia/testing-access-wrapper": "~1.0",
"wmde/hamcrest-html-matchers": "^0.1.0",
- "mediawiki/mediawiki-phan-config": "0.7.1",
+ "mediawiki/mediawiki-phan-config": "0.8.0",
"symfony/yaml": "3.4.28",
"johnkary/phpunit-speedtrap": "^1.0 | ^2.0"
},
if ( isset( $ctx['forwarded_for'] ) ||
isset( $ctx['client_ip'] ) ||
isset( $ctx['from'] ) ) {
- // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
$ctx['proxy'] = $_SERVER['REMOTE_ADDR'];
}
if ( $wgLocalInterwiki ) {
// Hard deprecated in 1.34.
wfDeprecated( '$wgLocalInterwiki – use $wgLocalInterwikis instead', '1.23' );
- // @phan-suppress-next-line PhanUndeclaredVariableDim
array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
}
if ( is_string( $r['extract'] ) && $r['extract'] !== '' ) {
$item['Description'] = $r['extract'];
}
- // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
if ( is_array( $r['image'] ) && isset( $r['image']['source'] ) ) {
$item['Image'] = array_intersect_key( $r['image'], $imageKeys );
}
}
}
- // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
$fit = $result->addValue( [ 'query', $this->getModuleName() ], null, $data[$u] );
if ( !$fit ) {
if ( $useNames ) {
? count( $data['query']['redirects'] ) - 1
: -1;
if ( $lastRedirect >= 0 ) {
- // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
$newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to'] );
$img = new self( $newtitle, $repo, $info, true );
$img->redirectedFrom( $title->getDBkey() );
if ( $hasOutputStream ) {
return fwrite( $req['stream'], $data );
} else {
- // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
$req['response']['body'] .= $data;
return strlen( $data );
* - Cached or regenerated value version number or null if not versioned
* - Timestamp of the current cached value at the key or null if there is no value
* @note Callable type hints are not used to avoid class-autoloading
- * @suppress PhanTypeArraySuspicious
*/
private function fetchOrRegenerate( $key, $ttl, $callback, array $opts ) {
$checkKeys = $opts['checkKeys'] ?? [];
$opts = $this->makeUpdateOptions( $options );
$sql = "UPDATE $opts $table SET " . $this->makeList( $values, self::LIST_SET );
+ // @phan-suppress-next-line PhanTypeComparisonFromArray
if ( $conds !== [] && $conds !== '*' ) {
$sql .= " WHERE " . $this->makeList( $conds, self::LIST_AND );
}
protected function getWeightScale( $index, IDatabase $conn = null ) {
if ( !$conn ) {
+ // @phan-suppress-next-line PhanTypeMismatchArgumentReal
return parent::getWeightScale( $index, $conn );
}
* Exif::getFilteredData() or BitmapMetadataHandler )
* @return array
* @since 1.23
- * @suppress PhanTypeArraySuspiciousNullable
*/
public function makeFormattedData( $tags ) {
$resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3;
*
* @param string $rawData The app13 block from jpeg containing iptc/iim data
* @return array IPTC metadata array
- * @suppress PhanTypeArraySuspicious
*/
static function parse( $rawData ) {
$parsed = iptcparse( $rawData );
}
$orderBy = [];
+ // @phan-suppress-next-line PhanTypeMismatchDimFetch
if ( !isset( $this->mungedQuery['el_index_60'] ) ) {
$orderBy[] = 'el_index_60';
}
* @param string $profile The currently selected profile
* @param string $term The user provided search terms
* @return string HTML
- * @suppress PhanTypeArraySuspiciousNullable
*/
protected function profileTabsHtml( $profile, $term ) {
$bareterm = $this->startsWithImage( $term )
// backends in FileBackendMultiWrite (since they get writes second, they have
// higher timestamps). However, when copying the other way, this hits loads of
// false positives (possibly 100%) and wastes a bunch of time on GETs/PUTs.
- // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
$same = ( $srcStat['mtime'] <= $dstStat['mtime'] );
} else {
// This is the slowest method which does many per-file HEADs (unless an object