Nelmio\Alice\FixtureBuilder\Denormalizer\Fixture\Chainable\SimpleCollectionDenormalizer::denormalizeFixture PHP Method

denormalizeFixture() private final method

private final denormalizeFixture ( FixtureBag $builtFixtures, string $className, string $fixtureId, array $specs, FlagBag $flags, string $valueForCurrent ) : FixtureBag
$builtFixtures Nelmio\Alice\FixtureBag
$className string
$fixtureId string
$specs array
$flags Nelmio\Alice\Definition\FlagBag
$valueForCurrent string
return Nelmio\Alice\FixtureBag
    private final function denormalizeFixture(FixtureBag $builtFixtures, string $className, string $fixtureId, array $specs, FlagBag $flags, string $valueForCurrent) : FixtureBag
    {
        $builtFixtures = $this->denormalizer->denormalize($builtFixtures, $className, $fixtureId, $specs, $flags);
        // At this point we remove the denormalized fixture to re-create a new one with this time its value for current
        // set. The process is a bit awkward, but this is due to the fact that the value for current cannot be passed
        // to the decorated denormalizers in a simple way.
        $builtFixture = $builtFixtures->get($fixtureId);
        $builtFixtures = $builtFixtures->without($builtFixture);
        return $builtFixtures->with(new TemplatingFixture(new SimpleFixtureWithFlags(new SimpleFixture($fixtureId, $builtFixture->getClassName(), $builtFixture->getSpecs(), $valueForCurrent), $flags->withKey($fixtureId))));
    }