Nelmio\Alice\Throwable\Exception\FixtureBuilder\Denormalizer\FlagParser\FlagParserExceptionFactory::createForNoParserFoundForElement PHP Method

createForNoParserFoundForElement() public static method

public static createForNoParserFoundForElement ( string $element ) : FlagParserNotFoundException
$element string
return FlagParserNotFoundException
    public static function createForNoParserFoundForElement(string $element) : FlagParserNotFoundException
    {
        return new FlagParserNotFoundException(sprintf('No suitable flag parser found to handle the element "%s".', $element));
    }

Usage Example

Example #1
0
 /**
  * @inheritdoc
  */
 public function parse(string $element) : FlagBag
 {
     foreach ($this->parsers as $parser) {
         if ($parser->canParse($element)) {
             return $parser->parse($element);
         }
     }
     throw FlagParserExceptionFactory::createForNoParserFoundForElement($element);
 }