#!/usr/bin/env php getMethods(); echo "Methods in DemoCommand: " . count($methods) . PHP_EOL; foreach ($methods as $method) { $attributes = $method->getAttributes(ConsoleCommand::class); if (!empty($attributes)) { echo "Found ConsoleCommand attribute on method: " . $method->getName() . PHP_EOL; $attribute = $attributes[0]->newInstance(); echo " Command name: " . $attribute->name . PHP_EOL; echo " Description: " . $attribute->description . PHP_EOL; } } } catch (Exception $e) { echo "Error: " . $e->getMessage() . PHP_EOL; echo "Trace: " . $e->getTraceAsString() . PHP_EOL; }