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

createForExpectedConfigurationPositiveIntegerValue() public static method

public static createForExpectedConfigurationPositiveIntegerValue ( integer $value ) : InvalidArgumentException
$value integer
return InvalidArgumentException
    public static function createForExpectedConfigurationPositiveIntegerValue(int $value) : \InvalidArgumentException
    {
        return new \InvalidArgumentException(sprintf('Expected a strictly positive integer but got "%s" instead.', $value));
    }

Usage Example

 public function testTestCreateForExpectedConfigurationPositiveIntegerValue()
 {
     $exception = InvalidArgumentExceptionFactory::createForExpectedConfigurationPositiveIntegerValue(-1);
     $this->assertEquals('Expected a strictly positive integer but got "-1" instead.', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForExpectedConfigurationPositiveIntegerValue