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

@@ -16,6 +16,9 @@ use App\Framework\Filesystem\FilePath;
*/
final readonly class ComponentScanner
{
/**
* @param array<string|FilePath> $cssFiles
*/
public function scanComponents(array $cssFiles): ComponentRegistry
{
$components = [];
@@ -41,13 +44,17 @@ final readonly class ComponentScanner
return new ComponentRegistry($components);
}
/**
* @return array<Component>
*/
private function extractComponentsFromCss(string $cssContent, string $filePath): array
{
$components = [];
$processedComponents = [];
// Remove comments
$cssContent = preg_replace('/\/\*.*?\*\//s', '', $cssContent);
$cleanedContent = preg_replace('/\/\*.*?\*\//s', '', $cssContent);
$cssContent = $cleanedContent !== null ? $cleanedContent : $cssContent;
// Find all CSS selectors with improved regex that handles nested braces
preg_match_all('/([^{}]+)\s*{([^{}]*(?:{[^{}]*}[^{}]*)*)}/s', $cssContent, $matches, PREG_SET_ORDER);
@@ -91,8 +98,16 @@ final readonly class ComponentScanner
private function analyzeSelector(string $selector, string $cssRules, string $filePath): ?Component
{
// Clean up selector - remove :where, :is wrappers
$selector = preg_replace('/:where\s*\((.*?)\)/', '$1', $selector);
$selector = preg_replace('/:is\s*\((.*?)\)/', '$1', $selector);
$cleanedSelector = preg_replace('/:where\s*\((.*?)\)/', '$1', $selector);
$selector = $cleanedSelector !== null ? $cleanedSelector : $selector;
$cleanedSelector = preg_replace('/:is\s*\((.*?)\)/', '$1', $selector);
$selector = $cleanedSelector !== null ? $cleanedSelector : $selector;
// Ensure selector is non-empty string
if (empty($selector)) {
return null;
}
// Skip pseudo-elements and certain pseudo-classes
if (preg_match('/::/', $selector) || preg_match('/:not\(/', $selector)) {