diff --git a/application/src/Source/Generator/AbstractGenerator.php b/application/src/Source/Generator/AbstractGenerator.php deleted file mode 100644 index daf499e..0000000 --- a/application/src/Source/Generator/AbstractGenerator.php +++ /dev/null @@ -1,28 +0,0 @@ -source = $source; - $this->request = $request; - } -} diff --git a/application/src/Source/Generator/SerializeGenerator.php b/application/src/Source/Generator/SerializeGenerator.php deleted file mode 100644 index cb9a969..0000000 --- a/application/src/Source/Generator/SerializeGenerator.php +++ /dev/null @@ -1,36 +0,0 @@ -setCircularReferenceLimit(0); - $normalizer->setCircularReferenceHandler(function ($object) { - return $object->getId(); - }); - $serializer = new Serializer([$normalizer], $encoders); - - return $serializer->serialize($this->source, $this->request->getRequestFormat()); - } -} diff --git a/application/src/Source/Generator/StringGenerator.php b/application/src/Source/Generator/StringGenerator.php deleted file mode 100644 index 531b06d..0000000 --- a/application/src/Source/Generator/StringGenerator.php +++ /dev/null @@ -1,35 +0,0 @@ -twig = $twig; - } - - public function render(): string - { - if (in_array($this->request->getRequestFormat(), SerializeGenerator::SERIALIZABLE_FORMATS)) { - $serializeGenerator = new SerializeGenerator($this->request, $this->source); - - return $serializeGenerator->serialize(); - } - $templateGenerator = new TemplateGenerator($this->request, $this->source, $this->twig); - - return $templateGenerator->render(); - } -} diff --git a/application/src/Source/Generator/TemplateGenerator.php b/application/src/Source/Generator/TemplateGenerator.php deleted file mode 100644 index db6feec..0000000 --- a/application/src/Source/Generator/TemplateGenerator.php +++ /dev/null @@ -1,31 +0,0 @@ -twig = $twig; - } - - public function render(): string - { - $templatePathFactory = new SourceTemplateFactory($this->source, $this->request); - - return $this->twig->render($templatePathFactory->getTemplatePath(), ['source' => $this->source]); - } -}