Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Problem with MacrosCommand.php::generateFunction #33

Open
farpat opened this issue Sep 4, 2023 · 1 comment · May be fixed by #34
Open

Problem with MacrosCommand.php::generateFunction #33

farpat opened this issue Sep 4, 2023 · 1 comment · May be fixed by #34

Comments

@farpat
Copy link

farpat commented Sep 4, 2023

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
Copy link
Author

farpat commented Sep 4, 2023

I go to propose a merge request

farpat pushed a commit to farpat/laravel-ide-macros that referenced this issue Sep 4, 2023
- We make sure we manipulate a 'macro' in the handle() method
- We make sure we retrieve the proper parameter type in case it references a class (by adding a backslash)

Fix KristofMorva#33
@farpat farpat linked a pull request Sep 4, 2023 that will close this issue
farpat pushed a commit to farpat/laravel-ide-macros that referenced this issue Sep 4, 2023
- We make sure we manipulate a 'macro' in the handle() method
- We make sure we retrieve the proper parameter type in case it references a class (by adding a backslash)

Fix KristofMorva#33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant