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

createForExpectedConfigurationStringValue() public static method

public static createForExpectedConfigurationStringValue ( $value ) : InvalidArgumentException
return InvalidArgumentException
    public static function createForExpectedConfigurationStringValue($value) : \InvalidArgumentException
    {
        return new \InvalidArgumentException(sprintf('Expected a string value but got "%s" instead.', gettype($value)));
    }

Usage Example

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