Skip to content

[BetterPhpDocParser] Use str_contains() for DoctrineAnnotationDecorator#6674

Merged
samsonasik merged 1 commit intorectorphp:mainfrom
andrewnicols:doctrineStringContains
Jan 16, 2025
Merged

[BetterPhpDocParser] Use str_contains() for DoctrineAnnotationDecorator#6674
samsonasik merged 1 commit intorectorphp:mainfrom
andrewnicols:doctrineStringContains

Conversation

@andrewnicols
Copy link
Copy Markdown
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
@samsonasik
Copy link
Copy Markdown
Member

Thank you @andrewnicols

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants