Fix misc phan errors by adjusting documentation (#8)

PhanTypeInvalidRightOperand was triggering on
ApiQueryBase::showHiddenUsersAddBlockInfo() on the line
`$actorQuery['tables'] + $commentQuery['tables']` (and the next one).
For whatever reason, phan was unable to automatically understand that
the right side was an array (though it was able to understand
$actorQuery, which has nearly identical code...), so I added more
specific hinting to CommentStore::getJoin() using phan's union types,
which resolved the issue.

And incorrect documentation on LogEntry::getDeleted() was triggering
PhanTypeMismatchBitwiseBinaryOperands since you can't do bitwise
operations on a string and an integer.

Change-Id: I13b791e4b754ffbc340b55cfb752e2d9226f1949
This commit is contained in:
Kunal Mehta 2019-04-05 23:31:16 -07:00
parent 8c98f51778
commit 5f8d76336d
3 changed files with 2 additions and 5 deletions

View file

@ -110,15 +110,11 @@ $cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [
// approximate error count: 7
"PhanTypeInvalidLeftOperandOfIntegerOp",
// approximate error count: 2
"PhanTypeInvalidRightOperand",
// approximate error count: 2
"PhanTypeInvalidRightOperandOfIntegerOp",
// approximate error count: 154
"PhanTypeMismatchArgument",
// approximate error count: 27
"PhanTypeMismatchArgumentInternal",
// approximate error count: 1
"PhanTypeMismatchBitwiseBinaryOperands",
// approximate error count: 2
"PhanTypeMismatchDimEmpty",
// approximate error count: 27

View file

@ -202,6 +202,7 @@ class CommentStore {
* - fields: (string[]) to include in the `$vars` to `IDatabase->select()`
* - joins: (array) to include in the `$join_conds` to `IDatabase->select()`
* All tables, fields, and joins are aliased, so `+` is safe to use.
* @phan-return array{tables:string[],fields:string[],joins:array}
*/
public function getJoin( $key = null ) {
$key = $this->getKey( $key );

View file

@ -100,7 +100,7 @@ interface LogEntry {
/**
* Get the access restriction.
*
* @return string
* @return int
*/
public function getDeleted();