Skip to content

Commit

Permalink
Simplified reading composer.json content in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Feb 2, 2025
1 parent 8ae6195 commit d2998e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/landing/src/Flow/Website/Service/Examples.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web/landing/templates/documentation/example.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<button class="absolute top-[12px] right-[12px] bg-orange-100 rounded px-4 leading-9 [&.copied]:before:content-['Copied!'] before:absolute before:-translate-x-20" data-clipboard-target="#composer-json" {{ stimulus_controller('clipboard') }}>
<img src="{{ asset('images/icons/copy.svg') }}" alt="copy composer-json" width="20" height="20" class="inline">
</button>
<pre class="rounded p-4 overflow-auto shadow-2xl shadow-gray rounded border-gray border-2"><code id="composer-json" class="language-json" data-controller="syntax-highlight" >{{- composer | escape('html') -}}</code></pre>
<pre class="rounded p-4 overflow-auto shadow-2xl shadow-gray rounded border-gray border-2"><code id="composer-json" class="language-json" data-controller="syntax-highlight" >{{- composer | raw -}}</code></pre>
</div>
{% endif %}

Expand Down

0 comments on commit d2998e6

Please sign in to comment.