Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
amenk opened this issue Apr 25, 2025 · 1 comment
Open

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

amenk opened this issue Apr 25, 2025 · 1 comment

Comments

@amenk
Copy link

amenk commented Apr 25, 2025

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
Copy link
Author

amenk commented Apr 29, 2025

I also noticed problems with phpcbf running into infinite loops which seem to be related with CRLFs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant