-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
good-first-issueGood for newcomersGood for newcomershelp-wantedExtra attention is neededExtra attention is neededscope:testingRelated to testingRelated to testing
Description
Would be nice if we could use PHPStan here too.
We can start with level 1 and work our way up. Most basic phpstan.neon.dist file:
parameters:
level: 1
paths:
- src
- package-command.php
scanDirectories:
- vendor/wp-cli/wp-cli/php
scanFiles:
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
treatPhpDocTypesAsCertain: falseThis yields:
------ ---------------------------------------------------------------------------------------------------
Line src/Package_Command.php
------ ---------------------------------------------------------------------------------------------------
744 Class Composer\Repository\ComposerRepository constructor invoked with 3 parameters, 4-5 required.
779 Variable $default_fields might not be defined.
1002 Constant WP_CLI_VERSION not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
1077 Access to deprecated static property $stabilities of class Composer\Package\BasePackage.
------ ---------------------------------------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------------
Line src/WP_CLI/JsonManipulator.php
------ ------------------------------------------------------------------------------------------------------------
131 Fetching deprecated class constant PLATFORM_PACKAGE_REGEX of class Composer\Repository\PlatformRepository:
use PlatformRepository::isPlatformPackage(string $name) instead
251 Anonymous function has an unused use $name.
387 Variable $childrenClean might not be defined.
407 Variable $childrenClean might not be defined.
------ ------------------------------------------------------------------------------------------------------------
Copilot
Metadata
Metadata
Assignees
Labels
good-first-issueGood for newcomersGood for newcomershelp-wantedExtra attention is neededExtra attention is neededscope:testingRelated to testingRelated to testing