Commit 067530c4 authored by gbyte.co's avatar gbyte.co

Adjust Plugin base

parent 31d06a60
<?php
namespace Drupal\simple_sitemap\Plugin\simple_sitemap;
use Drupal\Core\Plugin\PluginBase;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Class UrlGeneratorBase
* @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator
*/
abstract class SimplesitemapPluginBase extends PluginBase implements PluginInspectionInterface, ContainerFactoryPluginInterface {
/**
* SimplesitemapPluginBase constructor.
* @param array $configuration
* @param string $plugin_id
* @param mixed $plugin_definition
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
/**
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* @param array $configuration
* @param string $plugin_id
* @param mixed $plugin_definition
* @return static
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition);
}
}
......@@ -2,9 +2,7 @@
namespace Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator;
use Drupal\Core\Plugin\PluginBase;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\simple_sitemap\Plugin\simple_sitemap\SimplesitemapPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\ContentEntityBase;
......@@ -21,7 +19,7 @@ use Drupal\Core\Language\Language;
* Class UrlGeneratorBase
* @package Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator
*/
abstract class UrlGeneratorBase extends PluginBase implements PluginInspectionInterface, ContainerFactoryPluginInterface, UrlGeneratorInterface {
abstract class UrlGeneratorBase extends SimplesitemapPluginBase implements UrlGeneratorInterface {
const ANONYMOUS_USER_ID = 0;
const PROCESSING_PATH_MESSAGE = 'Processing path #@current out of @max: @path';
......
......@@ -10,4 +10,8 @@ interface UrlGeneratorInterface {
public function generate();
/**
* @return mixed
*/
public function getDataSets();
}
......@@ -15,7 +15,7 @@ abstract class SimplesitemapTestBase extends WebTestBase {
*
* @var array
*/
public static $modules = ['simple_sitemap', 'node'];
public static $modules = ['simple_sitemap', 'node', 'content_translation'];
/**
* @var \Drupal\simple_sitemap\Simplesitemap
......
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