create() public static method

public static create ( integer $limit, string $key ) : RecursionLimitReachedException
$limit integer
$key string
return RecursionLimitReachedException
 /**
  * @throws RecursionLimitReachedException
  */
 private function incrementCounter(int $counter, int $limit, string $parameterKey) : int
 {
     if ($counter >= $limit) {
         throw RecursionLimitReachedExceptionFactory::create($limit, $parameterKey);
     }
     return ++$counter;
 }