Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
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 }
......@@ -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');
}
......
......@@ -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');
......
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 }
......@@ -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;
}
......
services:
salesforce_push.commands:
class: \Drupal\salesforce_push\Commands\SalesforcePushCommands
arguments: ['@salesforce.client', '@entity_type.manager', '@queue.salesforce_push', '@database']
arguments: ['@salesforce.client', '@entity_type.manager', '@plugin.manager.salesforce.auth_providers', '@salesforce.auth_token_storage', '@queue.salesforce_push', '@database']
tags:
- { name: drush.command }
......@@ -9,6 +9,8 @@ use Drupal\salesforce\Rest\RestClient;
use Drupal\salesforce_push\PushQueue;
use Symfony\Component\Console\Input\Input;
use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;
/**
* A Drush commandfile.
......@@ -44,6 +46,10 @@ class SalesforcePushCommands extends SalesforceMappingCommandsBase {
* Salesforce service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
* ETM service.
* @param \Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface $auth_man
* Auth plugin manager.
* @param \Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface $token_storage
* Token storage.
* @param \Drupal\salesforce_push\PushQueue $pushQueue
* Push queue service.
* @param \Drupal\Core\Database\Connection $database
......@@ -52,8 +58,8 @@ class SalesforcePushCommands extends SalesforceMappingCommandsBase {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
public function __construct(RestClient $client, EntityTypeManagerInterface $etm, PushQueue $pushQueue, Connection $database) {
parent::__construct($client, $etm);
public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, PushQueue $pushQueue, Connection $database) {
parent::__construct($client, $etm, $auth_man, $token_storage);
$this->pushQueue = $pushQueue;
$this->database = $database;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment