Merge "Fix/suppress misc phan errors (#4)"

This commit is contained in:
jenkins-bot 2019-04-05 22:42:35 +00:00 committed by Gerrit Code Review
commit a44ae41d58
6 changed files with 6 additions and 12 deletions

View file

@ -115,38 +115,28 @@ $cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [
"PhanTypeComparisonFromArray", "PhanTypeComparisonFromArray",
// approximate error count: 2 // approximate error count: 2
"PhanTypeComparisonToArray", "PhanTypeComparisonToArray",
// approximate error count: 1
"PhanTypeConversionFromArray",
// approximate error count: 2 // approximate error count: 2
"PhanTypeExpectedObjectOrClassName", "PhanTypeExpectedObjectOrClassName",
// approximate error count: 7 // approximate error count: 7
"PhanTypeExpectedObjectPropAccess", "PhanTypeExpectedObjectPropAccess",
// approximate error count: 3 // approximate error count: 3
"PhanTypeInstantiateAbstract", "PhanTypeInstantiateAbstract",
// approximate error count: 1
"PhanTypeInvalidCallableArraySize",
// approximate error count: 62 // approximate error count: 62
"PhanTypeInvalidDimOffset", "PhanTypeInvalidDimOffset",
// approximate error count: 10 // approximate error count: 10
"PhanTypeInvalidExpressionArrayDestructuring", "PhanTypeInvalidExpressionArrayDestructuring",
// approximate error count: 1
"PhanTypeInvalidLeftOperand",
// approximate error count: 7 // approximate error count: 7
"PhanTypeInvalidLeftOperandOfIntegerOp", "PhanTypeInvalidLeftOperandOfIntegerOp",
// approximate error count: 2 // approximate error count: 2
"PhanTypeInvalidRightOperand", "PhanTypeInvalidRightOperand",
// approximate error count: 2 // approximate error count: 2
"PhanTypeInvalidRightOperandOfIntegerOp", "PhanTypeInvalidRightOperandOfIntegerOp",
// approximate error count: 1
"PhanTypeMagicVoidWithReturn",
// approximate error count: 152 // approximate error count: 152
"PhanTypeMismatchArgument", "PhanTypeMismatchArgument",
// approximate error count: 28 // approximate error count: 28
"PhanTypeMismatchArgumentInternal", "PhanTypeMismatchArgumentInternal",
// approximate error count: 1 // approximate error count: 1
"PhanTypeMismatchBitwiseBinaryOperands", "PhanTypeMismatchBitwiseBinaryOperands",
// approximate error count: 1
"PhanTypeMismatchDeclaredParam",
// approximate error count: 2 // approximate error count: 2
"PhanTypeMismatchDimEmpty", "PhanTypeMismatchDimEmpty",
// approximate error count: 29 // approximate error count: 29

View file

@ -1670,6 +1670,7 @@ class RevisionStore
) { ) {
if ( !$this->hasMcrSchemaFlags( SCHEMA_COMPAT_READ_NEW ) ) { if ( !$this->hasMcrSchemaFlags( SCHEMA_COMPAT_READ_NEW ) ) {
$mainSlot = $this->emulateMainSlot_1_29( $revisionRow, $queryFlags, $title ); $mainSlot = $this->emulateMainSlot_1_29( $revisionRow, $queryFlags, $title );
// @phan-suppress-next-line PhanTypeInvalidCallableArraySize false positive
$slots = new RevisionSlots( [ SlotRecord::MAIN => $mainSlot ] ); $slots = new RevisionSlots( [ SlotRecord::MAIN => $mainSlot ] );
} else { } else {
// XXX: do we need the same kind of caching here // XXX: do we need the same kind of caching here

View file

@ -217,6 +217,8 @@ class ApiContinuationManager {
// Some modules are unfinished: include those params, and copy // Some modules are unfinished: include those params, and copy
// the generator params. // the generator params.
foreach ( $continuationData as $module => $kvp ) { foreach ( $continuationData as $module => $kvp ) {
// XXX: Not sure why phan is complaining here...
// @phan-suppress-next-line PhanTypeInvalidLeftOperand
$data += $kvp; $data += $kvp;
} }
$generatorParams = []; $generatorParams = [];

View file

@ -72,7 +72,7 @@ class ChronologyProtector implements LoggerAwareInterface {
/** /**
* @param BagOStuff $store * @param BagOStuff $store
* @param array[] $client Map of (ip: <IP>, agent: <user-agent> [, clientId: <hash>] ) * @param array $client Map of (ip: <IP>, agent: <user-agent> [, clientId: <hash>] )
* @param int|null $posIndex Write counter index [optional] * @param int|null $posIndex Write counter index [optional]
* @since 1.27 * @since 1.27
*/ */

View file

@ -7,6 +7,7 @@ class MssqlBlob extends Blob {
/** /**
* @param string $data * @param string $data
* @suppress PhanTypeMagicVoidWithReturn
*/ */
public function __construct( $data ) { public function __construct( $data ) {
if ( $data instanceof MssqlBlob ) { if ( $data instanceof MssqlBlob ) {

View file

@ -2997,7 +2997,7 @@ class WikiPage implements Page, IDBAccessObject {
* @param Content|null $content Page content to be used when determining * @param Content|null $content Page content to be used when determining
* the required updates. This may be needed because $this->getContent() * the required updates. This may be needed because $this->getContent()
* may already return null when the page proper was deleted. * may already return null when the page proper was deleted.
* @param RevisionRecord|Revision|null $revision The current page revision at the time of * @param Revision|null $revision The current page revision at the time of
* deletion, used when determining the required updates. This may be needed because * deletion, used when determining the required updates. This may be needed because
* $this->getRevision() may already return null when the page proper was deleted. * $this->getRevision() may already return null when the page proper was deleted.
* @param User|null $user The user that caused the deletion * @param User|null $user The user that caused the deletion