Skip to content

Commit 37f1bef

Browse files
committed
fix: hide full block if no curl command possible
1 parent ec2bcc6 commit 37f1bef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@
233233
</div>
234234
{% endif %}
235235

236-
<h3>Retry command</h3>
237236
{% if collector.curlCommand != '' %}
237+
<h3>Retry command</h3>
238238
<div class="card">
239239
<button class="btn btn-sm hidden" title="Copy as cURL" data-clipboard-text="{{ collector.curlCommand }}">Copy as cURL</button>
240240
<pre class="break-long-words">{{ collector.curlCommand }}</pre>

src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ private function computeCurlCommand(Request $request): ?string
514514
// Add HTTP method
515515
$method = $request->getMethod();
516516

517-
if ($method === Request::METHOD_HEAD) {
517+
if (Request::METHOD_HEAD === $method) {
518518
$command[] = '--head';
519-
} elseif ($method !== Request::METHOD_GET) {
519+
} elseif (Request::METHOD_GET !== $method) {
520520
$command[] = '--request '.$method;
521521
}
522522

0 commit comments

Comments
 (0)