function DevelCommands::token

Same name in this branch
  1. 5.x src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::token()
Same name in other branches
  1. 4.x src/Commands/DevelCommands.php \Drupal\devel\Commands\DevelCommands::token()

List available tokens.

File

src/Drush/Commands/DevelCommands.php, line 221

Class

DevelCommands

Namespace

Drupal\devel\Drush\Commands

Code

public function token($options = [
    'format' => 'table',
]) : RowsOfFields {
    $rows = [];
    $all = $this->token
        ->getInfo();
    foreach ($all['tokens'] as $group => $tokens) {
        foreach ($tokens as $key => $token) {
            $rows[] = [
                'group' => $group,
                'token' => $key,
                'name' => $token['name'],
            ];
        }
    }
    return new RowsOfFields($rows);
}