laravel-idea / plugin

Laravel Idea plugin for PhpStorm
https://laravel-idea.com/
165 stars 7 forks source link

[Bug]: Laravel 11.17.0 added `HasCollection` trait and new `$collectionClass` property #1035

Closed dmason30 closed 3 weeks ago

dmason30 commented 1 month ago

Bug description

See these PRs the HasCollection trait and $collectionClass property was added so we can properly type hint the model collection for static-analysis (e.g. PHPStan).

https://github.com/laravel/framework/pull/52171 https://github.com/laravel/framework/pull/52186

So now we have this on a Model:

class Post extends Model
{
    /** @use HasCollection<PostCollection<array-key, static>> */
    use HasCollection;

    protected static string $collectionClass = PostCollection::class;
}

Plugin version

8.2.2.241

Operating system

MacOS

Steps to reproduce

Use the code above and the plugin when running Generate Helper Code does not pickup the custom collections.

Relevant log output

No response

adelf commented 1 month ago

Well, marking this as a "bug" is a bit... early)

I'll try to use this declarations.

dmason30 commented 1 month ago

Sorry if I chose the wrong type. Just didn't feel right as a feature request either.

Thanks for looking into it 👍

adelf commented 3 weeks ago

Implemented in the Laravel Idea 8.2.3