original_string: 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');
      }
code: 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');
      }
code_tokens: 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' ) ; }
docstring: Colorize a string for output.
  
  @param ResultInterface $result The result instance.
  @param string          $text   The text to be printed.
  
  @return string
docstring_tokens: Colorize a string for output .