public function serializeValues(ParameterDefinitionCollectionInterface $definitions, array $values, array $fallbackValues = []): Generator
    {
        yield from $fallbackValues;

        foreach ($definitions->getParameterDefinitions() as $parameterDefinition) {
            $parameterName = $parameterDefinition->getName();
            if (!array_key_exists($parameterName, $values)) {
                continue;
            }

            yield $parameterName => $parameterDefinition->getType()->toHash(
                $parameterDefinition,
                $values[$parameterName]
            );

            if ($parameterDefinition instanceof CompoundParameterDefinition) {
                yield from $this->serializeValues($parameterDefinition, $values);
            }
        }
    }