claudiodekker / laravel-macro-describer
Automatically generate IDE autocompletion helpers for Laravel macros/mixins.
Requires
- php: ^7.2
- laravel/framework: ^6.0|^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.0|^9.0
This package is auto-updated.
Last update: 2020-09-04 18:23:41 UTC
README
Automatically generate IDE autocompletion helpers for Laravel macros/mixins.
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.