You are here

class MmmfListCommand in Module Missing Message Fixer 8

Same name and namespace in other branches
  1. 2.0.x src/Commands/MmmfListCommand.php \Drupal\module_missing_message_fixer\Commands\MmmfListCommand

Class MmmfListCommand.

@package Drupal\module_missing_message_fixer

Hierarchy

  • class \Drupal\module_missing_message_fixer\Commands\MmmfListCommand extends \Drush\Commands\DrushCommands

Expanded class hierarchy of MmmfListCommand

1 string reference to 'MmmfListCommand'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses MmmfListCommand
module_missing_message_fixer.list in ./drush.services.yml
\Drupal\module_missing_message_fixer\Commands\MmmfListCommand

File

src/Commands/MmmfListCommand.php, line 14

Namespace

Drupal\module_missing_message_fixer\Commands
View source
class MmmfListCommand extends DrushCommands {

  /**
   * The ModuleMissingMessageFixer service.
   *
   * @var \Drupal\module_missing_message_fixer\ModuleMissingMessageFixer
   */
  protected $fixer;

  /**
   * MmmfFixCommand constructor.
   *
   * @param \Drupal\module_missing_message_fixer\ModuleMissingMessageFixer $mmmf
   *   The CLI service which allows interoperability.
   */
  public function __construct(ModuleMissingMessageFixer $mmmf) {
    $this->fixer = $mmmf;
  }

  /**
   * Returns a list of modules that have missing messages.
   *
   * @command module-missing-message-fixer:list
   *
   * @usage drush module-missing-message-fixer:list
   *   Returns a list of modules that have missing messages.
   *
   * @aliases mmmfl
   *
   * @field-labels
   *   name: Name
   *   type: Type
   */
  public function listCommand() {
    $rows = $this->fixer
      ->getTableRows();
    if (count($rows) > 0) {
      $table[] = $this->fixer
        ->getTableHeader();
      foreach ($rows as $row) {
        $table[] = $row;
      }
      return new RowsOfFields($table);
    }
    $this
      ->output()
      ->writeln('No Missing Modules Found!!!');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MmmfListCommand::$fixer protected property The ModuleMissingMessageFixer service.
MmmfListCommand::listCommand public function Returns a list of modules that have missing messages.
MmmfListCommand::__construct public function MmmfFixCommand constructor.