drupalApi = $drupalApi; parent::__construct(); } /** * {@inheritdoc} */ protected function configure() { $this ->setName('debug:roles') ->setDescription($this->trans('commands.debug.roles.description')) ->setAliases(['dusr']); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $roles = $this->drupalApi->getRoles(); $tableHeader = [ $this->trans('commands.debug.roles.messages.role-id'), $this->trans('commands.debug.roles.messages.role-name'), ]; $tableRows = []; foreach ($roles as $roleId => $role) { $tableRows[] = [ $roleId, $role ]; } $this->getIo()->table($tableHeader, $tableRows); } }