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 @@ -937,10 +937,19 @@ protected function createPhpDocs($class)
937
937
$ phpdoc ->appendTag ($ tag );
938
938
}
939
939
940
- if ($ this ->write && ! $ phpdoc -> getTagsByName ( ' mixin ' ) ) {
940
+ if ($ this ->write ) {
941
941
$ eloquentClassNameInModel = $ this ->getClassNameInDestinationFile ($ reflection , 'Eloquent ' );
942
+
943
+ // remove the already existing tag to prevent duplicates
944
+ foreach ($ phpdoc ->getTagsByName ('mixin ' ) as $ tag ) {
945
+ if ($ tag ->getContent () === $ eloquentClassNameInModel ) {
946
+ $ phpdoc ->deleteTag ($ tag );
947
+ }
948
+ }
949
+
942
950
$ phpdoc ->appendTag (Tag::createInstance ('@mixin ' . $ eloquentClassNameInModel , $ phpdoc ));
943
951
}
952
+
944
953
if ($ this ->phpstorm_noinspections ) {
945
954
/**
946
955
* 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