Skip to content

Commit fd098f9

Browse files
committed
- Added vendor/autoload.php to PHPStan bootstrap configuration to ensure
all driver classes (Doctrine DBAL, MongoDB, Predis) are autoloadable during static analysis. - Prevents false "invalid return type" warnings in AdapterInterface::getDriver() even when drivers are installed via require-dev. - No functional code changes; development tooling update only.
1 parent 2fcd316 commit fd098f9

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ jobs:
4343
- name: 📦 Install Dependencies
4444
run: composer install --prefer-dist --no-interaction --no-progress --no-suggest
4545

46+
- name: Run PHPStan
47+
id: phpstan
48+
run: |
49+
(
50+
set +e
51+
composer analyse > phpstan_output.txt
52+
ANALYSE_EXIT=$?
53+
echo "phpstan_exit=$ANALYSE_EXIT" >> $GITHUB_OUTPUT
54+
55+
ERRORS=$(grep -Eo "Found ([0-9]+) errors" phpstan_output.txt | grep -Eo "[0-9]+")
56+
if [ -z "$ERRORS" ]; then ERRORS=0; fi
57+
58+
echo "phpstan_errors=$ERRORS" >> $GITHUB_OUTPUT
59+
)
60+
echo "PHPStan step completed without failing CI."
61+
4662
- name: 🧹 Code Style (PHP-CS-Fixer)
4763
run: |
4864
if [ -f vendor/bin/php-cs-fixer ]; then
@@ -109,9 +125,19 @@ jobs:
109125
ACTOR="$GITHUB_ACTOR"
110126
URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
111127
128+
PHPSTAN_ERRORS="${{ steps.phpstan.outputs.phpstan_errors }}"
129+
130+
if [ "$PHPSTAN_ERRORS" -eq 0 ]; then
131+
PHPSTAN_SUMMARY="🧹 <b>PHPStan:</b> Passed (0 errors)"
132+
else
133+
PHPSTAN_SUMMARY="🧹 <b>PHPStan:</b> ${PHPSTAN_ERRORS} errors detected"
134+
fi
135+
112136
MESSAGE="📢 <b>${HEADER}</b>
113137
114138
${COLOR} ${STATUS}
139+
140+
${PHPSTAN_SUMMARY}
115141

116142
📦 <b>Project:</b> ${PROJECT}
117143
🧱 <b>Branch:</b> ${BRANCH}

0 commit comments

Comments
 (0)