Nelmio\Alice\FixtureBuilder\Denormalizer\Fixture\SpecificationsDenormalizerInterface::denormalize PHP Метод

denormalize() публичный Метод

public denormalize ( Nelmio\Alice\FixtureInterface $fixture, Nelmio\Alice\FixtureBuilder\Denormalizer\FlagParserInterface $parser, array $unparsedSpecs ) : SpecificationBag
$fixture Nelmio\Alice\FixtureInterface Fixture to which the specifications will be "attached to". Indeed some values may be bound to a scope (e.g. unique values). To guarantee the absolute uniqueness of the values, a good thing is to make them relative to their fixtures. So in practice we often pass the fixture being instantiated and will assign it the specifications bags to it later.
$parser Nelmio\Alice\FixtureBuilder\Denormalizer\FlagParserInterface
$unparsedSpecs array
Результат Nelmio\Alice\Definition\SpecificationBag
    public function denormalize(FixtureInterface $fixture, FlagParserInterface $parser, array $unparsedSpecs) : SpecificationBag;

Usage Example

Пример #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))));
 }
SpecificationsDenormalizerInterface