Denormalizes a given value. For example, will denormalize '$username' into a VariableValue.
public denormalize ( Nelmio\Alice\FixtureInterface $scope, |
||
$scope | Nelmio\Alice\FixtureInterface | Used for unique values for example. |
$flags | ||
$value | mixed | |
return | Nelmio\Alice\Definition\ValueInterface | mixed |
/** * {@inheritdoc} * * @throws InvalidScopeException */ public function denormalize(FixtureInterface $scope, FlagBag $flags = null, $value) { $value = $this->denormalizer->denormalize($scope, $flags, $value); if (false === $this->requiresUnique($flags)) { return $value; } return $this->generateValue($scope, $flags, $value); }
/** * @inheritdoc */ public function denormalize(FixtureInterface $scope, FlagParserInterface $parser, array $unparsedArguments) : array { $arguments = []; foreach ($unparsedArguments as $unparsedIndex => $argument) { $argumentFlags = is_string($unparsedIndex) ? $parser->parse($unparsedIndex) : null; $arguments[] = $this->valueDenormalizer->denormalize($scope, $argumentFlags, $argument); } return $arguments; }
/** * @inheritdoc */ public function denormalize(FixtureInterface $scope, string $name, $value, FlagBag $flags) : Property { $value = $this->valueDenormalizer->denormalize($scope, $flags, $value); return new Property($name, $value); }