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

@@ -1,9 +1,15 @@
<?php
declare(strict_types=1);
namespace App\Framework\Logging\Formatter;
final class LineFormatter
{
use App\Framework\Logging\LogRecord;
final readonly class LineFormatter implements LogFormatter
{
public function __invoke(LogRecord $record): string
{
return 'LogFormatter: ' . $record->getMessage();
}
}

View File

@@ -1,8 +1,15 @@
<?php
declare(strict_types=1);
namespace App\Framework\Logging\Formatter;
use App\Framework\Logging\LogRecord;
interface LogFormatter
{
/**
* @return string|array<string, mixed>
*/
public function __invoke(LogRecord $record): string|array;
}

View File

@@ -37,10 +37,10 @@ class ConsoleHandler implements LogHandler
* @param string $outputFormat Format für die Ausgabe
*/
public function __construct(
LogLevel|int $minLevel = LogLevel::DEBUG,
bool $debugOnly = true,
string $outputFormat = '{color}[{level_name}]{reset} {timestamp} {request_id}{message}',
private LogLevel $stderrLevel = LogLevel::WARNING,
LogLevel|int $minLevel = LogLevel::DEBUG,
bool $debugOnly = true,
string $outputFormat = '{color}[{level_name}]{reset} {timestamp} {request_id}{message}',
private readonly LogLevel $stderrLevel = LogLevel::WARNING,
) {
$this->minLevel = $minLevel instanceof LogLevel ? $minLevel : LogLevel::fromValue($minLevel);
$this->debugOnly = $debugOnly;

View File

@@ -8,11 +8,11 @@ use App\Framework\Logging\LogHandler;
use App\Framework\Logging\LogLevel;
use App\Framework\Logging\LogRecord;
final class WebHandler implements LogHandler
final readonly class WebHandler implements LogHandler
{
public function __construct(
private readonly LogLevel $minLevel = LogLevel::DEBUG,
private readonly bool $debugOnly = true
private LogLevel $minLevel = LogLevel::DEBUG,
private bool $debugOnly = true
) {
}

View File

@@ -71,4 +71,33 @@ enum LogLevel: int
default => self::DEBUG,
};
}
public function isHigherThan(self $level): bool
{
return $this->value > $level->value;
}
public function isLowerThan(self $level): bool
{
return $this->value < $level->value;
}
public function isEqual(self $level): bool
{
return $this->value === $level->value;
}
public function toRFC5424(): int
{
return match($this) {
self::DEBUG => 7,
self::INFO => 6,
self::NOTICE => 5,
self::WARNING => 4,
self::ERROR => 3,
self::CRITICAL => 2,
self::ALERT => 1,
self::EMERGENCY => 0,
};
}
}