PatchInfoSourceBase.php in PatchInfo 8.2
File
src/PatchInfoSourceBase.php
View source
<?php
namespace Drupal\patchinfo;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Component\Plugin\PluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class PatchInfoSourceBase extends PluginBase implements PatchInfoSourceInterface {
use StringTranslationTrait;
protected $loggerFactory;
public function __construct(array $configuration, string $plugin_id, $plugin_definition, LoggerChannelFactoryInterface $logger_factory) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->loggerFactory = $logger_factory;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('logger.factory'));
}
public function getLabel() {
return $this->pluginDefinition['label'];
}
public abstract function getPatches(array $info, Extension $file, string $type);
}