Skip to content
Snippets Groups Projects
Commit d8bb8c1b authored by Dave Reid's avatar Dave Reid
Browse files

Issue #3407086 by Dave Reid: Update Drush commands to be compatible with Drush 12+.

parent 788cfa3e
No related branches found
No related tags found
No related merge requests found
services:
features.commands:
class: \Drupal\features\Commands\FeaturesCommands
class: Drupal\features\Drush\Commands\FeaturesCommands
arguments:
- '@features_assigner'
- '@features.manager'
......
<?php
namespace Drupal\features\Commands;
namespace Drupal\features\Drush\Commands;
use Consolidation\OutputFormatters\StructuredData\RowsOfFields;
use Drupal\Component\Diff\DiffFormatter;
use Drupal\config_update\ConfigDiffInterface;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\features\Exception\DomainException;
use Drupal\features\Exception\InvalidArgumentException;
use Drupal\features\FeaturesAssignerInterface;
......@@ -16,11 +17,12 @@ use Drupal\features\Plugin\FeaturesGeneration\FeaturesGenerationWrite;
use Drush\Commands\DrushCommands;
use Drush\Exceptions\UserAbortException;
use Drush\Utils\StringUtils;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Drush commands for Features.
*/
class FeaturesCommands extends DrushCommands {
class FeaturesCommands extends DrushCommands implements ContainerInjectionInterface {
const OPTIONS = [
'bundle' => NULL,
......@@ -104,13 +106,7 @@ class FeaturesCommands extends DrushCommands {
* @param \Drupal\Core\Config\StorageInterface $configStorage
* The config.storage service.
*/
public function __construct(
FeaturesAssignerInterface $assigner,
FeaturesManagerInterface $manager,
FeaturesGeneratorInterface $generator,
ConfigDiffInterface $configDiff,
StorageInterface $configStorage
) {
public function __construct(FeaturesAssignerInterface $assigner, FeaturesManagerInterface $manager, FeaturesGeneratorInterface $generator, ConfigDiffInterface $configDiff, StorageInterface $configStorage) {
parent::__construct();
$this->assigner = $assigner;
$this->configDiff = $configDiff;
......@@ -119,6 +115,19 @@ class FeaturesCommands extends DrushCommands {
$this->manager = $manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('features_assigner'),
$container->get('features.manager'),
$container->get('features_generator'),
$container->get('config_update.config_diff'),
$container->get('config.storage')
);
}
/**
* Applies global options for Features drush commands, including the bundle.
*
......
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