Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\VarExporter\VarExporter;

#[AsCommand(name: 'sylius:debug:twig-hooks', description: 'Debug twig hooks configuration.')]

Check failure on line 32 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Class Sylius\TwigHooks\Console\Command\DebugTwigHooksCommand extends unknown class Symfony\Component\Console\Command\Command.
final class DebugTwigHooksCommand extends Command
{
public function __construct(
private readonly HookablesRegistry $hookablesRegistry,
) {
parent::__construct();

Check failure on line 38 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Sylius\TwigHooks\Console\Command\DebugTwigHooksCommand::__construct() calls parent::__construct() but Sylius\TwigHooks\Console\Command\DebugTwigHooksCommand does not extend any class.
}

protected function configure(): void
{
$this

Check failure on line 43 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Call to an undefined method Sylius\TwigHooks\Console\Command\DebugTwigHooksCommand::setDefinition().
->setDefinition([
new InputArgument('name', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'One or more hook names'),
new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show all hookables including disabled ones'),
Expand Down Expand Up @@ -89,7 +89,7 @@
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
{
if ($input->mustSuggestArgumentValuesFor('name')) {
$suggestions->suggestValues($this->hookablesRegistry->getHookNames());
$suggestions->suggestValues(array_values($this->hookablesRegistry->getHookNames()));
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@
if (0 < count($unknownNames)) {
$io->warning(sprintf('Hook(s) not found: "%s".', implode('", "', $unknownNames)));

return Command::SUCCESS;

Check failure on line 121 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Access to constant SUCCESS on an unknown class Symfony\Component\Console\Command\Command.
}

$io->title(implode(', ', $names));
Expand All @@ -128,7 +128,7 @@
$this->displayHookDetails($io, $names, $showAll, $showConfig);
}

return Command::SUCCESS;

Check failure on line 131 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Access to constant SUCCESS on an unknown class Symfony\Component\Console\Command\Command.
}

// Single hook name
Expand All @@ -144,7 +144,7 @@
$this->displayHookDetails($io, [$singleName], $showAll, $showConfig);
}

return Command::SUCCESS;

Check failure on line 147 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Access to constant SUCCESS on an unknown class Symfony\Component\Console\Command\Command.
}

// Partial match (case-insensitive)
Expand All @@ -156,7 +156,7 @@
if (0 === count($filteredHooks)) {
$io->warning(sprintf('No hooks found matching "%s".', $singleName));

return Command::SUCCESS;

Check failure on line 159 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Access to constant SUCCESS on an unknown class Symfony\Component\Console\Command\Command.
}

if (1 === count($filteredHooks)) {
Expand All @@ -168,18 +168,18 @@
$this->displayHookDetails($io, [$firstHook], $showAll, $showConfig);
}

return Command::SUCCESS;

Check failure on line 171 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Access to constant SUCCESS on an unknown class Symfony\Component\Console\Command\Command.
}

$this->displayHooksTable($io, $filteredHooks, $showAll);

return Command::SUCCESS;

Check failure on line 176 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Access to constant SUCCESS on an unknown class Symfony\Component\Console\Command\Command.
}

if (0 === count($registeredHookNames)) {
$io->warning('No hooks registered.');

return Command::SUCCESS;

Check failure on line 182 in src/TwigHooks/src/Console/Command/DebugTwigHooksCommand.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 / Symfony ^8.0

Access to constant SUCCESS on an unknown class Symfony\Component\Console\Command\Command.
}

$this->displayHooksTable($io, $registeredHookNames, $showAll);
Expand Down
Loading