squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.66k stars 1.48k forks source link

Update BackfillNumericSeparatorTest.php #3818

Closed ETM44 closed 1 year ago

ETM44 commented 1 year ago

I am using a symfony 6 project with php 8.1.13. The limit of an int is 9223372036854775807.

VS Code was giving me the following error: The integer number 10223372036854775807 is too big, converting to double insteadPHP(PHP0009)

Why did you write 10 instead of 9?

jrfnl commented 1 year ago

Why did you write 10 instead of 9?

This would break the test. The number used in the test is 10223372036854775807.

https://github.com/jrfnl/PHP_CodeSniffer/blob/bb9216e5a1b3d6bbb80af20e24fe93f07f3f2ecf/tests/Core/Tokenizer/BackfillNumericSeparatorTest.inc#L37-L38

The whole point of the test is to verify and ensure that the backfill retokenizes numbers which are larger than PHP_INT_MAX as T_DNUMBER (float) instead of T_LNUMBER (integer).

Closing as invalid.