-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Feature request: allow transformation of generic array-syntax in IDE helper docblocks #1470
Comments
Hello @jnoordsij! 👋🏻 |
@szepeviktor thanks for your quick reaction! I totally agree, but looking at barryvdh/laravel-ide-helper#942, it seems like support for that won't land anytime soon, so I was hoping for a workaround. |
You may get it anytime. Here we have a small community. |
There is no plan to support this. It is a really old syntax. You can use the generic version instead |
Update for those who find this: barryvdh/laravel-ide-helper#1298 has been merged in the Laravel IDE helper packages, so if you use the |
master
--level
used: maxDescription
In #479 a resolver was introduced to interpret docblocks like
\Illuminate\Database\Eloquent\Collection|\App\Account[] $accounts
as\Illuminate\Database\Eloquent\Collection<\App\Account> $accounts
.It would be useful to also accept another pattern, namely
\Illuminate\Database\Eloquent\Collection|array<\App\Account> $accounts
and convert this. This pattern is the result of auto-correction by PHP_CodeSniffer using my current ruleset.In (https://github.com/jnoordsij/larastan/tree/generalise-ide-helper-type-transformer) I made a first attempt at implementing this, but it currently seems to be resolving incorrectly for some other union types. It also contains tests for both transforms.
The text was updated successfully, but these errors were encountered: