overtrue / phplint

:bug: A tool that can speed up linting of php files by running several lint processes at once.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Let Composer do the job to install the correct version (v3 / v4 / v5)

llaville opened this issue · comments

With current composer php constraints

Code maintain is a bit difficult (see PR #135, PR #134, PR #133), each time there are new versions.

NOTE: Use also a Major.minor (version format only like https://github.com/overtrue/phplint/blob/7.4/src/Console/Application.php#L24) to avoid forgotten bumping new release (as in 5.2.2), see https://github.com/overtrue/phplint/blob/5.2.2/src/Console/Application.php#L13

I propose to remove constraints on Dockerfile and adapt composer php constraint to let do the job as wanted :

Install a PHP5.5/7.4 version on PHP 7.4 platform (code from branch 7.4)
Install a PHP 8.0 version (code from branch 8.0)
Install a PHP 8.1 version (code from branch 8.1)

Example with branch 8.1

Replace https://github.com/overtrue/phplint/blob/8.1/Dockerfile#L5

RUN composer global require overtrue/phplint:^5.2.0

by

RUN composer global require overtrue/phplint

And let Composer do the job (with php: ^8.1) and add extra config/platform setting (see https://mikemadison.net/blog/2020/11/17/configuring-php-version-with-composer)

@overtrue if you're agree with these changes, PR may follows

It's a good idea, Thanks.

I'll work on it today !

Composer allow plugins feature was not backported to branch 8.0 and 7.4 from branch 8.1
See origin at https://github.com/overtrue/phplint/blame/8.1/composer.json#L74

I'll add it also in this context

Composer PHP constraint allow PHP 5.5.9 to 7.4, but not PHP 8.0 and 8.1 (for branch 7.4); Can be checked with https://jubianchi.github.io/semver-check/#/constraint/^5.5.9%20||%20^7.0

I've also updated Composer OR constraint syntax (with commit https://github.com/llaville/phplint/commit/8153748f31cb23bc98265d17a2514600ba04c1ed) following recommandation we can read at https://getcomposer.org/doc/articles/versions.md#version-range

@overtrue For patch on branch 8.1, I'll waiting for PR #143 agreement

Fixed now by PR #144, #145 and #147 merged in corresponding branches 7.4, 8.0 and 8.1
This issue may be closed !