mikeerickson / phpunit-pretty-result-printer

PHPUnit Pretty Result Printer -- make your PHPUnit tests look pretty!
MIT License
1.2k stars 71 forks source link

PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in src/Printer.php on line 302 #23

Closed Razoxane closed 6 years ago

Razoxane commented 6 years ago

https://github.com/mikeerickson/phpunit-pretty-result-printer/blob/30bd2d7975187b49b3e4eaef7780dd08fa8ae7e1/src/Printer.php#L301

The : int appears to be causing the following error message in PHPUnit 5.7.26:

PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /vendor/codedungeon/phpunit-result-printer/src/Printer.php on line 302

When I remove that text, the package works correctly. Is it meant to be there for different versions, or is it a typo?

mikeerickson commented 6 years ago

@Razoxane What verison of PHP are you using?

Razoxane commented 6 years ago

5.6.33

mikeerickson commented 6 years ago

@Razoxane That explains the issue (these type hints require PHP 7.x or greater). However, this is not required for this project, thus i am going to remove the type hint.