supervisorId(); if ($supervisorId === null) { return; } $supervisor = $this->users->findById($supervisorId); if ($supervisor === null || $supervisor->id() === $user->id() || ! $supervisor->isActive() || ! $supervisor->role()->canSupervise()) { throw new InvalidSupervisor; } } }