Open pjio opened 2 months ago
Here the old and new file for easier comparison: _ide_helper.php.old.txt _ide_helper.php.new.txt
@pjio will this fix https://github.com/barryvdh/laravel-ide-helper/issues/1572 as well?
@pjio will this fix #1572 as well?
No, for #1572 it doesn't make a difference. The cause is a different one. This PR only affects the return type $this
.
Changes 03.09.24
normalizeReturn()
does set the return type only with $tag->setContent()
(before it was overwritten by $tag->setType()
which had the side effect to reset Tag::$content
)$this
could be normalized depending on the alias._ide_helper.php
tested with Laravel 10 and PHP 8.1, 8.2 and 8.3Edit: Intelephense up to version 1.10.4 and again since version 1.12.6 works with the |static
return type.
Thank you very much for your valuable contributions! I would greatly appreciate it if the project maintainers could merge this pull request and release a new version as soon as possible.
Summary
See issue for expected improvement: https://github.com/barryvdh/laravel-ide-helper/issues/1574
The class
\Eloquent
in_ide_helper.php
contains methods fromIlluminate\Database\Eloquent\Builder
andIlluminate\Database\Query\Builder
. The return type for$this
is replaced with the real class (in case of the Eloquent\Builder already with an additional|static
). This merge requests replaces$this
in methods from Query\Builder with the identical return typeIlluminate\Database\Eloquent\Builder|static
. In the context of an\Eloquent
instance this should be the real behavior and improves the derived types.Type of change
Checklist
composer fix-style