Skip to content

Commit 9fa9221

Browse files
committed
Keep the 'is' prefix on a boolean property when making the setter
1 parent ce60831 commit 9fa9221

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

src/Util/ClassSourceManipulator.php

-4
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,6 @@ private function createSetterNodeBuilder(string $propertyName, $type, bool $isNu
485485

486486
private function getSetterName(string $propertyName, $type): string
487487
{
488-
if ('bool' === $type && 0 === strncasecmp($propertyName, 'is', 2)) {
489-
return 'set'.Str::asCamelCase(substr($propertyName, 2));
490-
}
491-
492488
return 'set'.Str::asCamelCase($propertyName);
493489
}
494490

templates/verifyEmail/EmailVerifier.tpl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function handleEmailConfirmation(Request $request, <?= $user_class_name ?
4343
{
4444
$this->verifyEmailHelper->validateEmailConfirmationFromRequest($request, (string) $user-><?= $id_getter ?>(), (string) $user-><?= $email_getter?>());
4545

46-
$user->setVerified(true);
46+
$user->setIsVerified(true);
4747

4848
$this->entityManager->persist($user);
4949
$this->entityManager->flush();

tests/Util/fixtures/add_setter/User_bool_begins_with_is.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function getId(): ?int
1717
return $this->id;
1818
}
1919

20-
public function setFooProp(bool $isFooProp): static
20+
public function setIsFooProp(bool $isFooProp): static
2121
{
2222
$this->isFooProp = $isFooProp;
2323

0 commit comments

Comments
 (0)