private static function colorize(ResultInterface $result, string $text): string
    {
        $colors = [
            Success::class => '%G',
            Disabled::class => '%P',
            Failure::class => '%R',
            Error::class => '%1%w',
            'reset' => '%n',
        ];

        $color = $colors[get_class($result)] ?? $colors['reset'];

        return WP_CLI::colorize($color . $text . '%n');
    }