getFullyQualified() . PHP_EOL; echo "File path: " . $filePath->toString() . PHP_EOL; try { // Visit the class to discover attributes $visitor->visitClass($className, $context); // Get the discovered attributes $registry = $visitor->getRegistry(); $consoleCommands = $registry->get('App\\Framework\\Console\\ConsoleCommand'); echo "ConsoleCommand attributes found: " . count($consoleCommands) . PHP_EOL; if (! empty($consoleCommands)) { foreach ($consoleCommands as $i => $command) { echo "Command $i:" . PHP_EOL; echo " Class: " . $command->className->getFullyQualified() . PHP_EOL; echo " Method: " . ($command->methodName?->toString() ?? 'unknown') . PHP_EOL; echo " Arguments: " . json_encode($command->arguments) . PHP_EOL; $instance = $command->createAttributeInstance(); if ($instance) { echo " Name: " . $instance->name . PHP_EOL; echo " Description: " . $instance->description . PHP_EOL; } } } else { echo "❌ No ConsoleCommand attributes found!" . PHP_EOL; // Check what attributes were found $allTypes = $registry->getAllTypes(); echo "Available attribute types: " . count($allTypes) . PHP_EOL; foreach ($allTypes as $type) { $count = $registry->getCount($type); echo " - $type: $count" . PHP_EOL; } } echo "Total attributes discovered: " . $registry->count() . PHP_EOL; } catch (Exception $e) { echo "❌ Error during discovery: " . $e->getMessage() . PHP_EOL; echo "Stack trace: " . $e->getTraceAsString() . PHP_EOL; }