Skip to content

Conversation

@leofeyer
Copy link
Member

@leofeyer leofeyer commented Jul 26, 2020

As of version 4.7, the PHP parser supports PHP 8 match expressions, which unfortunately breaks PHPUnit under PHP 7.4.

ERROR: ParseError - vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php:15:35 - Syntax error, unexpected T_MATCH on line 15 (see https://psalm.dev/173)
interface ParametersMatch extends Match


ERROR: ParseError - vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php:34:40 - Syntax error, unexpected ';', expecting '{' on line 34 (see https://psalm.dev/173)
    public function with(...$arguments);


ERROR: ParseError - vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php:47:40 - Syntax error, unexpected ';', expecting '{' on line 47 (see https://psalm.dev/173)
    public function withAnyParameters();

The issue has been reported in nikic/PHP-Parser#690, so I hope it will be fixed in version 4.7.1.

@leofeyer leofeyer added the CI label Jul 26, 2020
@leofeyer leofeyer added this to the 4.10 milestone Jul 26, 2020
@leofeyer leofeyer requested a review from a team July 26, 2020 20:23
@leofeyer leofeyer self-assigned this Jul 26, 2020
@leofeyer leofeyer force-pushed the fix/nikic-php-parser branch from c3f842f to 00ed9a0 Compare July 26, 2020 20:49
@leofeyer leofeyer merged commit 18cb500 into contao:4.10 Jul 27, 2020
@leofeyer leofeyer deleted the fix/nikic-php-parser branch July 27, 2020 07:16
AlexejKossmann pushed a commit to AlexejKossmann/contao that referenced this pull request Apr 6, 2021
Description
-----------

As of version 4.7, the PHP parser supports PHP 8 match expressions, which unfortunately [breaks PHPUnit](nikic/PHP-Parser#672 (comment)) under PHP 7.4.

```
ERROR: ParseError - vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php:15:35 - Syntax error, unexpected T_MATCH on line 15 (see https://psalm.dev/173)
interface ParametersMatch extends Match

ERROR: ParseError - vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php:34:40 - Syntax error, unexpected ';', expecting '{' on line 34 (see https://psalm.dev/173)
    public function with(...$arguments);

ERROR: ParseError - vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php:47:40 - Syntax error, unexpected ';', expecting '{' on line 47 (see https://psalm.dev/173)
    public function withAnyParameters();
```

The issue has been reported in nikic/PHP-Parser#690, so I hope it will be fixed in version 4.7.1.

Commits
-------

00ed9a0 Add a conflict with nikic/php-parser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants