Add better support for macros and mixins (#1006)

Co-authored-by: Dominik Krämer <[email protected]>
This commit is contained in:
domkrm
2020-09-06 07:58:13 +02:00
committed by GitHub
co-authored by Dominik Krämer
parent 24596b67f1
commit 3a22b8daf6
4 changed files with 93 additions and 2 deletions
+12
View File
@@ -110,6 +110,18 @@ You can use an in-memory SQLite driver by adding the `-M` option.
You can choose to include helper files. This is not enabled by default, but you can override it with the `--helpers (-H)` option.
The `Illuminate/Support/helpers.php` is already set up, but you can add/remove your own files in the config file.
### Automatic PHPDoc generation for macros and mixins
This package can generate PHPDocs for macros and mixins which will be added to the `_ide_helper.php` file.
But this only works if you use type hinting when declaring a macro.
```php
Str::macro('concat', function(string $str1, string $str2) : string {
return $str1 . $str2;
});
```
### Automatic PHPDocs for models
If you don't want to write your properties yourself, you can use the command `php artisan ide-helper:models` to generate