Created
July 14, 2022 15:49
-
-
Save richardDobron/74e873c9caef5ce6b98a59ac8fff72e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User | |
{ | |
// ... | |
public function hasRole(int $roleId): bool | |
{ | |
return $this->roleId === $roleId; | |
} | |
public function isAnalyst(): bool | |
{ | |
return $this->roleId === 5; | |
} | |
} | |
// ... | |
$user->hasRole(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment