digital-craftsman-de / ids

Id handling with value objects in Symfony
MIT License
5 stars 6 forks source link

Rename parameter $exception to $otherwiseThrow #65

Closed christian-kolb closed 4 months ago

christian-kolb commented 4 months ago

Instead of

$requestingUser->userId->mustNotBeEqualTo(
    $command->targetUserId,
    exception: static fn () => new Exception\UserCanNotTargetItself(),
);

it's better to read:

$requestingUser->userId->mustNotBeEqualTo(
    $command->targetUserId,
    otherwiseThrow: static fn () => new Exception\UserCanNotTargetItself(),
);