Commit d2b260c
committed
bug #1621 [make-entity]Keep the 'is' prefixes for booleans properties setters (octoseth)
This PR was merged into the 1.x-dev branch.
Discussion
----------
[make-entity]Keep the 'is' prefixes for booleans properties setters
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](#1493) to keep the 'is' prefix on the setter.
example :
```
public function setIsInternational(bool $isInternational): static
{
$this->isInternational = $isInternational;
return $this;
}
```
Commits
-------
9fa9221 Keep the 'is' prefix on a boolean property when making the setterFile tree
3 files changed
+2
-6
lines changed- src/Util
- templates/verifyEmail
- tests/Util/fixtures/add_setter
3 files changed
+2
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | 488 | | |
493 | 489 | | |
494 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments