Make IDE aware of Carbon macros

The Carbon library allows creating custom methods:

    static fn (WorkingWeek $workingWeek) => $workingWeek->isWeekend(self::this())

Is there a way to make PhpStorm aware of them?


Here's a request for this to be implemented in Laravel IDE Helper:

In general, it should be possible to create helpers manually, but I am not sure if it's the way you want to go.


I use Symfony and I don't fully grasp what a Laravel IDE Helper is (project README pretty much assumes you already know what it is). I get it's some kind of stub?

I was hoping for some obscure phpdoc annotation or PhpStorm Meta. Since it's unlikely that our project needs a lot of macros, I don't think it's worth to add stubs or dependencies. Thank you for your suggestion anyway.


Please never mind; somehow I was under impression that Carbon is a Laravel thing, but it's not.
I've extracted this as a feature request:

Unfortunately, using the advanced metadata here isn't possible because you can't add methods using it.


Please sign in to leave a comment.