discover(); echo "Discovery completed!\n\n"; // Check if our debug initializer was found $initializerResults = $registry->attributes->get('App\\Framework\\DI\\Initializer'); echo "=== Debug Initializer Results ===\n"; echo "Initializers found: " . count($initializerResults) . "\n\n"; if (! empty($initializerResults)) { foreach ($initializerResults as $mapping) { $className = $mapping->class->getFullyQualified(); $methodName = $mapping->method ? $mapping->method->toString() : '(class-level)'; echo "- {$className}::{$methodName}\n"; if ($mapping->mappedData) { echo " Return Type: " . ($mapping->mappedData['return'] ?? 'null') . "\n"; } } } echo "\n=== Manual Execution Test ===\n"; // Now manually execute the debug initializer to see if it works $container->instance(\App\Framework\DI\Container::class, $container); echo "Creating DebugInitializer...\n"; $debugInitializer = new DebugInitializer($container); echo "Executing void method...\n"; $debugInitializer->debugTest(); echo "Executing service method...\n"; $service = $debugInitializer->debugService(); echo "Service created: " . json_encode($service) . "\n\n"; // Check if log file was created if (file_exists($logFile)) { echo "=== Execution Log ===\n"; echo file_get_contents($logFile); } else { echo "❌ No execution log found\n"; } } catch (Exception $e) { echo "❌ Error: " . $e->getMessage() . "\n"; echo "Stack trace:\n" . $e->getTraceAsString() . "\n"; }