Lines: 100.00%
| Line | Hits | Source |
|---|---|---|
| 1 | <?php | |
| 2 | ||
| 3 | namespace Drupal\visitors\Plugin; | |
| 4 | ||
| 5 | use Drupal\Component\Plugin\PluginBase; | |
| 6 | use Drupal\Core\StringTranslation\StringTranslationTrait; | |
| 7 | use Drupal\visitors\VisitorsEventPluginInterface; | |
| 8 | ||
| 9 | /** | |
| 10 | * Base class for Visitors event plugins. | |
| 11 | */ | |
| 12 | abstract class VisitorsEventBase extends PluginBase implements VisitorsEventPluginInterface { | |
| 13 | ||
| 14 | use StringTranslationTrait; | |
| 15 | ||
| 16 | /** | |
| 17 | * {@inheritdoc} | |
| 18 | */ | |
| 19 | public function getLabel(): string { | |
| 20 | 2 | return $this->pluginDefinition['label']; |
| 21 | } | |
| 22 | ||
| 23 | /** | |
| 24 | * {@inheritdoc} | |
| 25 | */ | |
| 26 | public function getPlugin(): string { | |
| 27 | 2 | return $this->pluginDefinition['plugin'] ?? static::class; |
| 28 | } | |
| 29 | ||
| 30 | /** | |
| 31 | * {@inheritdoc} | |
| 32 | */ | |
| 33 | public function getWeight(): int { | |
| 34 | 2 | return $this->pluginDefinition['weight'] ?? 0; |
| 35 | } | |
| 36 | ||
| 37 | } |