Skip to content

Commit

Permalink
ACMS-4373: Fix headless warnings related to D11 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshreeputra committed Dec 27, 2024
1 parent 8cee154 commit 8462b5e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 8462b5e

Please sign in to comment.