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

Compatibility with PHP 8

jasonmccreary opened this issue · comments

While this package appears to be compatible with PHP 8 from a dependency perspective, it does not seem to work within my GitHub Actions.

It's failing with a syntax error for the new match statement.

    33|         $suffix = match ($this->code) {
  > 34|             3 => 'composer',
    35|             11 => 'branch',
    36|             default => 'generic',
    37|         };
 unexpected '=>' (T_DOUBLE_ARROW) in line 34

This may simply be a configuration issue, but my job is running PHP 8.0 via the shivammathur/setup-php@v2 step. Any guidance for ensuring this step uses PHP 8 would be appreciated. Thanks.

php -v

Run php -v
PHP 8.0.5 (cli) (built: May  3 2021 11:30:57) ( NTS )

This was added prior to the step uses: overtrue/phplint@master. My guess is this step is not using the PHP version of the job, but it's own (7.4).

Here are the relevant sections:

      - uses: shivammathur/setup-php@v2
        with:
          php-version: 8.0
          coverage: none

      - name: PHP Version
        run: php -v

      - uses: overtrue/phplint@master

@jasonmccreary plz try to use uses: overtrue/phplint@3.0

That did it. I assume I should use this tag to get the PHP 8.0 build of phplint?

@jasonmccreary Sorry, my reply above is wrong, it should be using 3.0, docker tag is 8.0.