Skip to content

PHP: Materialze PHPSTAN_SCANDIRS even if phpstan.neon is missing#22

Merged
lippserd merged 1 commit intomainfrom
phpstan-no-phpstan.neon
Feb 26, 2026
Merged

PHP: Materialze PHPSTAN_SCANDIRS even if phpstan.neon is missing#22
lippserd merged 1 commit intomainfrom
phpstan-no-phpstan.neon

Conversation

@lippserd
Copy link
Member

Previously, the phpstan-adjust-scandirs action and php-sa workflow required a phpstan.neon to be present for scan directories to be materialized and used.

  • phpstan-adjust-scandirs: Sets PHPSTAN_CONFIG_GENERATED=1 when no phpstan.neon is found, signaling that level and scan paths must be supplied via CLI.
  • php-sa: Removes the hashFiles(phpstan.neon) guard from the "Adjust scanDirectories" step so it runs whenever PHPSTAN_SCANDIRS is set. Separates config detection from argument building; supplies --level, scan directories, and autoload via CLI when config is absent or generated. Filters discovered directories to only those containing PHP files.
  • phpstan-adjust-scandirs.php: Treats a missing config file as an empty config instead of an error, allowing the script to generate a fresh phpstan.neon from the provided scan directories alone.

Previously, the `phpstan-adjust-scandirs` action and `php-sa` workflow required
a `phpstan.neon` to be present for scan directories to be materialized and used.

- `phpstan-adjust-scandirs`: Sets `PHPSTAN_CONFIG_GENERATED=1` when no
  `phpstan.neon` is found, signaling that level and scan paths must be supplied
  via CLI.
- `php-sa`: Removes the `hashFiles(phpstan.neon)` guard from the "Adjust
  scanDirectories" step so it runs whenever `PHPSTAN_SCANDIRS` is set.
  Separates config detection from argument building; supplies `--level`, scan
  directories, and autoload via CLI when config is absent or generated. Filters
  discovered directories to only those containing PHP files.
- `phpstan-adjust-scandirs.php`: Treats a missing config file as an empty
  config instead of an error, allowing the script to generate a fresh
  `phpstan.neon` from the provided scan directories alone.
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Feb 26, 2026
@lippserd lippserd merged commit bc0d9d0 into main Feb 26, 2026
13 checks passed
@lippserd lippserd deleted the phpstan-no-phpstan.neon branch February 26, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant