You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
README: document inline minimum version definition option
To be honest, I never realized this was possible until I looked at the code in more detail, so I have a feeling that this feature is barely known.
This feature has been in the codebase since 2014 (b0b05d2), so let's document this option to raise awareness.
Since v1.3.0, a PHAR file is also made available for each release.
40
41
This PHAR file is published as an asset for each release and can be found on the [Releases](https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases) page.
## Excluding files from a scan based on the PHP version used
99
+
100
+
Sometimes a particular file in a project may not comply with the project-wide minimum PHP version, like a file which is conditionally included in the project and contains PHP syntax which needs a higher PHP version to run.
101
+
102
+
This can make it complicated to run Parallel Lint in a CI context, as the `exclude`s used in the command would have to be adjusted based on the PHP version on which the scan is being run.
103
+
104
+
PHP Parallel Lint offers a straight-forward way around this, as files can define their own minimum PHP version like so:
105
+
```php
106
+
<?php // lint >= 7.4
107
+
108
+
// Code which contains PHP 7.4 syntax.
109
+
```
110
+
111
+
With this comment in place, the file will be automatically skipped when PHP Parallel Lint is run on a PHP version lower than PHP 7.4.
112
+
113
+
Note: The `// lint >= 7.4` comment has to be only the first line of the file and must directly follow the PHP open tag.
114
+
115
+
97
116
## How to upgrade
98
117
99
118
Are you using `jakub-onderka/php-parallel-lint` package? You can switch to `php-parallel-lint/php-parallel-lint` using:
0 commit comments