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

createForExpectedMethodToBeCalledIfHasAParser() public static method

public static createForExpectedMethodToBeCalledIfHasAParser ( string $method ) : FlagParserNotFoundException
$method string
return FlagParserNotFoundException
    public static function createForExpectedMethodToBeCalledIfHasAParser(string $method) : FlagParserNotFoundException
    {
        return new FlagParserNotFoundException(sprintf('Expected method "%s" to be called only if it has a flag parser.', $method));
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function denormalize(FixtureBag $builtFixtures, string $className, string $unparsedFixtureId, array $specs, FlagBag $flags) : FixtureBag
 {
     if (null === $this->flagParser) {
         throw FlagParserExceptionFactory::createForExpectedMethodToBeCalledIfHasAParser(__METHOD__);
     }
     $idFlags = $this->flagParser->parse($unparsedFixtureId);
     $fixture = new SimpleFixture($idFlags->getKey(), $className, new SpecificationBag(null, new PropertyBag(), new MethodCallBag()));
     $fixture = $fixture->withSpecs($this->specsDenormalizer->denormalize($fixture, $this->flagParser, $specs));
     return $builtFixtures->with(new TemplatingFixture(new SimpleFixtureWithFlags($fixture, $idFlags->mergeWith($flags))));
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\FixtureBuilder\Denormalizer\FlagParser\FlagParserExceptionFactory::createForExpectedMethodToBeCalledIfHasAParser