figuren-theater / phpstan
为puppeteers figuren.theater的WordPress多站网络使用的全局phpstan.neon文件
1.2.2
2024-02-15 17:24 UTC
Requires
- php-stubs/wordpress-globals: 0.2.0
- szepeviktor/phpstan-wordpress: 1.3.2
Requires (Dev)
- ergebnis/composer-normalize: 2.42.0
README

figuren.theater | phpstan.neon
为puppeteers figuren.theater的WordPress多站网络使用的全局phpstan.neon文件 - figuren.theater.
阅读我们的博客
查看网络的实际应用 • 加入网络 • 创建您自己的网络
关于
配置由phpstan/extension-installer自动加载,并且可以通过项目根目录中的自定义phpstan.neon
文件在每个项目中覆盖。
背景与动机
这是figuren.theater code-quality包的一部分,为整个平台(以及(尚未)所有其仓库)提供了phpstan的默认配置。它还帮助减少了在每个仓库中都需要一个单独的phpstan.neon
文件的需求。
安装
通过命令行安装
composer require --dev figuren-theater/phpstan
使用方法
vendor/bin/phpstan analyze .
在项目根目录内创建一个phpstan.neon
文件,内容如下
#$ vendor/bin/phpstan analyze includes: # Already included # @see https://github.com/phpstan/phpstan-src/blob/master/conf/bleedingEdge.neon - phar://phpstan.phar/conf/bleedingEdge.neon # Include this extension, if not already autoloaded via composer # - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: level: max inferPrivatePropertyTypeFromConstructor: true bootstrapFiles: # Missing constants, function and class stubs # - %currentWorkingDirectory%/tests/phpstan/bootstrap.php # - %currentWorkingDirectory%/tests/static-analysis-stubs/wordpress-defines.stub # - %currentWorkingDirectory%/vendor/php-stubs/wordpress-stubs/wordpress-stubs.php # scanFiles: # Plugin stubs # - %currentWorkingDirectory%/tests/phpstan/PLUGIN-stubs.php # Procedural code # - %currentWorkingDirectory%/myplugin-functions.php # autoload_directories: # - %currentWorkingDirectory%/inc/ paths: - %currentWorkingDirectory%/plugin.php - %currentWorkingDirectory%/inc/ # - %currentWorkingDirectory%/templates/ excludePaths: - %currentWorkingDirectory%/vendor/ ignoreErrors: # Uses func_get_args() # - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' # Fixed in WordPress 5.3 #- '#^Function do_action(_ref_array)? invoked with [3456] parameters, 1-2 required\.$#' #- '#^Function current_user_can invoked with 2 parameters, 1 required\.$#' #- '#^Function add_query_arg invoked with [123] parameters?, 0 required\.$#' #- '#^Function wp_sprintf invoked with [23456] parameters, 1 required\.$#' #- '#^Function add_post_type_support invoked with [345] parameters, 2 required\.$#' #- '#^Function ((get|add)_theme_support|current_theme_supports) invoked with [2345] parameters, 1 required\.$#' # Fixed in WordPress 5.2 - https://core.trac.wordpress.org/ticket/43304 #- '/^Parameter #2 \$deprecated of function load_plugin_textdomain expects string, false given\.$/' # WP-CLI accepts a class name as callable # - '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/' # Please consider commenting ignores: issue URL or reason for ignoring # dynamicConstantNames: # - SCRIPT_DEBUG
构建与使用
- dependabot
- phpstan/extension-installer
- code-quality 一组状态检查,确保figuren.theater平台代码质量高且一致。
贡献
贡献使开源社区成为一个如此美妙的学习、灵感和创造的地方。您所做的任何贡献都将被高度赞赏。
如果您有使这更好的建议,请Fork存储库并创建一个pull请求。您也可以简单地创建一个带有“enhancement”标签的问题。别忘了给项目加星!再次感谢!
- Fork项目
- 创建您的功能分支(
git checkout -b feature/AmazingFeature
) - 提交您的更改(
git commit -m 'Add some AmazingFeature'
) - 推送到分支(
git push origin feature/AmazingFeature
) - 打开Pull Request
版本控制
我们使用语义化版本控制进行版本控制。有关可用的版本,请参阅此存储库的标签。
作者
- Carsten Bach - 提供想法和代码 - figuren.theater/crew
还可以查看参与此项目的贡献者列表。
许可证
本项目采用GPL-3.0-or-later许可证,有关详细信息,请参阅LICENSE文件。
致谢
- altis by humanmade,作为我们的数字角色模型和灵感来源
- 感谢@roborourke提供的清晰易懂的 编码规范
- 感谢python-project-template提供的良好的模板到仓库重命名工作流程