laravel-ide-macros icon indicating copy to clipboard operation
laravel-ide-macros copied to clipboard

Problem with MacrosCommand.php::generateFunction

Open farpat opened this issue 10 months ago • 1 comments

Hello here,

This is an example of a macro :

use Carbon\Carbon;

Carbon::macro('example', function (Carbon $otherDate) {
   // ... some any code
});

When I generate macro via

php artisan ide-helper:macros

the generated _ide_macros.php contains something like that :

namespace Carbon {
   class Carbon {
        public static function example(Carbon\Carbon $otherDate) {

        }
   }
}

And we can see the type of $otherDate is wrong. I think that the easiest is to add the prefix \ in all types.

Thanks for your work :)

farpat avatar Sep 04 '23 13:09 farpat