bug: Allow string quote to be escaped within phpdoc constant#6798
bug: Allow string quote to be escaped within phpdoc constant#6798kubawerlos merged 1 commit intoPHP-CS-Fixer:masterfrom
Conversation
26172bf to
8c2fdd3
Compare
| @@ -88,7 +88,7 @@ final class TypeExpression | |||
| (?i) | |||
There was a problem hiding this comment.
I would love to hear more about the purpose of this PR.
looking only at \\\'"\'"'"|"|"'"\'\\"""""\"" is not helping ;)
There was a problem hiding this comment.
this PR allows type like 'a\'b' to be accepted (quote char to be escaped/present)
- escaping the quote character was previously not possible
\ncould be possibly reprinted wrongly, thus tested ;-)- the test has 2 types, if parsed, they are parsed as two types - this is what the test does
|
@Wirone |
|
|
||
| yield ['array < int , callable ( string ) : bool >', ['array < int , callable ( string ) : bool >']]; | ||
|
|
||
| yield ['\'a\\\'s"\\\\\n\r\t\'|"b\\"s\'\\\\\n\r\t"', ['\'a\\\'s"\\\\\n\r\t\'', '"b\\"s\'\\\\\n\r\t"']]; |
There was a problem hiding this comment.
Can we have a few more? What is the smallest accepted type? '\''?
There was a problem hiding this comment.
added smallest type - '' empty string and a few other simple strin before the complex test
|
Why do we need it? If I saw |
@keradus I agree with @kubawerlos - I don't see the need for this change. Lack of PR description and more examples does not help 😉 |
|
@Wirone please see phpstan/phpdoc-parser#143, escaped phpdoc string is valid and must be supported, it is obvious the original |
|
Looking at examples provided phpstan/phpdoc-parser#142 (1, 2) gave me a context needed to understand why it's required, thanks @mvorisek 🙂. It would be easier for reviewers if it was provided in the description, though 😅. |
3702e6b to
6ef3e5f
Compare
|
@mvorisek some PRs were merged, could you please resolve the conflicts and update the branch for this PR? |
6ef3e5f to
add37a1
Compare
|
@Wirone conflict resolved |
|
@Wirone can this PR be merged? |
|
Thank you @mvorisek 🍻 |
Reference: phpstan/phpdoc-parser#142 (1, 2).