Skip to content

PHP: Pass Composer autoloader to PHPStan conditionally#21

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

PHP: Pass Composer autoloader to PHPStan conditionally#21
lippserd merged 1 commit intomainfrom
phpstan-no-composer.json

Conversation

@lippserd
Copy link
Member

Previously hardcoded autoloader path assumed composer.json presence, causing failures in projects without Composer. Now initializes autoload empty, sets it conditionally via file existence check, and appends --autoload-file only when non-empty. Allows PHPStan to run without autoloader fallback in non-Composer projects.

Previously hardcoded autoloader path assumed `composer.json` presence, causing
failures in projects without Composer. Now initializes autoload empty, sets it
conditionally via file existence check, and appends `--autoload-file` only when
non-empty. Allows PHPStan to run without autoloader fallback in non-Composer
projects.
@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 d037aa3 into main Feb 26, 2026
13 checks passed
@lippserd lippserd deleted the phpstan-no-composer.json branch February 26, 2026 22:23
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