Skip to content

Attribute accessor/mutator without the counterparts generate wrong model properties #1531

@marvinschroeder

Description

@marvinschroeder

Versions:

  • ide-helper Version: v3.0.0
  • Laravel Version: v10.46.0
  • PHP Version: 8.1.27

Description:

We have a User model including a users table with a column email.
On the User model we only have a mutator which trims and lowercases the value of the email attribute. There is no accessor (get) defined.
Beginning with v3.0.0 of the ide-helper the property is generated with @property-write string $email. But this should be @property string $email.
This applies also to the other way. If we define just an accessor (get) the property is written as @property-read string $email instead of @property string $email

Steps To Reproduce:

Add a attribute mutator to a model without defining the accessor (get).
The other way: add a attribute accessor to a model without defining the mutator (set).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions