Skip to content

Commit

Permalink
Keep the 'is' prefix on a boolean property when making the setter
Browse files Browse the repository at this point in the history
  • Loading branch information
octoseth committed Dec 7, 2024
1 parent ce60831 commit 9fa9221
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/Util/ClassSourceManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,6 @@ private function createSetterNodeBuilder(string $propertyName, $type, bool $isNu

private function getSetterName(string $propertyName, $type): string
{
if ('bool' === $type && 0 === strncasecmp($propertyName, 'is', 2)) {
return 'set'.Str::asCamelCase(substr($propertyName, 2));
}

return 'set'.Str::asCamelCase($propertyName);
}

Expand Down
2 changes: 1 addition & 1 deletion templates/verifyEmail/EmailVerifier.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function handleEmailConfirmation(Request $request, <?= $user_class_name ?
{
$this->verifyEmailHelper->validateEmailConfirmationFromRequest($request, (string) $user-><?= $id_getter ?>(), (string) $user-><?= $email_getter?>());

$user->setVerified(true);
$user->setIsVerified(true);

$this->entityManager->persist($user);
$this->entityManager->flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function getId(): ?int
return $this->id;
}

public function setFooProp(bool $isFooProp): static
public function setIsFooProp(bool $isFooProp): static
{
$this->isFooProp = $isFooProp;

Expand Down

0 comments on commit 9fa9221

Please sign in to comment.