Skip to content

Commit 0b0f904

Browse files
committed
f: sa
1 parent f5b2a82 commit 0b0f904

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/php-sa.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ jobs:
8080
php_files=($(find "${{ inputs.working-directory }}" -mindepth 1 -maxdepth 1 \
8181
-type f -name '*.php'))
8282
83-
# TBD
83+
# Surprisingly, PHPStan does not seem to find composer.json when using a custom working directory.
84+
# Therefore, we will simply pass the Composer autoloader explicitly.
8485
composer_vendor="$(composer -d ${{ inputs.working-directory }} config vendor-dir)"
8586
autoload_file="${{ inputs.working-directory }}/${composer_vendor}/autoload.php"
8687
87-
args=(-a "${autoload_file}" "${dirs[@]}" "${php_files[@]}")
88+
args=(--level 6 -a "${autoload_file}" "${dirs[@]}" "${php_files[@]}")
8889
fi
8990
9091
log_cmd phpstan analyse "${args[@]}"

phpstan-adjust-scandirs/phpstan-adjust-scandirs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function usage(): void
7676
exit(1);
7777
}
7878

79-
foreach ((array) $config['parameters']['scanDirectories'] ?? [] as $existing) {
79+
foreach ((array) ($config['parameters']['scanDirectories'] ?? []) as $existing) {
8080
if (is_dir($existing) && is_readable($existing)) {
8181
$scanDirs[] = $existing;
8282
$diff[] = "$existing (unchanged)";

0 commit comments

Comments
 (0)