-
-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Description
@prettier/plugin-php v0.24.0
Playground link
Input:
<?php
($var)?->func();Output:
Parse Error : syntax error, unexpected '?->' (T_NULLSAFE_OBJECT_OPERATOR), expecting ';' on line 3
1 | <?php
2 |
> 3 | ($var)?->func();
| ^Prettier throws a syntax error when optional chaining from an expression wrapped in parentheses. Practical example that I was working on when I encountered this issue:
private function isSyncJob(object $job): bool
{
return ($job->job ?? null)?->getConnectionName() === "sync";
}
Metadata
Metadata
Assignees
Labels
No labels