Commit 74838bda authored by gbyte.co's avatar gbyte.co

Add imports for type hinting

parent 795efcea
...@@ -6,6 +6,12 @@ use Drupal\Core\Url; ...@@ -6,6 +6,12 @@ use Drupal\Core\Url;
use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Html;
use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\Cache;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\simple_sitemap\Logger;
use Drupal\simple_sitemap\SitemapGenerator;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Path\PathValidator;
use Drupal\Core\Entity\Query\QueryFactory;
/** /**
* Class BatchUrlGenerator. * Class BatchUrlGenerator.
...@@ -46,12 +52,12 @@ class BatchUrlGenerator { ...@@ -46,12 +52,12 @@ class BatchUrlGenerator {
* @param $logger * @param $logger
*/ */
public function __construct( public function __construct(
$sitemap_generator, SitemapGenerator $sitemap_generator,
$language_manager, LanguageManagerInterface $language_manager,
$entity_type_manager, EntityTypeManagerInterface $entity_type_manager,
$path_validator, PathValidator $path_validator,
$entity_query, QueryFactory $entity_query,
$logger Logger $logger
) { ) {
// Todo using only one method, maybe make method static instead? // Todo using only one method, maybe make method static instead?
$this->sitemapGenerator = $sitemap_generator; $this->sitemapGenerator = $sitemap_generator;
......
...@@ -4,6 +4,7 @@ namespace Drupal\simple_sitemap; ...@@ -4,6 +4,7 @@ namespace Drupal\simple_sitemap;
use Drupal\Core\Entity\ContentEntityTypeInterface; use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\simple_sitemap\Form\FormHelper; use Drupal\simple_sitemap\Form\FormHelper;
use Drupal\simple_sitemap\SitemapGenerator;
/** /**
* Class Simplesitemap. * Class Simplesitemap.
...@@ -33,7 +34,7 @@ class Simplesitemap { ...@@ -33,7 +34,7 @@ class Simplesitemap {
* @param $dateFormatter * @param $dateFormatter
*/ */
public function __construct( public function __construct(
$sitemapGenerator, SitemapGenerator $sitemapGenerator,
$configFactoryInterface, $configFactoryInterface,
$database, $database,
$entityTypeManager, $entityTypeManager,
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
namespace Drupal\simple_sitemap; namespace Drupal\simple_sitemap;
use \XMLWriter; use \XMLWriter;
use Drupal\simple_sitemap\Batch\Batch;
use Drupal\Core\Database\Connection;
use Drupal\Core\Extension\ModuleHandler;
use Drupal\Core\Language\LanguageManagerInterface;
/** /**
* Class SitemapGenerator. * Class SitemapGenerator.
...@@ -33,7 +37,12 @@ class SitemapGenerator { ...@@ -33,7 +37,12 @@ class SitemapGenerator {
* @param $module_handler * @param $module_handler
* @param $language_manager * @param $language_manager
*/ */
public function __construct($batch, $database, $module_handler, $language_manager) { public function __construct(
Batch $batch,
Connection $database,
ModuleHandler $module_handler,
LanguageManagerInterface $language_manager
) {
$this->batch = $batch; $this->batch = $batch;
$this->db = $database; $this->db = $database;
$this->moduleHandler = $module_handler; $this->moduleHandler = $module_handler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment