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

[BetterPhpDocParser] Use str_contains() for DoctrineAnnotationDecorator #6674

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

andrewnicols
Copy link
Contributor

The Lexer tokenizes at whitespace and certain other characters such as ., and (, If none of these tokens are present then the tokens are not split. For example in the string here:

@copyright Some Value. Something.({@link https://example.com}).

This is tokenised into:

'@copyright'
' '
'Some'
' '
'Value'
'.'
' '
'Something'
.({@link'
' '
'https'
':'
'//example.com}).'

Both the open, and close, curly braces may be in the middle of a string and therefore the str_contains must be used for these cases.

…or (rectorphp#6671)

The Lexer tokenizes at whitespace and certain other characters such as
`.`, and `(`, If none of these tokens are present then the tokens are
not split. For example in the string here:

```
@copyright Some Value. Something.({@link https://example.com}).
```

This is tokenised into:
```
'@copyright'
' '
'Some'
' '
'Value'
'.'
' '
'Something'
.({@link'
' '
'https'
':'
'//example.com}).'
```

Both the open, and close, curly braces may be in the middle of a string
and therefore the `str_contains` must be used for these cases.
@samsonasik samsonasik merged commit a26bfd9 into rectorphp:main Jan 16, 2025
41 checks passed
@samsonasik
Copy link
Member

Thank you @andrewnicols

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

Successfully merging this pull request may close these issues.

2 participants