Refactor findNull to find

This commit is contained in:
James Cole
2021-06-30 06:17:38 +02:00
parent b7ae5eda35
commit 70da5917c9
68 changed files with 120 additions and 273 deletions

View File

@@ -183,7 +183,7 @@ class UserRepository implements UserRepositoryInterface
*
* @return User|null
*/
public function findNull(int $userId): ?User
public function find(int $userId): ?User
{
return User::find($userId);
}
@@ -269,8 +269,6 @@ class UserRepository implements UserRepositoryInterface
*/
public function hasRole(User $user, string $role): bool
{
// See reference nr. 8
/** @var Role $userRole */
foreach ($user->roles as $userRole) {
if ($userRole->name === $role) {