Page MenuHomePhabricator

ApiBase::dieWithError() signature is not directly compatible with ApiUsageException::newWithMessage()
Closed, ResolvedPublicBUG REPORT

Description

phpunit test failures are happening because the dieWithSignature() defaults to null for the $httpCode argument.

The failure is because null is passed directly to newWithMessage()'s $httpCode is an (not strictly typed) int whose default is 0 and is ultimately passed to the Exception's $code argument which is typed as int.

Event Timeline

Change 809235 had a related patch set uploaded (by MarkAHershberger; author: MarkAHershberger):

[mediawiki/core@master] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809235

Change 809235 merged by jenkins-bot:

[mediawiki/core@master] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809235

Change 809546 had a related patch set uploaded (by Reedy; author: MarkAHershberger):

[mediawiki/core@REL1_38] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809546

Change 809547 had a related patch set uploaded (by Reedy; author: MarkAHershberger):

[mediawiki/core@REL1_37] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809547

Change 809548 had a related patch set uploaded (by Reedy; author: MarkAHershberger):

[mediawiki/core@REL1_35] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809548

Reedy assigned this task to MarkAHershberger.

Change 809548 merged by jenkins-bot:

[mediawiki/core@REL1_35] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809548

Change 809546 merged by jenkins-bot:

[mediawiki/core@REL1_38] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809546

Change 809547 merged by jenkins-bot:

[mediawiki/core@REL1_37] Pass int to ApiUsageException::newWithMessage()'s $httpCode param

https://gerrit.wikimedia.org/r/809547