-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update: phpstan 1.10.39 * Update: core 规则更新 * Update: 组件规则更新 * Update: 重构 phpstan 启动代码 * Fix * Update: .gitattributes * Update: 调整目录结构 * Fix * Update: 修复一些错误报告 * Update: 重新生成 core 基线 * Update: 应用 php-cs-fixer 修复 * Update: rector 0.18.5 * Update: 更新代码风格规范 * Update: 应用 rector 的更改到核心 * Update: 格式化代码 * Update: 修复代码分析 * Update: 修复代码风格 * Update: 应用 rector 的更改到组件 * Update: 修复代码风格 * Update: 更新工具脚本 * Update: 修复代码风格 * Update: 使工作流能在推送新提交时自动取消前一个 * Update: 选择更合适的唯一组合
- Loading branch information
Showing
404 changed files
with
2,388 additions
and
2,902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/bin/bash | ||
|
||
__DIR__=$(cd `dirname $0`; pwd) | ||
cd "$__DIR__/.." | ||
__DIR__=$(pwd) | ||
|
||
components=( | ||
# "core" 默认不处理 | ||
"access-control" | ||
"amqp" | ||
"apidoc" | ||
"fpm" | ||
"grpc" | ||
"jwt" | ||
"kafka" | ||
"mqtt" | ||
"pgsql" | ||
"queue" | ||
"rate-limit" | ||
"roadrunner" | ||
"rpc" | ||
"shared-memory" | ||
"smarty" | ||
"snowflake" | ||
"swoole" | ||
"swoole-tracker" | ||
"workerman" | ||
"workerman-gateway" | ||
"macro" | ||
) | ||
|
||
analyze_component() { | ||
component="$1" | ||
gen_baseline="$2" | ||
echo "Analyzing: $component, Generate Baseline: $gen_baseline" | ||
|
||
analyse_configuration="" | ||
|
||
args=() | ||
args+=("--memory-limit" "1G") | ||
|
||
if [ "$component" != "core" ]; then | ||
args+=("--configuration=phpstan-components.neon" "--autoload-file=src/Components/$component/vendor/autoload.php" "src/Components/$component") | ||
fi | ||
|
||
if [ "$gen_baseline" == "true" ]; then | ||
args+=("--generate-baseline=./phpstan-baseline/baseline-$component.neon" "--allow-empty-baseline") | ||
fi | ||
|
||
echo ./vendor/bin/phpstan analyse "${args[@]}" | ||
|
||
PHPSTAN_ANALYSE_COMPONENT_NAME="$component" PHPSTAN_GENERATE_BASELINE="$gen_baseline" ./vendor/bin/phpstan analyse "${args[@]}" | ||
} | ||
|
||
use_baseline="false" | ||
input_components=() | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
--baseline) | ||
use_baseline="true" | ||
shift | ||
;; | ||
-b) | ||
use_baseline="true" | ||
shift | ||
;; | ||
*) | ||
# 如果不是 --baseline 标志,将参数添加到 components 数组中 | ||
input_components+=("$1") | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
if [ ${#input_components[@]} -eq 0 ]; then | ||
# If no arguments are provided, analyze all components | ||
for component in "${components[@]}"; do | ||
analyze_component "$component" "$use_baseline" | ||
done | ||
else | ||
# Analyze the specified components provided as arguments | ||
for component in "${input_components[@]}"; do | ||
if [[ " ${components[@]} " =~ " $component " || "core" == "$component" ]]; then | ||
analyze_component "$component" "$use_baseline" | ||
else | ||
echo "Invalid component name: $component" | ||
fi | ||
done | ||
fi |
Oops, something went wrong.