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: services:
salesforce_mapping.commands: salesforce_mapping.commands:
class: \Drupal\salesforce_mapping\Commands\SalesforceMappingCommands 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: tags:
- { name: drush.command } - { name: drush.command }
...@@ -10,6 +10,8 @@ use Drupal\salesforce\SelectQuery; ...@@ -10,6 +10,8 @@ use Drupal\salesforce\SelectQuery;
use Drush\Exceptions\UserAbortException; use Drush\Exceptions\UserAbortException;
use Symfony\Component\Console\Input\Input; use Symfony\Component\Console\Input\Input;
use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;
/** /**
* A Drush commandfile. * A Drush commandfile.
...@@ -34,6 +36,10 @@ class SalesforceMappingCommands extends SalesforceMappingCommandsBase { ...@@ -34,6 +36,10 @@ class SalesforceMappingCommands extends SalesforceMappingCommandsBase {
* The salesforce.client service. * The salesforce.client service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm * @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
* The entity_type.manager service. * 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 * @param \Drupal\Core\Config\ConfigFactory $configFactory
* The config.factory service. * The config.factory service.
* @param \Drupal\Core\Database\Connection $database * @param \Drupal\Core\Database\Connection $database
...@@ -42,8 +48,8 @@ class SalesforceMappingCommands extends SalesforceMappingCommandsBase { ...@@ -42,8 +48,8 @@ class SalesforceMappingCommands extends SalesforceMappingCommandsBase {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/ */
public function __construct(RestClient $client, EntityTypeManagerInterface $etm, ConfigFactory $configFactory, Connection $database) { public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, ConfigFactory $configFactory, Connection $database) {
parent::__construct($client, $etm); parent::__construct($client, $etm, $auth_man, $token_storage);
$this->database = $database; $this->database = $database;
$this->salesforceConfig = $configFactory->get('salesforce.settings'); $this->salesforceConfig = $configFactory->get('salesforce.settings');
} }
......
...@@ -11,6 +11,8 @@ use Symfony\Component\Console\Output\Output; ...@@ -11,6 +11,8 @@ use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\Commands\SalesforceCommandsBase; use Drupal\salesforce\Commands\SalesforceCommandsBase;
use Drupal\salesforce\Commands\QueryResult; use Drupal\salesforce\Commands\QueryResult;
use Drupal\salesforce\Commands\QueryResultTableFormatter; use Drupal\salesforce\Commands\QueryResultTableFormatter;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;
/** /**
* Shared command base for Salesforce Drush commands. * Shared command base for Salesforce Drush commands.
...@@ -31,6 +33,20 @@ abstract class SalesforceMappingCommandsBase extends SalesforceCommandsBase { ...@@ -31,6 +33,20 @@ abstract class SalesforceMappingCommandsBase extends SalesforceCommandsBase {
*/ */
protected $mappedObjectStorage; 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. * SalesforceMappingCommandsBase constructor.
* *
...@@ -38,12 +54,16 @@ abstract class SalesforceMappingCommandsBase extends SalesforceCommandsBase { ...@@ -38,12 +54,16 @@ abstract class SalesforceMappingCommandsBase extends SalesforceCommandsBase {
* SF client. * SF client.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm * @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
* Entity type manager. * 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\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/ */
public function __construct(RestClient $client, EntityTypeManagerInterface $etm) { public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage) {
parent::__construct($client, $etm); parent::__construct($client, $etm, $auth_man, $token_storage);
$this->mappingStorage = $etm->getStorage('salesforce_mapping'); $this->mappingStorage = $etm->getStorage('salesforce_mapping');
$this->mappedObjectStorage = $etm->getStorage('salesforce_mapped_object'); $this->mappedObjectStorage = $etm->getStorage('salesforce_mapped_object');
......
services: services:
salesforce_pull.commands: salesforce_pull.commands:
class: \Drupal\salesforce_pull\Commands\SalesforcePullCommands 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: tags:
- { name: drush.command } - { name: drush.command }
...@@ -12,6 +12,9 @@ use Drupal\salesforce_mapping\Event\SalesforceQueryEvent; ...@@ -12,6 +12,9 @@ use Drupal\salesforce_mapping\Event\SalesforceQueryEvent;
use Drupal\salesforce_pull\QueueHandler; use Drupal\salesforce_pull\QueueHandler;
use Symfony\Component\Console\Input\Input; use Symfony\Component\Console\Input\Input;
use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;
/** /**
* A Drush commandfile. * A Drush commandfile.
...@@ -47,6 +50,10 @@ class SalesforcePullCommands extends SalesforceMappingCommandsBase { ...@@ -47,6 +50,10 @@ class SalesforcePullCommands extends SalesforceMappingCommandsBase {
* Salesforce client. * Salesforce client.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm * @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
* Entity type manager. * 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 * @param \Drupal\salesforce_pull\QueueHandler $pullQueue
* Pull queue handler service. * Pull queue handler service.
* @param \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $eventDispatcher * @param \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $eventDispatcher
...@@ -55,8 +62,8 @@ class SalesforcePullCommands extends SalesforceMappingCommandsBase { ...@@ -55,8 +62,8 @@ class SalesforcePullCommands extends SalesforceMappingCommandsBase {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/ */
public function __construct(RestClient $client, EntityTypeManagerInterface $etm, QueueHandler $pullQueue, ContainerAwareEventDispatcher $eventDispatcher) { public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, QueueHandler $pullQueue, ContainerAwareEventDispatcher $eventDispatcher) {
parent::__construct($client, $etm); parent::__construct($client, $etm, $auth_man, $token_storage);
$this->pullQueue = $pullQueue; $this->pullQueue = $pullQueue;
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
} }
......
services: services:
salesforce_push.commands: salesforce_push.commands:
class: \Drupal\salesforce_push\Commands\SalesforcePushCommands 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: tags:
- { name: drush.command } - { name: drush.command }
...@@ -9,6 +9,8 @@ use Drupal\salesforce\Rest\RestClient; ...@@ -9,6 +9,8 @@ use Drupal\salesforce\Rest\RestClient;
use Drupal\salesforce_push\PushQueue; use Drupal\salesforce_push\PushQueue;
use Symfony\Component\Console\Input\Input; use Symfony\Component\Console\Input\Input;
use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\Output;
use Drupal\salesforce\SalesforceAuthProviderPluginManagerInterface;
use Drupal\salesforce\Storage\SalesforceAuthTokenStorageInterface;
/** /**
* A Drush commandfile. * A Drush commandfile.
...@@ -44,6 +46,10 @@ class SalesforcePushCommands extends SalesforceMappingCommandsBase { ...@@ -44,6 +46,10 @@ class SalesforcePushCommands extends SalesforceMappingCommandsBase {
* Salesforce service. * Salesforce service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm * @param \Drupal\Core\Entity\EntityTypeManagerInterface $etm
* ETM service. * 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 * @param \Drupal\salesforce_push\PushQueue $pushQueue
* Push queue service. * Push queue service.
* @param \Drupal\Core\Database\Connection $database * @param \Drupal\Core\Database\Connection $database
...@@ -52,8 +58,8 @@ class SalesforcePushCommands extends SalesforceMappingCommandsBase { ...@@ -52,8 +58,8 @@ class SalesforcePushCommands extends SalesforceMappingCommandsBase {
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/ */
public function __construct(RestClient $client, EntityTypeManagerInterface $etm, PushQueue $pushQueue, Connection $database) { public function __construct(RestClient $client, EntityTypeManagerInterface $etm, SalesforceAuthProviderPluginManagerInterface $auth_man, SalesforceAuthTokenStorageInterface $token_storage, PushQueue $pushQueue, Connection $database) {
parent::__construct($client, $etm); parent::__construct($client, $etm, $auth_man, $token_storage);
$this->pushQueue = $pushQueue; $this->pushQueue = $pushQueue;
$this->database = $database; $this->database = $database;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment