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

createForRedundantUniqueValue() public static method

public static createForRedundantUniqueValue ( string $id ) : InvalidArgumentException
$id string
return InvalidArgumentException
    public static function createForRedundantUniqueValue(string $id) : \InvalidArgumentException
    {
        return new \InvalidArgumentException(sprintf('Cannot create a unique value of a unique value for value "%s".', $id));
    }

Usage Example

 public function testTestCreateForRedundantUniqueValue()
 {
     $exception = InvalidArgumentExceptionFactory::createForRedundantUniqueValue('foo');
     $this->assertEquals('Cannot create a unique value of a unique value for value "foo".', $exception->getMessage());
     $this->assertEquals(0, $exception->getCode());
     $this->assertNull($exception->getPrevious());
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForRedundantUniqueValue