Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[make-entity]Keep the 'is' prefixes for booleans properties setters #1621

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

octoseth
Copy link
Contributor

@octoseth octoseth commented Dec 7, 2024

When generating a new entity, if we name a boolean property with the prefix "is", this prefix is removed to construct the setter.

example:

bool $isInternational;

public function isInternational(): ?bool
{
   return $this->isInternational;
}

public function setInternational(bool $isInternational): static
{
   $this->isInternational = $isInternational;

   return $this;
}

This is breaking when we want to access the property via a form :

[NoSuchPropertyException]
HTTP 500 Internal Server Error
The method "isInternational" in class "App\Entity\Conference" requires 0 arguments, but should accept only 1.. Make the property public, add a setter, or set the "mapped" field option in the form type to be false.

This PR revert this change introduce in PR 1493 to keep the 'is' prefix on the setter.

example :

public function setIsInternational(bool $isInternational): static 
{
    $this->isInternational = $isInternational;

    return $this;
}

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad for #1493 (review)

@kbond
Copy link
Member

kbond commented Dec 10, 2024

Thank you @octoseth.

@kbond kbond merged commit d2b260c into symfony:main Dec 10, 2024
8 of 9 checks passed
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.

3 participants