DDC-1280: Generated proxy classes have mixed line endings on Windows #1611

Closed
opened 2026-01-22 13:19:55 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 17, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user literal:

When Doctrine\ORM\Proxy\ProxyFactory generates proxy classes on Windows, it mixes LF an CR/LF line endings. This is causing VCS issues in our mixed Windows/Linux dev team (we keep the proxies under version control for deployment purposes).

This seems to be a regression. It did not happen with Doctrine 2.0.x.

It is caused by the template string in the static property $_proxyClassTemplate using LF, while the string concatenations in the methods use the PHP_EOL constant, which resolves to CR/LF on Windows.

Other code generators like Doctrine\ORM\Tools\EntityGenerator use "\n" instead of PHP_EOL.

I propose to always use "\n" in favour of PHP_EOL. It's easier to implement in this case and every editor/IDE on Windows can handle Unix line endings nowadays.

Originally created by @doctrinebot on GitHub (Jul 17, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user literal: When Doctrine\ORM\Proxy\ProxyFactory generates proxy classes on Windows, it mixes LF an CR/LF line endings. This is causing VCS issues in our mixed Windows/Linux dev team (we keep the proxies under version control for deployment purposes). This seems to be a regression. It did not happen with Doctrine 2.0.x. It is caused by the template string in the static property $_proxyClassTemplate using LF, while the string concatenations in the methods use the PHP_EOL constant, which resolves to CR/LF on Windows. Other code generators like Doctrine\ORM\Tools\EntityGenerator use "\n" instead of PHP_EOL. I propose to always use "\n" in favour of PHP_EOL. It's easier to implement in this case and every editor/IDE on Windows can handle Unix line endings nowadays.
admin added the Bug label 2026-01-22 13:19:55 +01:00
admin closed this issue 2026-01-22 13:19:55 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 26, 2011):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (Jul 26, 2011): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (Jul 26, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 26, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1611