amp-toolbox-php
amp-toolbox-php copied to clipboard
Raise PHPStan level for the `amp/common` package to 5
Feature description
The Common package (ampproject/common) is currently sitting at and enforcing level 4 of PHPStan static analysis.
There are 2 errors that need to be fixed so that we can raise the level to 5 and enforce this new quality level in Travis CI.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- PHPStan does not show any detected errors when run on level 5.
Implementation brief
- Change the level to
5in the filephpstan.neon.dist. - Run
composer analyze. - Fix detected errors until no more are found.
QA testing instructions
Demo
Changelog entry
Exception/FailedToGetFromRemoteUrl.php
| Line | Error |
|---|---|
| 66 | Parameter ampproject/amp-wp#2 $code of class AmpProject\Exception\FailedToGetFromRemoteUrl constructor expects int, null given. |
RuntimeVersion.php
| Line | Error |
|---|---|
| 102 | Parameter ampproject/amp-wp#3 $pad_string of function str_pad expects string, int given. |
Moving this to amp-toolbox-php since the code has moved there.