mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
When a MorphTo relation's docblock uses a bare intersection type in the generic parameter (e.g. `MorphTo<BaseModel&CanBeAssigned, $this>`), the generated property type incorrectly becomes `BaseModel&CanBeAssigned|null` instead of the correct `(BaseModel&CanBeAssigned)|null`. This adds `wrapIntersectionType()` which ensures bare intersection types are wrapped in parentheses before `|null` is appended, producing valid DNF type syntax. Applied in both `setProperty()` and `applyNullability()`.