-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] defining used PHP version #1575
Comments
@mimmi20, I have no relevant experience with PHP, but I think the short answer is no. Most likely, your best bet would be to disable phplint, and run it outside of MegaLinter. You can achieve that by adding the following to your MegaLinter config: DISABLE_LINTERS:
- PHP_PHPLINT MegaLinter v6 will be released soon, but most likely without support for running phplint on PHP 8 unfortunately. My understanding is that there were some issues that are making upgrading difficult right now, although @llaville may correct me if I misunderstood. |
@Kurt-von-Laven I'm away from my Laptop, but yes there is a solution to switch PHP version runtime used. |
@Kurt-von-Laven and @mimmi20 PHP switch capability was introduced in MegaLinter since version 5.3 with #1083 All you have to do is to use the PRE_COMMAND syntax on PHP_PHPLINT like that : Remember that in MegaLinter v5.x, default PHP BUILTIN linter version is PHP 7 (7.4.x)
NOTE: PHPLint 3.0 is compatible PHP 7.4 and 8.0 (until we use composer built-in with a PHP 7 version) |
You should see in MegaLinter logs something like
|
@llaville Does this switch also exists for all other php related linters? As you may see in my sample, the |
yes it exist for all PHP linters |
I have decided to not change my config file, to disable the php checks for megalinter and run these checks in seperate tasks. |
I am started using the megalinter when upgrading my projects to PHP 8.1.
In one project I got this error:
The linter uses PHP 7.4, but the code is written for PHP 8.1.
Is there any option to define the PHP version used by the linter?
The text was updated successfully, but these errors were encountered: