lunapress / static-analysis
Psalm, PHPCS and Rector configs for use in WP
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/lunapress/static-analysis
Requires
- php: ^8.3
- humanmade/psalm-plugin-wordpress: ^3
- lunapress/coding-standards: dev-main
- onepix/wordpress-stubs: *
- rector/rector: ^2
- symfony/console: ^7
- symfony/process: ^7
- vimeo/psalm: ^5 || ^6
Requires (Dev)
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^12
- psalm/plugin-phpunit: ^0
This package is auto-updated.
Last update: 2025-10-07 19:16:45 UTC
README
TODO
- Psalm plugin for autoregistration of installed
lunapress/*-stubs
- Rector CLI
Install
composer require --dev lunapress/static-analysis
Required
- PHP 8.3+
CLI
PHP_CodeSniffer
vendor/bin/lunapress-static-analysis phpcs [OPTIONS] -- [<PHPCS-ARGS>...]
vendor/bin/lunapress-static-analysis phpcbf [OPTIONS] -- [<PHPCS-ARGS>...]
[PHPCS-ARGS]
: Arguments from PHP_CodeSniffer
[OPTIONS]
:
--ruleset
- Path to the customruleset.xml
file relative to the project
If --ruleset
is not present, it checks the files in order of priority:
.config/.phpcs.xml
.config/phpcs.xml
.config/.phpcs.xml.dist
.config/phpcs.xml.dist
LunaPressStandard
is automatically applied
Example
vendor/bin/lunapress-static-analysis phpcs --ruleset=./phpcs/example.xml -- --colors
Overriding rules
.config/phpcs.xml
<?xml version="1.0"?> <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="LunaPress Standard Override" namespace="LunaPressStandard\Override" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> <rule ref="LunaPressStandard"> </rule> <!-- Arguments --> <arg name="extensions" value="php" /> <arg name="report" value="summary" /> <arg name="colors" /> <arg name="cache" /> <arg value="sp" /> </ruleset>
Psalm
vendor/bin/lunapress-static-analysis psalm [OPTIONS] -- [<PSALM-ARGS>...]
[PSALM-ARGS]
: Arguments from Psalm
[OPTIONS]
:
--config
- Path to the custompsalm.xml
file relative to the project
If --config
is not present, it checks the files in order of priority:
.config/psalm.xml
.config/psalm.xml.dist
- Default config from this package
config/psalm.xml
Example
vendor/bin/lunapress-static-analysis psalm --config=./phpcs/example.xml -- --help