Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForInvalidFakerFormatter PHP Метод

createForInvalidFakerFormatter() публичный статический Метод

public static createForInvalidFakerFormatter ( string $formatter ) : InvalidArgumentException
$formatter string
Результат InvalidArgumentException
    public static function createForInvalidFakerFormatter(string $formatter) : \InvalidArgumentException
    {
        return new \InvalidArgumentException(sprintf('Invalid faker formatter "%s" found.', $formatter));
    }

Usage Example

 private function getGenerator(GeneratorFactory $factory, string $formatter)
 {
     $explodedFormatter = explode(':', $formatter);
     $size = count($explodedFormatter);
     if (1 === $size) {
         return [$factory->getSeedGenerator(), $explodedFormatter[0]];
     }
     if (2 === $size) {
         return [$factory->createOrReturnExistingInstance($explodedFormatter[0]), $explodedFormatter[1]];
     }
     throw InvalidArgumentExceptionFactory::createForInvalidFakerFormatter($formatter);
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\InvalidArgumentExceptionFactory::createForInvalidFakerFormatter