claudiodekker/laravel-macro-describer

This package is abandoned and no longer maintained. No replacement package was suggested.

Automatically generate IDE autocompletion helpers for Laravel macros/mixins.

0.1.0-beta 2020-09-04 18:11 UTC

This package is auto-updated.

Last update: 2020-09-04 18:23:41 UTC


README

Automatically generate IDE autocompletion helpers for Laravel macros/mixins.

Latest Version Build Status Quality Score StyleCI Total Downloads

Installation

You can install the package via composer:

composer require claudiodekker/laravel-macro-describer

Usage

Simply run php artisan macro:generate-helpers, or append it to your composer.json's post-autoload-dump section like this:

"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover --ansi",
        "@php artisan macro:generate-helpers"
    ],

When ran, the script does the following:

  • Find all classes that use the Macroable trait.
  • Fetch all registered macros/mixins using Reflection.
  • Parse all method details using reflection (name, parameters & types, return type etc.)
  • Generate an PHPDocumentor-compatible _ide_helpers.php file

This is, without a doubt, the most disgusting, hacky piece of code that I knowingly published on Github.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email claudio@ubient.net instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.