File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
8
8
### Fixes
9
9
- Fix return type of methods provided by ` SoftDeletes ` [ #1345 / KentarouTakeda] ( https://github.com/barryvdh/laravel-ide-helper/pull/1345 )
10
10
- Handle PHP 8.1 deprecation warnings when passing ` null ` to ` new \ReflectionClass ` [ #1351 / mfn] ( https://github.com/barryvdh/laravel-ide-helper/pull/1351 )
11
+ - Fix issue where \Eloquent is not included when using write_mixin [ #1352 / Jefemy] ( https://github.com/barryvdh/laravel-ide-helper/pull/1352 )
11
12
- Fix model factory method arguments for Laravel >= 9 [ #1361 / wimski] ( https://github.com/barryvdh/laravel-ide-helper/pull/1361 )
12
13
13
14
2022-03-06, 2.12.3
Original file line number Diff line number Diff line change @@ -926,10 +926,19 @@ protected function createPhpDocs($class)
926
926
$ phpdoc ->appendTag ($ tag );
927
927
}
928
928
929
- if ($ this ->write && ! $ phpdoc -> getTagsByName ( ' mixin ' ) ) {
929
+ if ($ this ->write ) {
930
930
$ eloquentClassNameInModel = $ this ->getClassNameInDestinationFile ($ reflection , 'Eloquent ' );
931
+
932
+ // remove the already existing tag to prevent duplicates
933
+ foreach ($ phpdoc ->getTagsByName ('mixin ' ) as $ tag ) {
934
+ if ($ tag ->getContent () === $ eloquentClassNameInModel ) {
935
+ $ phpdoc ->deleteTag ($ tag );
936
+ }
937
+ }
938
+
931
939
$ phpdoc ->appendTag (Tag::createInstance ('@mixin ' . $ eloquentClassNameInModel , $ phpdoc ));
932
940
}
941
+
933
942
if ($ this ->phpstorm_noinspections ) {
934
943
/**
935
944
* Facades, Eloquent API
Original file line number Diff line number Diff line change 9
9
/**
10
10
* @property $someProp
11
11
* @method someMethod(string $method)
12
+ * @mixin IdeHelperPost
12
13
*/
13
14
class Post extends Model
14
15
{
You can’t perform that action at this time.
0 commit comments