diff --git a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiKeys.php b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiKeys.php index 5ca89eea2..9e29fc40e 100644 --- a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiKeys.php +++ b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiKeys.php @@ -25,34 +25,6 @@ * ) */ class HeadlessApiKeys extends AcquiaCmsDashboardBase { - /** - * The state interface. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - - /** - * The module handler. - * - * @var \Drupal\Core\Extension\ModuleHandlerInterface - */ - protected $moduleHandler; - - /** - * The link generator. - * - * @var \Drupal\Core\Utility\LinkGeneratorInterface - */ - protected $linkGenerator; - - /** - * The info file parser. - * - * @var \Drupal\Core\Extension\InfoParserInterface - */ - protected $infoParser; /** * The EntityTypeManager service. @@ -75,27 +47,15 @@ class HeadlessApiKeys extends AcquiaCmsDashboardBase { */ protected $module = 'consumers'; - /** - * {@inheritdoc} - */ - public function __construct(StateInterface $state, ModuleHandlerInterface $module_handler, LinkGeneratorInterface $link_generator, InfoParserInterface $info_parser, EntityTypeManagerInterface $entity_type_manager, StarterkitNextjsService $starterkit_nextjs_service) { - parent::__construct($state, $module_handler, $link_generator, $info_parser); - $this->entityTypeManager = $entity_type_manager; - $this->starterKitNextjsService = $starterkit_nextjs_service; - } - /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static( - $container->get('state'), - $container->get('module_handler'), - $container->get('link_generator'), - $container->get('info_parser'), - $container->get('entity_type.manager'), - $container->get('acquia_cms_headless.starterkit_nextjs') - ); + $instance = parent::create($container); + $instance->entityTypeManager = $container->get('entity_type.manager'); + $instance->starterKitNextjsService = $container->get('acquia_cms_headless.starterkit_nextjs'); + + return $instance; } /** diff --git a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiUsers.php b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiUsers.php index 4c0ae9378..ca85797d1 100644 --- a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiUsers.php +++ b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessApiUsers.php @@ -24,34 +24,6 @@ * ) */ class HeadlessApiUsers extends AcquiaCmsDashboardBase { - /** - * The state interface. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - - /** - * The module handler. - * - * @var \Drupal\Core\Extension\ModuleHandlerInterface - */ - protected $moduleHandler; - - /** - * The link generator. - * - * @var \Drupal\Core\Utility\LinkGeneratorInterface - */ - protected $linkGenerator; - - /** - * The info file parser. - * - * @var \Drupal\Core\Extension\InfoParserInterface - */ - protected $infoParser; /** * The EntityTypeManager service. @@ -81,28 +53,16 @@ class HeadlessApiUsers extends AcquiaCmsDashboardBase { */ protected $headlessRoleLabel; - /** - * {@inheritdoc} - */ - public function __construct(StateInterface $state, ModuleHandlerInterface $module_handler, LinkGeneratorInterface $link_generator, InfoParserInterface $info_parser, EntityTypeManagerInterface $entity_type_manager, StarterkitNextjsService $starterkit_nextjs_service) { - parent::__construct($state, $module_handler, $link_generator, $info_parser); - $this->entityTypeManager = $entity_type_manager; - $this->headlessRoleLabel = $entity_type_manager->getStorage('user_role')->load('headless')->label(); - $this->starterKitNextjsService = $starterkit_nextjs_service; - } - /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static( - $container->get('state'), - $container->get('module_handler'), - $container->get('link_generator'), - $container->get('info_parser'), - $container->get('entity_type.manager'), - $container->get('acquia_cms_headless.starterkit_nextjs') - ); + $instance = parent::create($container); + $instance->entityTypeManager = $container->get('entity_type.manager'); + $instance->starterKitNextjsService = $container->get('acquia_cms_headless.starterkit_nextjs'); + $instance->headlessRoleLabel = $instance->entityTypeManager->getStorage('user_role')->load('headless')->label(); + + return $instance; } /** diff --git a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextEntityTypes.php b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextEntityTypes.php index 5ab3decdf..e931a6788 100644 --- a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextEntityTypes.php +++ b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextEntityTypes.php @@ -24,34 +24,6 @@ * ) */ class HeadlessNextEntityTypes extends AcquiaCmsDashboardBase { - /** - * The state interface. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - - /** - * The module handler. - * - * @var \Drupal\Core\Extension\ModuleHandlerInterface - */ - protected $moduleHandler; - - /** - * The link generator. - * - * @var \Drupal\Core\Utility\LinkGeneratorInterface - */ - protected $linkGenerator; - - /** - * The info file parser. - * - * @var \Drupal\Core\Extension\InfoParserInterface - */ - protected $infoParser; /** * The EntityTypeManager service. @@ -74,27 +46,15 @@ class HeadlessNextEntityTypes extends AcquiaCmsDashboardBase { */ protected $module = 'next'; - /** - * {@inheritdoc} - */ - public function __construct(StateInterface $state, ModuleHandlerInterface $module_handler, LinkGeneratorInterface $link_generator, InfoParserInterface $info_parser, EntityTypeManagerInterface $entity_type_manager, StarterkitNextjsService $starterKitNextjsService) { - parent::__construct($state, $module_handler, $link_generator, $info_parser); - $this->entityTypeManager = $entity_type_manager; - $this->starterKitNextjsService = $starterKitNextjsService; - } - /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static( - $container->get('state'), - $container->get('module_handler'), - $container->get('link_generator'), - $container->get('info_parser'), - $container->get('entity_type.manager'), - $container->get('acquia_cms_headless.starterkit_nextjs') - ); + $instance = parent::create($container); + $instance->entityTypeManager = $container->get('entity_type.manager'); + $instance->starterKitNextjsService = $container->get('acquia_cms_headless.starterkit_nextjs'); + + return $instance; } /** diff --git a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextSites.php b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextSites.php index 9085a23be..8cedd0870 100644 --- a/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextSites.php +++ b/modules/acquia_cms_headless/src/Plugin/AcquiaCmsHeadless/HeadlessNextSites.php @@ -26,41 +26,6 @@ * ) */ class HeadlessNextSites extends AcquiaCmsDashboardBase { - /** - * The state interface. - * - * @var \Drupal\Core\State\StateInterface - */ - protected $state; - - - /** - * The module handler. - * - * @var \Drupal\Core\Extension\ModuleHandlerInterface - */ - protected $moduleHandler; - - /** - * The link generator. - * - * @var \Drupal\Core\Utility\LinkGeneratorInterface - */ - protected $linkGenerator; - - /** - * The info file parser. - * - * @var \Drupal\Core\Extension\InfoParserInterface - */ - protected $infoParser; - - /** - * Provides the database connection. - * - * @var \Drupal\Core\Database\Connection - */ - protected $connection; /** * The EntityTypeManager service. @@ -83,29 +48,15 @@ class HeadlessNextSites extends AcquiaCmsDashboardBase { */ protected $module = 'next'; - /** - * {@inheritdoc} - */ - public function __construct(StateInterface $state, ModuleHandlerInterface $module_handler, LinkGeneratorInterface $link_generator, InfoParserInterface $info_parser, Connection $connection, EntityTypeManagerInterface $entity_type_manager, StarterkitNextjsService $starterKitNextjsService) { - parent::__construct($state, $module_handler, $link_generator, $info_parser); - $this->connection = $connection; - $this->entityTypeManager = $entity_type_manager; - $this->starterKitNextjsService = $starterKitNextjsService; - } - /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static( - $container->get('state'), - $container->get('module_handler'), - $container->get('link_generator'), - $container->get('info_parser'), - $container->get('database'), - $container->get('entity_type.manager'), - $container->get('acquia_cms_headless.starterkit_nextjs') - ); + $instance = parent::create($container); + $instance->entityTypeManager = $container->get('entity_type.manager'); + $instance->starterKitNextjsService = $container->get('acquia_cms_headless.starterkit_nextjs'); + + return $instance; } /**