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

@@ -32,7 +32,7 @@ final readonly class BatchController
{
try {
// Validate content type
$contentType = $request->headers->getFirst('Content-Type', '');
$contentType = $request->headers->getFirst('Content-Type') ?? '';
if (! str_contains($contentType, 'application/json')) {
return $this->errorResponse(
'Content-Type must be application/json',

View File

@@ -123,7 +123,7 @@ final readonly class QrCodeController
return new HttpResponse(
status : Status::BAD_REQUEST,
headers: new Headers(['Content-Type' => 'application/json']),
body : json_encode(['error' => 'TOTP URI parameter is required'])
body : json_encode(['error' => 'TOTP URI parameter is required']) ?: '{"error":"Encoding failed"}'
);
}
@@ -139,7 +139,7 @@ final readonly class QrCodeController
return new HttpResponse(
status : Status::BAD_REQUEST,
headers: new Headers(['Content-Type' => 'application/json']),
body : json_encode(['error' => $e->getMessage()])
body : json_encode(['error' => $e->getMessage()]) ?: '{"error":"Encoding failed"}'
);
}
}

View File

@@ -40,7 +40,7 @@ final readonly class BatchExampleController
return new HttpResponse(
status: Status::OK,
headers: new Headers(['Content-Type' => 'application/json']),
body: $this->jsonSerializer->serialize($user, JsonSerializerConfig::pretty())
body: $this->jsonSerializer->serializeWithConfig($user, JsonSerializerConfig::pretty())
);
}
@@ -53,7 +53,7 @@ final readonly class BatchExampleController
return new HttpResponse(
status: Status::BAD_REQUEST,
headers: new Headers(['Content-Type' => 'application/json']),
body: $this->jsonSerializer->serialize(['error' => 'Title is required'])
body: $this->jsonSerializer->serializeWithConfig(['error' => 'Title is required'], JsonSerializerConfig::compact())
);
}
@@ -68,7 +68,7 @@ final readonly class BatchExampleController
return new HttpResponse(
status: Status::CREATED,
headers: new Headers(['Content-Type' => 'application/json']),
body: $this->jsonSerializer->serialize($post, JsonSerializerConfig::pretty())
body: $this->jsonSerializer->serializeWithConfig($post, JsonSerializerConfig::pretty())
);
}
@@ -82,7 +82,7 @@ final readonly class BatchExampleController
return new HttpResponse(
status: Status::BAD_REQUEST,
headers: new Headers(['Content-Type' => 'application/json']),
body: $this->jsonSerializer->serialize(['error' => 'Invalid JSON data'])
body: $this->jsonSerializer->serializeWithConfig(['error' => 'Invalid JSON data'], JsonSerializerConfig::compact())
);
}
@@ -96,7 +96,7 @@ final readonly class BatchExampleController
return new HttpResponse(
status: Status::OK,
headers: new Headers(['Content-Type' => 'application/json']),
body: $this->jsonSerializer->serialize($post, JsonSerializerConfig::pretty())
body: $this->jsonSerializer->serializeWithConfig($post, JsonSerializerConfig::pretty())
);
}
@@ -123,7 +123,7 @@ final readonly class BatchExampleController
return new HttpResponse(
status: Status::OK,
headers: new Headers(['Content-Type' => 'application/json']),
body: $this->jsonSerializer->serialize([
body: $this->jsonSerializer->serializeWithConfig([
'message' => 'Slow operation completed',
'delay' => $maxDelay,
'timestamp' => $this->clock->now()->format('Y-m-d H:i:s'),