private static function unregisterCommand(CommandMap $map, $name) { $cmd = $map->getCommand($name); if ($cmd instanceof Command) { $cmd->setLabel($name . "_deprecated"); $cmd->unregister($map); return true; } return false; }