File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 "wp-cli/wp-cli" : " ^2.5"
2929 },
3030 "require-dev" : {
31- "wp-cli/wp-cli-tests" : " ^4.3.2" ,
32- "phpcompatibility/php-compatibility" : " dev-develop"
31+ "wp-cli/wp-cli-tests" : " ^5.0" ,
32+ "phpcompatibility/php-compatibility" : " ^10.0@alpha" ,
33+ "wp-coding-standards/wpcs" : " @dev"
3334 },
3435 "scripts" : {
3536 "behat" : " run-behat-tests" ,
3637 "behat-rerun" : " rerun-behat-tests" ,
3738 "lint" : " run-linter-tests" ,
3839 "phpcs" : " run-phpcs-tests" ,
3940 "phpcbf" : " run-phpcbf-cleanup" ,
41+ "phpstan" : " run-phpstan-tests" ,
4042 "phpunit" : " run-php-unit-tests" ,
4143 "prepare-tests" : " install-package-tests" ,
4244 "test" : [
4850 },
4951 "config" : {
5052 "allow-plugins" : {
51- "dealerdirect/phpcodesniffer-composer-installer" : true
53+ "dealerdirect/phpcodesniffer-composer-installer" : true ,
54+ "phpstan/extension-installer" : true
5255 }
5356 }
5457}
Original file line number Diff line number Diff line change 1+ parameters:
2+ level: 0
3+ paths:
4+ - src
5+ - command.php
6+ scanDirectories:
7+ - vendor/wp-cli/wp-cli/php
8+ scanFiles:
9+ - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
10+ - phpstan/stubs.php
11+ treatPhpDocTypesAsCertain: false
12+ dynamicConstantNames:
13+ - WP_DEBUG
14+ - WP_DEBUG_LOG
15+ - WP_DEBUG_DISPLAY
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Stubs for the WordPress SQLite integration plugin classes.
4+ *
5+ * These classes are loaded at runtime by WordPress, not via Composer.
6+ * The stubs allow PHPStan to analyze code that references them.
7+ */
8+
9+ // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound
10+ // phpcs:disable Generic.Files.OneObjectStructurePerFile.MultipleFound
11+ // phpcs:disable PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations
12+ // phpcs:disable PHPCompatibility.FunctionDeclarations.NewParamTypeDeclarations
13+
14+ class WP_SQLite_Connection {
15+ /**
16+ * @param array{path: string} $config
17+ */
18+ public function __construct ( array $ config ) {}
19+ public function quote_identifier ( string $ identifier ): string {}
20+ public function get_pdo (): PDO {}
21+ }
22+
23+ class WP_SQLite_Driver {
24+ public function __construct ( WP_SQLite_Connection $ connection , string $ db_name ) {}
25+ public function query ( string $ sql ) {}
26+ public function get_connection (): WP_SQLite_Connection {}
27+ }
28+
29+ class WP_SQLite_Translator {
30+ public function __construct () {}
31+ public function query ( string $ sql ) {}
32+ public function get_pdo (): PDO {}
33+ }
You can’t perform that action at this time.
0 commit comments