Commit ced19f8f authored by Ivan Duarte's avatar Ivan Duarte Committed by Aaron Bauman
Browse files

Issue #3039549 by jidrone: Drush errors - Too few arguments

parent 26d0796b
Loading
Loading
Loading
Loading
+1 −1
Changes for modules/salesforce_mapping/drush.services.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
services:
  salesforce_mapping.commands:
    class: \Drupal\salesforce_mapping\Commands\SalesforceMappingCommands
    arguments: ['@salesforce.client', '@entity_type.manager', '@config.factory', '@database']
    arguments: ['@salesforce.client', '@entity_type.manager', '@plugin.manager.salesforce.auth_providers', '@salesforce.auth_token_storage', '@config.factory', '@database']
    tags:
      - { name: drush.command }
+8 −2
Changes for modules/salesforce_mapping/src/Commands/SalesforceMappingCommands.php: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ use Drupal\salesforce\SelectQuery;
use Drush\Exceptions\UserAbortException;
use Symfony\Component\Console\Input\Input;
use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;

/**
 * A Drush commandfile.
@@ -34,6 +36,10 @@ class SalesforceMappingCommands extends SalesforceMappingCommandsBase {
   *   The salesforce.client service.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
   *   The entity_type.manager service.
   * @param \Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface $auth_man
   *   Auth plugin manager.
   * @param \Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface $token_storage
   *   Token storage.
   * @param \Drupal\Core\Config\ConfigFactory $configFactory
   *   The config.factory service.
   * @param \Drupal\Core\Database\Connection $database
@@ -42,8 +48,8 @@ class SalesforceMappingCommands extends SalesforceMappingCommandsBase {
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
   */
  public function __construct(RestClient $client, EntityTypeManagerInterface $etm, ConfigFactory $configFactory, Connection $database) {
    parent::__construct($client, $etm);
  public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, ConfigFactory $configFactory, Connection $database) {
    parent::__construct($client, $etm, $auth_man, $token_storage);
    $this->database = $database;
    $this->salesforceConfig = $configFactory->get('salesforce.settings');
  }
+22 −2
Changes for modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php: 22 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\Commands\SalesforceCommandsBase;
use Drupal\salesforce\Commands\QueryResult;
use Drupal\salesforce\Commands\QueryResultTableFormatter;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;

/**
 * Shared command base for Salesforce Drush commands.
@@ -31,6 +33,20 @@ abstract class SalesforceMappingCommandsBase extends SalesforceCommandsBase {
   */
  protected $mappedObjectStorage;

  /**
   * Salesforce Auth Provider plugin manager service.
   *
   * @var \Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface
   */
  protected $authMan;

  /**
   * Salesforce Auth Token Storage service.
   *
   * @var \Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface
   */
  protected $tokenStorage;

  /**
   * SalesforceMappingCommandsBase constructor.
   *
@@ -38,12 +54,16 @@ abstract class SalesforceMappingCommandsBase extends SalesforceCommandsBase {
   *   SF client.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
   *   Entity type manager.
   * @param \Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface $auth_man
   *   Auth plugin manager.
   * @param \Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface $token_storage
   *   Token storage.
   *
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
   */
  public function __construct(RestClient $client, EntityTypeManagerInterface $etm) {
    parent::__construct($client, $etm);
  public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage) {
    parent::__construct($client, $etm, $auth_man, $token_storage);

    $this->mappingStorage = $etm->getStorage('salesforce_mapping');
    $this->mappedObjectStorage = $etm->getStorage('salesforce_mapped_object');
+1 −1
Changes for modules/salesforce_pull/drush.services.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
services:
  salesforce_pull.commands:
    class: \Drupal\salesforce_pull\Commands\SalesforcePullCommands
    arguments: ['@salesforce.client', '@entity_type.manager', '@salesforce_pull.queue_handler', '@event_dispatcher']
    arguments: ['@salesforce.client', '@entity_type.manager', '@plugin.manager.salesforce.auth_providers', '@salesforce.auth_token_storage', '@salesforce_pull.queue_handler', '@event_dispatcher']
    tags:
      - { name: drush.command }
+9 −2
Changes for modules/salesforce_pull/src/Commands/SalesforcePullCommands.php: 9 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,9 @@ use Drupal\salesforce_mapping\Event\SalesforceQueryEvent;
use Drupal\salesforce_pull\QueueHandler;
use Symfony\Component\Console\Input\Input;
use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;


/**
 * A Drush commandfile.
@@ -47,6 +50,10 @@ class SalesforcePullCommands extends SalesforceMappingCommandsBase {
   *   Salesforce client.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
   *   Entity type manager.
   * @param \Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface $auth_man
   *   Auth plugin manager.
   * @param \Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface $token_storage
   *   Token storage.
   * @param \Drupal\salesforce_pull\QueueHandler $pullQueue
   *   Pull queue handler service.
   * @param \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $eventDispatcher
@@ -55,8 +62,8 @@ class SalesforcePullCommands extends SalesforceMappingCommandsBase {
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
   */
  public function __construct(RestClient $client, EntityTypeManagerInterface $etm, QueueHandler $pullQueue, ContainerAwareEventDispatcher $eventDispatcher) {
    parent::__construct($client, $etm);
  public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, QueueHandler $pullQueue, ContainerAwareEventDispatcher $eventDispatcher) {
    parent::__construct($client, $etm, $auth_man, $token_storage);
    $this->pullQueue = $pullQueue;
    $this->eventDispatcher = $eventDispatcher;
  }
Loading