Skip to content

once over after artisan ide-helper:models -RW - #1056

Merged
barryo merged 1 commit into
mainfrom
models-phpdoc
Aug 14, 2026
Merged

once over after artisan ide-helper:models -RW #1056
barryo merged 1 commit into
mainfrom
models-phpdoc

Conversation

@afk11

@afk11 afk11 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

-RW is fairly noisy - it resets existing phpdoc and starts over. I wanted to get ahead of that during a release by doing it now.

It added a fair bit of churn in this occasion. I noted the reasons as I reviewed:

  • phpdoc properties are updated to match DB column layout
  • some cast to array properties had array typing added
  • Builder -> Builder::static
  • namespaces + use is taken into account, so \Illuminate\Database\Eloquent\Builder type might become Builder if we imported it.

Besides refreshing property, scope*, and automated where* methods, I came across the following:

  • some parameters have been removed from the DB but remained in phpDoc. In these cases, I checked each property was unused in the project.
  • when using multi-line import, don't have a class name on beginning line after {
  • consoleserverconnection switchid parameter was removed via migration in 2021, but had a relation setup between itself and Switcher.
  • Removing RsPrefix and related, so didn't include those changes

Finally:
I ran into an edge case when it generates type hints for scope* methods in a child class, ie, only relevant to Aggregator classes which all tend to extend a Model. If the Model has a scope method, and it typehints Builder (not FQDN), then the child class won't use the FQDN in the type-hint.. the type hint is for Builder although there's no import for it. Opened issue: barryvdh/laravel-ide-helper#1795

@afk11

afk11 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/**
 * IXP\Models\Customer <-- it'll leave all this alone
 * and this, no problem having comments..
 * @property int $id
 * @property int|null $irrdb

However

 * @method static Builder<static>|Customer whereType($value)
 * @method static Builder<static>|Customer whereUpdatedAt($value)
 * whomp whomp <-- it'll remove this
 * @mixin Eloquent
 */

@barryo
barryo merged commit 0ad1914 into main Aug 14, 2026
3 checks passed
@barryo
barryo deleted the models-phpdoc branch August 14, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants