//after dropping HHVM
// approximate error count: 110
"PhanParamTooMany", // False positives with variargs. Unsuppress after dropping HHVM
-
- // approximate error count: 45
- "PhanTypeMismatchArgument",
] );
// This helps a lot in discovering bad code, but unfortunately it will always fail for
$out->showErrorPage(
'modeleditnotsupported-title',
'modeleditnotsupported-text',
- $modelName
+ [ $modelName ]
);
return false;
}
* @param ServiceOptions|null $options
* @param ILoadBalancer|null $loadBalancer
* @param NamespaceInfo|null $nsInfo
- * @param WatchedItemStore|null $watchedItems
+ * @param WatchedItemStoreInterface|null $watchedItems
* @param PermissionManager|null $permMgr
*/
public function __construct(
'integeroutofrange',
[ 'min' => $min, 'max' => $max, 'botMax' => $botMax ?: $max ]
);
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->warnOrDie( $msg, $enforceLimits );
$value = $min;
}
'integeroutofrange',
[ 'min' => $min, 'max' => $max, 'botMax' => $botMax ?: $max ]
);
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->warnOrDie( $msg, $enforceLimits );
$value = $botMax;
}
'integeroutofrange',
[ 'min' => $min, 'max' => $max, 'botMax' => $botMax ?: $max ]
);
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->warnOrDie( $msg, $enforceLimits );
$value = $max;
}
*/
public function dieWithException( $exception, array $options = [] ) {
$this->dieWithError(
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->getErrorFormatter()->getMessageFromException( $exception, $options )
);
}
if ( $m ) {
$m = new ApiHelpParamValueMessage(
$value,
+ // @phan-suppress-next-line PhanTypeMismatchArgument
[ $m->getKey(), 'api-help-param-no-description' ],
$m->getParams(),
isset( $deprecatedValues[$value] )
*/
public function formatException( $exception, array $options = [] ) {
return $this->formatMessage(
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->getMessageFromException( $exception, $options ),
$options['format'] ?? null
);
// T71222: MariaDB's optimizer, at least 10.1.37 and .38, likes to choose a wildly bad plan for
// some reason for this code path. Tell it not to use the wrong index it wants to pick.
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->addOption( 'IGNORE INDEX', [ 'logging' => [ 'times' ] ] );
}
$valid = RecentChange::newFromId( $id );
if ( $valid && $this->getPermissionManager()->isBlockedFrom( $user, $valid->getTitle() ) ) {
$idResult['status'] = 'error';
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$idResult += $this->getErrorFormatter()->formatMessage( ApiMessage::create(
'apierror-blocked',
'blocked',
$this->getPermissionManager()->isBlockedFrom( $user, $valid->getPageAsLinkTarget() )
) {
$idResult['status'] = 'error';
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$idResult += $this->getErrorFormatter()->formatMessage( ApiMessage::create(
'apierror-blocked',
'blocked',
}
ApiResult::setIndexedTagName( $details, 'detail' );
$msg->setApiData( $msg->getApiData() + [ 'details' => $details ] );
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->dieWithError( $msg );
break;
// TODO: Improve on simply tracking the first trackable block (T225654)
foreach ( $block->getOriginalBlocks() as $originalBlock ) {
if ( $this->shouldTrackBlockWithCookie( $originalBlock, $isAnon ) ) {
+ '@phan-var DatabaseBlock $originalBlock';
$this->setBlockCookie( $originalBlock, $response );
return;
}
}
} else {
if ( $this->shouldTrackBlockWithCookie( $block, $isAnon ) ) {
+ '@phan-var DatabaseBlock $block';
$this->setBlockCookie( $block, $response );
}
}
function pageCount() {
if ( !isset( $this->pageCount ) ) {
// @FIXME: callers expect File objects
+ // @phan-suppress-next-line PhanTypeMismatchArgument
if ( $this->getHandler() && $this->handler->isMultiPage( $this ) ) {
+ // @phan-suppress-next-line PhanTypeMismatchArgument
$this->pageCount = $this->handler->pageCount( $this );
} else {
$this->pageCount = false;
* - originalRequest Information about the original request (as a WebRequest object or
* an associative array with 'ip' and 'userAgent').
* @codingStandardsIgnoreStart
- * @phan-param array{timeout?:int,connectTimeout?:int,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,logger?:\Psr\Logger\LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string}} $options
+ * @phan-param array{timeout?:int,connectTimeout?:int,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,method?:string,logger?:\Psr\Log\LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string}} $options
* @codingStandardsIgnoreEnd
* @param string $caller The method making this request, for profiling
* @throws RuntimeException
Wikimedia\restoreWarnings();
return Status::newFatal( 'pear-mail-error', $mail_object->getMessage() );
}
+ '@phan-var Mail_smtp $mail_object';
wfDebug( "Sending mail via PEAR::Mail\n" );
use NamespaceInfo;
use RepoGroup;
use Title;
-use WatchedItemStore;
use WatchedItemStoreInterface;
use Wikimedia\Rdbms\ILoadBalancer;
/** @var NamespaceInfo */
private $nsInfo;
- /** @var WatchedItemStore */
+ /** @var WatchedItemStoreInterface */
private $watchedItems;
/** @var PermissionManager */
} else {
$accum = [];
}
+ // @phan-suppress-next-line PhanTypeMismatchArgument
parent::__construct( $accum );
}
}
$pathTags = $siteElement->getElementsByTagName( 'path' );
for ( $i = 0; $i < $pathTags->length; $i++ ) {
$pathElement = $pathTags->item( $i );
+ '@phan-var DOMElement $pathElement';
$pathType = $this->getAttributeValue( $pathElement, 'type' );
$path = $pathElement->textContent;
$idTags = $siteElement->getElementsByTagName( 'localid' );
for ( $i = 0; $i < $idTags->length; $i++ ) {
$idElement = $idTags->item( $i );
+ '@phan-var DOMElement $idElement';
$idType = $this->getAttributeValue( $idElement, 'type' );
$id = $idElement->textContent;
*/
public function getTrail() {
return WrappedString::join( "\n", [
+ // @phan-suppress-next-line PhanTypeMismatchArgument
MWDebug::getDebugHTML( $this->getSkin()->getContext() ),
$this->get( 'bottomscripts' ),
$this->get( 'reporttime' )
$this->output( "Done. Updated headers for $count file(s).\n" );
}
+ /**
+ * @param LocalRepo $repo
+ * @param array $backendOperations
+ */
protected function updateFileHeaders( $repo, $backendOperations ) {
$status = $repo->getBackend()->doQuickOperations( $backendOperations );