From 54a2a6a19c0ee8995cabf18dc5e9bbf9a10ca0da Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 16 Sep 2018 18:00:11 +0200 Subject: [PATCH] Removed deprecated code --- .../Source/Generator/AbstractGenerator.php | 28 --------------- .../Source/Generator/SerializeGenerator.php | 36 ------------------- .../src/Source/Generator/StringGenerator.php | 35 ------------------ .../Source/Generator/TemplateGenerator.php | 31 ---------------- 4 files changed, 130 deletions(-) delete mode 100644 application/src/Source/Generator/AbstractGenerator.php delete mode 100644 application/src/Source/Generator/SerializeGenerator.php delete mode 100644 application/src/Source/Generator/StringGenerator.php delete mode 100644 application/src/Source/Generator/TemplateGenerator.php 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]); - } -}