Open wfern opened 4 months ago
Thank you for the detailed test case.
In this case, the editor is not sure if Factory<TicketCategory>
is TicketCategoryFactory
or EventFactory
(even though it's clear for us, humans). So it gueses.
We can improve it by looking for the @extends Factory<TicketCategory>
doc comment tag above class TicketCategoryFactory
, if you have that annotation there?
Yes, I think is a nice addition. Thanks!
Hello! I don't know if it's pure related to Laravel factories. But if I have two Factories with the same method name the extension get confused and shows the wrong type.
Example: I have a
TicketCategory
andEvent
factories with the same method name called:withTickets
;First, get a factory instance of any model and it will show the right type, like:![image](https://github.com/DEVSENSE/phptools-docs/assets/4096003/e9958971-3ab6-43cc-a7b9-0fc2a40679b7)
But when we call some method of this factory and we have another factory with a method with the same name:![image](https://github.com/DEVSENSE/phptools-docs/assets/4096003/7cec4407-0b45-4d5d-bd8c-6bc160ae9739)
With "ide-helper" it show the right one but the wrong one too, still causing the error because the methods have the same name but not the same params:![image](https://github.com/DEVSENSE/phptools-docs/assets/4096003/ccd82623-a107-4984-9045-a5fd265a2d8c)
It's funny because I have other models with the same method name and when i hover the method they keep changing the hint one time show the Event Factory method, other times the Order Factory method, sometimes the RIGHT method, etc...
The complete snippet: