strategies as $strategy) { try { return $strategy->authenticate(); } catch (Exception) { continue; } } throw new InvalidUserException('No valid authentication method found'); } }