Commit 6b9221f5 authored by Oleh Vehera's avatar Oleh Vehera
Browse files

Issue #3315520 by voleger, chakkche, apaderno: Fix what reported by phpcs

parent 44b2aa2a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\queue_ui\Commands;

use Drupal\Core\Batch\BatchBuilder;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Queue\QueueWorkerManagerInterface;
use Drupal\queue_ui\QueueUIBatchInterface;
use Drupal\queue_ui\QueueUIManager;
@@ -19,6 +20,8 @@ use Drush\Commands\DrushCommands;
 */
class QueueUiCommands extends DrushCommands {

  use StringTranslationTrait;

  /**
   * Queue worker manager.
   *
@@ -162,7 +165,7 @@ class QueueUiCommands extends DrushCommands {
    // Remove leases.
    $num_updated = $queue_ui->releaseItems($queueName);

    $this->logger()->info(t('@count lease reset in queue @name', [
    $this->logger()->info($this->t('@count lease reset in queue @name', [
      '@count' => $num_updated,
      '@name' => $queueName,
    ]));
@@ -193,7 +196,7 @@ class QueueUiCommands extends DrushCommands {

      // Show a list of all defined queues.
      $queueName = $this->io()
        ->choice(t('Which queue do you want to process?'), $queueNames);
        ->choice($this->t('Which queue do you want to process?'), $queueNames);
    }

    return $queueName;
+4 −2
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
class QueueProcessController implements ContainerInjectionInterface {

  /**
   * The QueueUIBatchInterface.
   *
   * @var \Drupal\queue_ui\QueueUIBatchInterface
   */
  protected $batch;
@@ -30,7 +32,7 @@ class QueueProcessController implements ContainerInjectionInterface {
  }

  /**
   * Process a certain queue
   * Process a certain queue.
   */
  public function process(string $queueName): ?RedirectResponse {
    $this->batch->batch([$queueName]);
@@ -39,7 +41,7 @@ class QueueProcessController implements ContainerInjectionInterface {
  }

  /**
   * Checks access for processing a certain queue
   * Checks access for processing a certain queue.
   */
  public function access(AccountProxyInterface $account, string $queueName): AccessResultInterface {
    return AccessResult::allowedIfHasPermission($account, sprintf('process %s queue', $queueName));
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ class ItemDetailForm extends FormBase {
    return new static(
      $container->get('plugin.manager.queue_ui'),
      $container->get('renderer'),
      $container->get('module_handler'),
      $container->get('module_handler')
    );
  }

+2 −0
Original line number Diff line number Diff line
@@ -81,6 +81,8 @@ class OverviewForm extends FormBase {
  private $queueUIManager;

  /**
   * The QueueUIBatchInterface.
   *
   * @var \Drupal\queue_ui\QueueUIBatchInterface
   */
  protected $queueUiBatch;
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ class QueueUIBatch implements QueueUIBatchInterface {
    $context['finished'] = 0;
    $context['results']['queueName'] = $info['title'];

    $title = t('Processing queue %name: %count items remaining', [
    $title = $this->t('Processing queue %name: %count items remaining', [
      '%name' => $info['title'],
      '%count' => $num_of_items,
    ]);
Loading