public static function create(int $limit, string $key) : RecursionLimitReachedException
{
return new RecursionLimitReachedException(sprintf('Recursion limit (%d tries) reached while resolving the parameter "%s"', $limit, $key));
}
/** * @throws RecursionLimitReachedException */ private function incrementCounter(int $counter, int $limit, string $parameterKey) : int { if ($counter >= $limit) { throw RecursionLimitReachedExceptionFactory::create($limit, $parameterKey); } return ++$counter; }