djoos / Symfony-coding-standard

Development repository for the Symfony coding standard
MIT License
402 stars 102 forks source link

ReturnType Sniff uses deprecated T_RETURN_TYPE #148

Closed xalopp closed 5 years ago

xalopp commented 5 years ago

While the tests are fine when using phpcs < 3.3.0, they will fail when using phpcs >= 3.3.0:

PHPUnit 6.5.13-32-g6050504ca by Sebastian Bergmann and contributors.

............F........                                             21 / 21 (100%)

Time: 430 ms, Memory: 8.00MB

There was 1 failure:

1) Symfony\Tests\Functions\ReturnTypeUnitTest::testSniff
[LINE 5] Expected 1 error(s) in ReturnTypeUnitTest.inc but found 0 error(s).
[LINE 21] Expected 1 error(s) in ReturnTypeUnitTest.inc but found 0 error(s).

The reason is that the constant T_RETURN_TYPE used in ReturnTypeUnitSniff is deprecated. For more details, see https://github.com/squizlabs/PHP_CodeSniffer/blob/master/package.xml#L2158