Nelmio\Alice\Throwable\Exception\FixtureBuilder\Denormalizer\DenormalizerExceptionFactory::createDenormalizerNotFoundUnexpectedCall PHP Méthode

createDenormalizerNotFoundUnexpectedCall() public static méthode

public static createDenormalizerNotFoundUnexpectedCall ( string $method, integer $code, Throwable $previous = null ) : DenormalizerNotFoundException
$method string
$code integer
$previous Throwable
Résultat DenormalizerNotFoundException
    public static function createDenormalizerNotFoundUnexpectedCall(string $method, int $code = 0, \Throwable $previous = null) : DenormalizerNotFoundException
    {
        return new DenormalizerNotFoundException(sprintf('Expected method "%s" to be called only if it has a denormalizer.', $method), $code, $previous);
    }

Usage Example

 /**
  * @inheritdoc
  */
 public function denormalize(FixtureBag $builtFixtures, string $className, string $fixtureId, array $specs, FlagBag $flags) : FixtureBag
 {
     if (null === $this->denormalizer) {
         throw DenormalizerExceptionFactory::createDenormalizerNotFoundUnexpectedCall(__METHOD__);
     }
     if (null === $this->parser) {
         throw FlagParserExceptionFactory::createForExpectedMethodToBeCalledIfHasAParser(__METHOD__);
     }
     $flags = $this->parser->parse($fixtureId)->mergeWith($flags, false);
     $fixtureId = $flags->getKey();
     /**
      * @var FixtureInterface $tempFixture
      * @var FixtureBag       $builtFixtures
      */
     list($tempFixture, $builtFixtures) = $this->denormalizeTemporaryFixture($builtFixtures, $className, $specs, $flags);
     $fixtureIds = $this->buildIds($fixtureId);
     foreach ($fixtureIds as $fixtureId => $valueForCurrent) {
         $builtFixtures = $builtFixtures->with(new TemplatingFixture(new SimpleFixtureWithFlags(new SimpleFixture($fixtureId, $tempFixture->getClassName(), $tempFixture->getSpecs(), (string) $valueForCurrent), $flags->withKey($fixtureId))));
     }
     return $builtFixtures;
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\FixtureBuilder\Denormalizer\DenormalizerExceptionFactory::createDenormalizerNotFoundUnexpectedCall