public function generate($schema, $className, Context $context)
{
$files = [];
$classes = [];
foreach ($context->getObjectClassMap() as $class) {
$methods = [];
$modelFqdn = $context->getNamespace() . "\\Model\\" . $class->getName();
$methods[] = $this->createSupportsDenormalizationMethod($modelFqdn);
$methods[] = $this->createSupportsNormalizationMethod($modelFqdn);
$methods[] = $this->createDenormalizeMethod($modelFqdn, $context, $class->getProperties());
$methods[] = $this->createNormalizeMethod($modelFqdn, $context, $class->getProperties());
$normalizerClass = $this->createNormalizerClass($class->getName() . 'Normalizer', $methods);
$classes[] = $normalizerClass->name;
$namespace = new Stmt\Namespace_(new Name($context->getNamespace() . "\\Normalizer"), [new Stmt\Use_([new Stmt\UseUse(new Name('Joli\\Jane\\Runtime\\Reference'))]), new Stmt\Use_([new Stmt\UseUse(new Name('Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface'))]), new Stmt\Use_([new Stmt\UseUse(new Name('Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface'))]), new Stmt\Use_([new Stmt\UseUse(new Name('Symfony\\Component\\Serializer\\Normalizer\\SerializerAwareNormalizer'))]), $normalizerClass]);
$files[] = new File($context->getDirectory() . '/Normalizer/' . $class->getName() . 'Normalizer.php', $namespace, self::FILE_TYPE_NORMALIZER);
}
$files[] = new File($context->getDirectory() . '/Normalizer/NormalizerFactory.php', new Stmt\Namespace_(new Name($context->getNamespace() . "\\Normalizer"), [$this->createNormalizerFactoryClass($classes)]), self::FILE_TYPE_NORMALIZER);
return $files;
}