Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForInvalidLimitValueForRecursiveCalls PHP Method

createForInvalidLimitValueForRecursiveCalls() public static method

public static createForInvalidLimitValueForRecursiveCalls ( integer $limit ) : InvalidArgumentException
$limit integer
return InvalidArgumentException
    public static function createForInvalidLimitValueForRecursiveCalls(int $limit) : \InvalidArgumentException
    {
        return new \InvalidArgumentException(sprintf('Expected limit for recursive calls to be of at least 2. Got "%d" instead.', $limit));
    }

Usage Example

 public function __construct(ChainableParameterResolverInterface $resolver, int $limit = 5)
 {
     $this->resolver = $resolver;
     if (2 >= $limit) {
         throw InvalidArgumentExceptionFactory::createForInvalidLimitValueForRecursiveCalls($limit);
     }
     $this->limit = $limit;
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForInvalidLimitValueForRecursiveCalls