From d2998e67e94f3af30732d24920f8579fdcb077b4 Mon Sep 17 00:00:00 2001 From: Norbert Orzechowicz Date: Sun, 2 Feb 2025 09:06:15 -0600 Subject: [PATCH] Simplified reading composer.json content in examples --- web/landing/src/Flow/Website/Service/Examples.php | 2 +- web/landing/templates/documentation/example.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/landing/src/Flow/Website/Service/Examples.php b/web/landing/src/Flow/Website/Service/Examples.php index 16bda7966..3a47db1ab 100644 --- a/web/landing/src/Flow/Website/Service/Examples.php +++ b/web/landing/src/Flow/Website/Service/Examples.php @@ -32,7 +32,7 @@ public function composer(string $topic, string $example) : string throw new \RuntimeException(\sprintf('Composer file doesn\'t exists, it should be located in path: "%s".', $path)); } - return json_encode(json_decode(\file_get_contents($path), true, 512, JSON_THROW_ON_ERROR), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); + return \file_get_contents($path); } public function description(string $topic, string $example) : ?string diff --git a/web/landing/templates/documentation/example.html.twig b/web/landing/templates/documentation/example.html.twig index c282038b8..7d2445bb5 100644 --- a/web/landing/templates/documentation/example.html.twig +++ b/web/landing/templates/documentation/example.html.twig @@ -65,7 +65,7 @@ -
{{- composer | escape('html') -}}
+
{{- composer | raw -}}
{% endif %}