Skip to content
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

[PHP 8.0] Fix annotation to attribute in case of FQN class without () #5609

Merged
merged 2 commits into from Feb 12, 2024

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Feb 12, 2024

No description provided.

@TomasVotruba TomasVotruba changed the title tv anno regex [PHP 8.0] Fix annotation to attribute in case of FQN class without () Feb 12, 2024
@TomasVotruba TomasVotruba enabled auto-merge (squash) February 12, 2024 15:38
@TomasVotruba TomasVotruba merged commit 6dd91df into main Feb 12, 2024
41 checks passed
@TomasVotruba TomasVotruba deleted the tv-anno-regex branch February 12, 2024 15:39
* @var string
*/
private const LONG_ANNOTATION_REGEX = '#@\\\\(?<class_name>.*?)(?<annotation_content>\(.*?\)|,)#';
private const LONG_ANNOTATION_REGEX = '#@\\\\(?<class_name>.*?)(?<annotation_content>\(.*?\)|,|\n|$)#';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should support windows new line with \r?\n

Suggested change
private const LONG_ANNOTATION_REGEX = '#@\\\\(?<class_name>.*?)(?<annotation_content>\(.*?\)|,|\n|$)#';
private const LONG_ANNOTATION_REGEX = '#@\\\\(?<class_name>.*?)(?<annotation_content>\(.*?\)|,|\r?\n|$)#';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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