#!/usr/bin/env php 0) { echo " Reading discovery cache file..." . PHP_EOL; $content = file_get_contents($file); if (json_decode($content)) { $data = json_decode($content, true); if (isset($data['attributes'])) { $consoleCommands = 0; foreach ($data['attributes'] as $attr) { if (str_contains($attr['attributeClass'] ?? '', 'ConsoleCommand')) { $consoleCommands++; } } echo " ConsoleCommand attributes in cache: $consoleCommands" . PHP_EOL; } } } } } else { echo "Cache directory does not exist!" . PHP_EOL; }