承接 lunapress/static-analysis 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lunapress/static-analysis

Composer 安装命令:

composer require --dev lunapress/static-analysis

包简介

Psalm, PHPCS and Rector configs for use in WP

README 文档

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 custom ruleset.xml file relative to the project

If --ruleset is not present, it checks the files in order of priority:

  1. .config/.phpcs.xml
  2. .config/phpcs.xml
  3. .config/.phpcs.xml.dist
  4. .config/phpcs.xml.dist
  5. 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 custom psalm.xml file relative to the project

If --config is not present, it checks the files in order of priority:

  1. .config/psalm.xml
  2. .config/psalm.xml.dist
  3. Default config from this package config/psalm.xml

Example

vendor/bin/lunapress-static-analysis psalm --config=./phpcs/example.xml -- --help

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-10-07