#!/usr/bin/env php getMethods(); echo "Methods found: " . count($methods) . PHP_EOL; foreach ($methods as $method) { echo "Method: " . $method->getName() . PHP_EOL; // Get all attributes $allAttributes = $method->getAttributes(); echo " All attributes: " . count($allAttributes) . PHP_EOL; foreach ($allAttributes as $attr) { echo " Attribute: " . $attr->getName() . PHP_EOL; } // Get specific ConsoleCommand attributes $consoleAttributes = $method->getAttributes(ConsoleCommand::class); echo " ConsoleCommand attributes: " . count($consoleAttributes) . PHP_EOL; if (!empty($consoleAttributes)) { $instance = $consoleAttributes[0]->newInstance(); echo " Name: " . $instance->name . PHP_EOL; echo " Description: " . $instance->description . PHP_EOL; } echo PHP_EOL; } } catch (Exception $e) { echo "Error: " . $e->getMessage() . PHP_EOL; echo "Trace: " . $e->getTraceAsString() . PHP_EOL; }