build: 移植 PHPCS + PHPStan L6 品質 gate(PR-I 前半)
- phpcs.xml(自 A 移植):ruleset 改名、*/tools/* 例外換成 */back-compat/*、 中文註解全域排除 Squiz.Commenting.InlineComment.InvalidEndChar、 interface 別名檔排除 OneObjectStructurePerFile - 檔頭正規化:16 個檔案的 declare(strict_types=1) 與前導 // 註解移到 file docblock 之後,並移除 <?php 後多餘空行(phpcbf 另自動修 190 處) - phpstan.neon + .phpstan/stubs.php(TMDO_ 與 WPDO_ 兩套常數)+ 重新產生的 phpstan-baseline.neon(710 errors,A 的 3877 行 baseline 因前綴與路徑不同無法沿用) 現況:PHPCS 0 errors / 0 warnings、PHPStan L6 No errors、 unit 451 / integration 398 GREEN Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPStan bootstrap stubs — plugin constants defined at runtime.
|
||||
*
|
||||
* PHPStan cannot see define()'d constants, so it reports "undefined constant"
|
||||
* for every one of them. Stubbing them here keeps level 6 signal-to-noise high.
|
||||
*
|
||||
* TMDO_IS_SQLITE / TMDO_IS_MYSQL (and their WPDO_ aliases) are intentionally
|
||||
* NOT stubbed to avoid literal-narrowing "always true/false" false positives
|
||||
* on runtime-dynamic values.
|
||||
*
|
||||
* @package TMDO
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
define( 'TMDO_VERSION', '0.0.0' );
|
||||
define( 'TMDO_DB_VERSION', '0.0.0' );
|
||||
define( 'TMDO_PATH', '/' );
|
||||
define( 'TMDO_URL', 'https://example.test/wp-content/plugins/2meet-data-optimizer/' );
|
||||
define( 'TMDO_FILE', '/2meet-data-optimizer.php' );
|
||||
define( 'TMDO_TABLE_PREFIX', 'wpdo_' );
|
||||
define( 'TMDO_CACHE_GROUP', 'wpdo' );
|
||||
define( 'TMDO_MIN_PHP', '8.1' );
|
||||
define( 'TMDO_MIN_WP', '6.0' );
|
||||
|
||||
// Back-compat aliases exposed by class-tmdo-back-compat.php.
|
||||
define( 'WPDO_VERSION', '0.0.0' );
|
||||
define( 'WPDO_DB_VERSION', '0.0.0' );
|
||||
define( 'WPDO_PLUGIN_DIR', '/' );
|
||||
define( 'WPDO_PLUGIN_URL', 'https://example.test/wp-content/plugins/2meet-data-optimizer/' );
|
||||
define( 'WPDO_PLUGIN_FILE', '/2meet-data-optimizer.php' );
|
||||
define( 'WPDO_TABLE_PREFIX', 'wpdo_' );
|
||||
define( 'WPDO_CACHE_GROUP', 'wpdo' );
|
||||
Reference in New Issue
Block a user