coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

Problem with CRLF: assert($firstOnLinePointer !== null) fails

Open amenk opened this issue 7 months ago • 1 comments

For the record:

I am getting

PHP Fatal error: Uncaught AssertionError: assert($firstOnLinePointer !== null) in /app/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php:67

on a CRLF formatted file

s$ cat -A ProductCustomFields.php | head -n 3
<?php declare(strict_types=1);^M$
^M$
/**^M$

Switching to LF seems to fix the problem.

I want to use LF, so it's all fine. Just adding this for the record and for others who might run into the same issue.

amenk avatar Apr 25 '25 13:04 amenk