Skip to content

Commit

Permalink
[Twig Hooks] Fix the debug panel
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Apr 24, 2024
1 parent da72e2b commit a1c6ff8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Sylius\TwigHooks\Profiler\Dumper;

use Sylius\TwigHooks\Hookable\HookableComponent;
use Sylius\TwigHooks\Hookable\HookableTemplate;
use Sylius\TwigHooks\Profiler\HookableProfile;
use Sylius\TwigHooks\Profiler\HookProfile;
use Sylius\TwigHooks\Profiler\Profile;
Expand Down Expand Up @@ -48,14 +50,19 @@ private function dumpHookProfile(HookProfile $hookProfile, string $prefix = '',

private function dumpHookableProfile(HookableProfile $hookableProfile, string $prefix = '', bool $sibling = false): string
{
list($targetName, $targetValue) = match (get_class($hookableProfile->getHookable())) {

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.1 / Symfony ^5.4)

Cannot use array destructuring on string.

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.1 / Symfony ^5.4)

Match expression does not handle remaining value: class-string<Sylius\TwigHooks\Hookable\AbstractHookable>

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.1 / Symfony ^6.4)

Cannot use array destructuring on string.

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.1 / Symfony ^6.4)

Match expression does not handle remaining value: class-string<Sylius\TwigHooks\Hookable\AbstractHookable>

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.2 / Symfony ^5.4)

Cannot use array destructuring on string.

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.2 / Symfony ^5.4)

Match expression does not handle remaining value: class-string<Sylius\TwigHooks\Hookable\AbstractHookable>

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.2 / Symfony ^6.4)

Cannot use array destructuring on string.

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.2 / Symfony ^6.4)

Match expression does not handle remaining value: class-string<Sylius\TwigHooks\Hookable\AbstractHookable>

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.3 / Symfony ^5.4)

Cannot use array destructuring on string.

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.3 / Symfony ^5.4)

Match expression does not handle remaining value: class-string<Sylius\TwigHooks\Hookable\AbstractHookable>

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.3 / Symfony ^6.4)

Cannot use array destructuring on string.

Check failure on line 53 in src/TwigHooks/src/Profiler/Dumper/HtmlDumper.php

View workflow job for this annotation

GitHub Actions / Continuous Integration (PHP 8.3 / Symfony ^6.4)

Match expression does not handle remaining value: class-string<Sylius\TwigHooks\Hookable\AbstractHookable>
HookableTemplate::class => 'Template',
HookableComponent::class => 'Component',
};

$str = sprintf(
'%s└ <span><span class="status-success">(%s)</span> [↑ %d, ⏲ %d ms] %s (%s)</span>',
$prefix,
ucfirst($hookableProfile->getHookable()->getType()),
$hookableProfile->getHookable()->getPriority(),
$targetName,
$hookableProfile->getHookable()->priority(),
$hookableProfile->getDuration(),
$hookableProfile->getName(),
$hookableProfile->getHookable()->target,
$targetValue,
);
$str .= PHP_EOL;
$prefix .= $sibling ? '' : ' ';
Expand Down

0 comments on commit a1c6ff8

Please sign in to comment.