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');
    }
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');
    }
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' ) ; }
Colorize a string for output.

@param ResultInterface $result The result instance.
@param string          $text   The text to be printed.

@return string
Colorize a string for output .