fix: resolve RedisCache array offset error and improve discovery diagnostics

- Fix RedisCache driver to handle MGET failures gracefully with fallback
- Add comprehensive discovery context comparison debug tools
- Identify root cause: WEB context discovery missing 166 items vs CLI
- WEB context missing RequestFactory class entirely (52 vs 69 commands)
- Improved exception handling with detailed binding diagnostics
This commit is contained in:
2025-09-12 20:05:18 +02:00
parent 8040d3e7a5
commit e30753ba0e
46990 changed files with 10789682 additions and 89639 deletions

View File

@@ -13,6 +13,7 @@ use Traversable;
/**
* Value Object für die Verwaltung von Console Commands
* @implements IteratorAggregate<string, ConsoleCommand>
*/
final readonly class CommandList implements IteratorAggregate, Countable
{
@@ -74,11 +75,17 @@ final readonly class CommandList implements IteratorAggregate, Countable
return $this->commands[$name];
}
/**
* @return array<int, string>
*/
public function getNames(): array
{
return array_keys($this->commands);
}
/**
* @return array<int, string>
*/
public function findSimilar(string $name, int $maxDistance = 3): array
{
$suggestions = [];
@@ -103,6 +110,9 @@ final readonly class CommandList implements IteratorAggregate, Countable
return new ArrayIterator($this->commands);
}
/**
* @return array<string, ConsoleCommand>
*/
public function toArray(): array
{
return $this->commands;

View File

@@ -47,6 +47,9 @@ final readonly class CommandRegistry
return $this->discoveredAttributes[$commandName];
}
/**
* @param array<int, string> $arguments
*/
public function executeCommand(string $commandName, array $arguments, ConsoleOutputInterface $output): ExitCode
{
$command = $this->commandList->get($commandName);

View File

@@ -11,8 +11,6 @@ use App\Framework\DI\Container;
use App\Framework\Discovery\Results\DiscoveryRegistry;
use App\Framework\Exception\ErrorCode;
use App\Framework\Exception\FrameworkException;
use ReflectionClass;
use ReflectionMethod;
use Throwable;
final class ConsoleApplication
@@ -110,33 +108,6 @@ final class ConsoleApplication
}
}
/**
* Registriert alle Kommandos aus einer Klasse
*/
public function registerCommands(object $commandClass): void
{
$reflection = new ReflectionClass($commandClass);
foreach ($reflection->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
$attributes = $method->getAttributes(ConsoleCommand::class);
foreach ($attributes as $attribute) {
/** @var ConsoleCommand $command */
$command = $attribute->newInstance();
$this->commands[$command->name] = [
'instance' => $commandClass,
'method' => $method->getName(),
'description' => $command->description,
'reflection' => $method,
];
}
}
}
/**
* Führt ein Kommando aus
*/
/**
* Führt ein Kommando aus
* @param array<int, string> $argv