];
$cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [
- // approximate error count: 18
+ // approximate error count: 22
"PhanAccessMethodInternal",
- // approximate error count: 17
- "PhanCommentParamOnEmptyParamList",
- // approximate error count: 29
+ // approximate error count: 22
"PhanCommentParamWithoutRealParam",
- // approximate error count: 21
+ // approximate error count: 19
"PhanParamReqAfterOpt",
- // approximate error count: 26
+ // approximate error count: 20
"PhanParamSignatureMismatch",
- // approximate error count: 127
+ // approximate error count: 110
"PhanParamTooMany",
- // approximate error count: 30
+ // approximate error count: 63
"PhanTypeArraySuspicious",
- // approximate error count: 27
+ // approximate error count: 28
"PhanTypeArraySuspiciousNullable",
- // approximate error count: 26
+ // approximate error count: 22
"PhanTypeComparisonFromArray",
- // approximate error count: 63
+ // approximate error count: 88
"PhanTypeInvalidDimOffset",
- // approximate error count: 154
+ // approximate error count: 60
"PhanTypeMismatchArgument",
- // approximate error count: 27
+ // approximate error count: 20
"PhanTypeMismatchArgumentInternal",
- // approximate error count: 27
- "PhanTypeMismatchDimFetch",
- // approximate error count: 10
- "PhanTypeMismatchForeach",
- // approximate error count: 77
+ // approximate error count: 40
"PhanTypeMismatchProperty",
- // approximate error count: 84
- "PhanTypeMismatchReturn",
- // approximate error count: 12
- "PhanTypeObjectUnsetDeclaredProperty",
- // approximate error count: 22
+ // approximate error count: 36
"PhanUndeclaredConstant",
- // approximate error count: 237
+ // approximate error count: 219
"PhanUndeclaredMethod",
- // approximate error count: 846
+ // approximate error count: 752
"PhanUndeclaredProperty",
- // approximate error count: 55
+ // approximate error count: 53
"PhanUndeclaredVariableDim",
] );
* @return string|null
*/
protected function importContentFormData( &$request ) {
- return; // Don't do anything, EditPage already extracted wpTextbox1
+ return null; // Don't do anything, EditPage already extracted wpTextbox1
}
/**
* @param int|int[] $namespaces,... The namespaces to check for
* @return bool
* @since 1.19
+ * @suppress PhanCommentParamOnEmptyParamList Cannot make variadic due to HHVM bug, T191668#5263929
*/
public function inNamespaces( /* ... */ ) {
$namespaces = func_get_args();
$this->partitionCache = [];
$this->fullResultCache = [];
$this->wanCache->touchCheckKey( $this->makeCheckKey() );
- unset( $this->db );
+ $this->db = null;
}
/**
* @return IDatabase
*/
protected function getDB() {
- if ( !isset( $this->db ) ) {
+ if ( $this->db === null ) {
$this->db = wfGetDB( DB_REPLICA );
}
* @return string
*/
public function getName() {
- if ( !isset( $this->name ) ) {
+ if ( $this->name === null ) {
$this->assertRepoDefined();
$this->name = $this->repo->getNameFromTitle( $this->title );
}
* @return string
*/
function getHashPath() {
- if ( !isset( $this->hashPath ) ) {
+ if ( $this->hashPath === null ) {
$this->assertRepoDefined();
$this->hashPath = $this->repo->getHashPath( $this->getName() );
}
// Now switch the object
$this->title = $target;
// Force regeneration of the name and hashpath
- unset( $this->name );
- unset( $this->hashPath );
+ $this->name = null;
+ $this->hashPath = null;
}
return $status;
/** @var bool|string */
protected $mime;
- /** @var array Dimension data */
+ /** @var array[]|bool[] Dimension data */
protected $dims;
/** @var bool|string Handler-specific metadata which will be saved in the img_metadata field */
/**
* @param int $page
- * @return bool
+ * @return array|bool
*/
private function cachePageDimensions( $page = 1 ) {
$page = (int)$page;
// addItem() doesn't work if mItems is partially filled from mDiffs
$this->mFrozen = true;
$info = unserialize( gzinflate( $this->mCompressed ) );
- unset( $this->mCompressed );
+ $this->mCompressed = null;
if ( !$info ) {
// Empty object
* @see https://www.mediawiki.org/wiki/Localisation
*
* @since 1.17
+ * @phan-file-suppress PhanCommentParamOnEmptyParamList Cannot make variadic due to HHVM bug,
+ * T191668#5263929
*/
class Message implements MessageSpecifier, Serializable {
/** Use message text as-is */
);
}
+ /**
+ * @param int $offset
+ * @param int[] $struct
+ * @return array
+ */
private function unpackOffset( $offset, $struct ) {
$block = $this->readOffset( $offset, array_sum( $struct ) );
return $this->unpack( $block, 0, $struct );
}
+ /**
+ * @param string $block
+ * @param int $offset
+ * @param int[] $struct
+ * @return array
+ */
private function unpack( $block, $offset, $struct ) {
$data = [];
foreach ( $struct as $key => $length ) {
* @param array $valuedata
* @param string $valuename
*
- * @return string
+ * @return array|string
* @deprecated Since 1.33
*/
public function aggregateValue( $valuedata, $valuename = 'value' );
$data = [ $data ];
}
if ( !$data ) {
- return;
+ return 0;
}
foreach ( $data as $item ) {
if ( !( $item instanceof StatsdDataInterface ) ) {
try {
$fp = $this->getSender()->open();
if ( !$fp ) {
- return;
+ return 0;
}
foreach ( $data as $message ) {
$written += $this->getSender()->write( $fp, $message );
* @param array $params
* @return WANObjectCache
* @throws UnexpectedValueException
+ * @suppress PhanTypeMismatchReturn
*/
public static function newWANCacheFromParams( array $params ) {
global $wgCommandLineMode, $wgSecretKey;
}
public function getQueryInfo() {
- return false;
+ return [];
}
/**
// commentEnd Past-the-end input pointer for the last comment encountered
// visualEnd Past-the-end input pointer for the end of the accumulator minus comments
+ /**
+ * @param string $out
+ */
public function __construct( $out = '' ) {
$this->out = $out;
}
// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPDPart_Hash extends PPDPart {
+ /**
+ * @param string $out
+ */
public function __construct( $out = '' ) {
if ( $out !== '' ) {
$accum = [ $out ];
} else {
$accum[++$lastIndex] = '|';
}
+ // @phan-suppress-next-line PhanTypeMismatchForeach
foreach ( $part->out as $node ) {
if ( is_string( $node ) && is_string( $accum[$lastIndex] ) ) {
$accum[$lastIndex] .= $node;
*/
public function __destruct() {
if ( isset( $this->mLinkHolders ) ) {
+ // @phan-suppress-next-line PhanTypeObjectUnsetDeclaredProperty
unset( $this->mLinkHolders );
}
// @phan-suppress-next-line PhanTypeSuspiciousNonTraversableForeach
// @codeCoverageIgnoreStart
// T109544 - If a feed formatter returns null, this will otherwise cause an
// error in at least RedisPubSubFeedEngine. Not sure best to handle this.
+ // @phan-suppress-next-line PhanTypeMismatchReturn
return;
// @codeCoverageIgnoreEnd
}
if ( $this->modules === self::INHERIT_VALUE ) {
return $this->context->getModules();
}
+ // @phan-suppress-next-line PhanTypeMismatchReturn
return $this->modules;
}
if ( $module ) {
$dataPath = $this->getThemeImagesPath( $theme, $module );
if ( !$dataPath ) {
- return false;
+ return [];
}
} else {
// Backwards-compatibility for things that probably shouldn't have used this class...
*
* There is light processing to simplify core maintenance.
* @param array $definition
- * @phan-param array<int,array{class:string}> $definition
+ * @phan-param array<int,array{class:string,filters:array}> $definition
*/
protected function registerFiltersFromDefinitions( array $definition ) {
$autoFillPriority = -1;
/**
* @param string|null $subPage
+ * @suppress PhanTypeObjectUnsetDeclaredProperty
*/
public function execute( $subPage ) {
if ( $this->mPosted ) {
}
function getQueryInfo() {
- return '';
+ return [];
}
}
*
* @param string $permissions,... Permissions to test
* @return bool True if user is allowed to perform *any* of the given actions
+ * @suppress PhanCommentParamOnEmptyParamList Cannot make variadic due to HHVM bug, T191668#5263929
*/
public function isAllowedAny() {
return MediaWikiServices::getInstance()
* ->getPermissionManager()->userHasAllRights(...) instead
* @param string $permissions,... Permissions to test
* @return bool True if the user is allowed to perform *all* of the given actions
+ * @suppress PhanCommentParamOnEmptyParamList Cannot make variadic due to HHVM bug, T191668#5263929
*/
public function isAllowedAll() {
return MediaWikiServices::getInstance()
$errors[] = $result;
}
if ( $errors ) {
+ // @phan-suppress-next-line PhanTypeMismatchReturn
return [ "Expected any one of these to be true", $errors ];
}
return "No schemas provided to union";
}
# Sometimes a language will be localised but not actually exist on this wiki.
+ // @phan-suppress-next-line PhanTypeMismatchForeach
foreach ( $this->namespaceNames as $key => $text ) {
if ( !isset( $validNamespaces[$key] ) ) {
unset( $this->namespaceNames[$key] );
*/
private function reloadTables() {
if ( $this->mTables ) {
+ // @phan-suppress-next-line PhanTypeObjectUnsetDeclaredProperty
unset( $this->mTables );
}
* This function resets $this->lb and closes all connections on it.
*
* @throws MWException
+ * @suppress PhanTypeObjectUnsetDeclaredProperty
*/
function rotateDb() {
// Cleaning up old connections
require_once RUN_MAINTENANCE_IF_MAIN;
$queue = [];
+'@phan-var string[][] $mmfl';
foreach ( $mmfl['setupFiles'] as $fileName ) {
if ( strval( $fileName ) === '' ) {
continue;