@@ -20,10 +20,13 @@ jobs:
|
|||||||
- name: PHP 语法检查
|
- name: PHP 语法检查
|
||||||
run: |
|
run: |
|
||||||
echo "📝 PHP 语法检查..."
|
echo "📝 PHP 语法检查..."
|
||||||
|
echo "PHP 版本: $(php -v | head -1)"
|
||||||
errors=0
|
errors=0
|
||||||
for file in $(find . -name "*.php" -not -path "./vendor/*"); do
|
for file in $(find . -name "*.php" -not -path "./vendor/*"); do
|
||||||
if ! php -l "$file" > /dev/null 2>&1; then
|
output=$(php -l "$file" 2>&1)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
echo "错误: $file"
|
echo "错误: $file"
|
||||||
|
echo "$output"
|
||||||
errors=$((errors + 1))
|
errors=$((errors + 1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -25,10 +25,13 @@ jobs:
|
|||||||
- name: PHP 语法检查
|
- name: PHP 语法检查
|
||||||
run: |
|
run: |
|
||||||
echo "📝 PHP 语法检查..."
|
echo "📝 PHP 语法检查..."
|
||||||
|
echo "PHP 版本: $(php -v | head -1)"
|
||||||
errors=0
|
errors=0
|
||||||
for file in $(find . -name "*.php" -not -path "./vendor/*"); do
|
for file in $(find . -name "*.php" -not -path "./vendor/*"); do
|
||||||
if ! php -l "$file" > /dev/null 2>&1; then
|
output=$(php -l "$file" 2>&1)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
echo "错误: $file"
|
echo "错误: $file"
|
||||||
|
echo "$output"
|
||||||
errors=$((errors + 1))
|
errors=$((errors + 1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user