Skip to content

Bug: Project composer autoload should not be loaded when running from Phar #61

Closed
@jrfnl

Description

@jrfnl

Problem

The PHAR file does not run independently of the project dependencies of the project being scanned.

Cause

The autoloading in the parallel-lint file does not properly take running from a self-contained Phar into account.

Reproduction scenario:

  1. Make sure the system default PHP version / PHP version used by Composer is a high PHP version, like PHP 7.4 or 8.0.
  2. Run:
mkdir testthis
cd testthis
composer create-project yoast/phpunit-polyfills
cd phpunit-polyfills
  1. Now run the Parallel Lint phar with a low(er) PHP version
path/php-7.0/php.exe "parallel-lint.phar" . --exclude vendor

... and see the following fatal error displayed:

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". You are running 7.0.33. in path/to/testthis/phpunit-polyfills/vendor/composer\platform_check.php on line 24

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions