Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Drupal\visitors; |
| 4 | |
| 5 | use Drupal\Component\Plugin\PluginInspectionInterface; |
| 6 | |
| 7 | /** |
| 8 | * Interface for visitors event plugins. |
| 9 | */ |
| 10 | interface VisitorsEventPluginInterface extends PluginInspectionInterface { |
| 11 | |
| 12 | /** |
| 13 | * Gets the event label. |
| 14 | * |
| 15 | * @return string |
| 16 | * The event label. |
| 17 | */ |
| 18 | public function getLabel(): string; |
| 19 | |
| 20 | /** |
| 21 | * Gets the plugin name that generated this event. |
| 22 | * |
| 23 | * @return string |
| 24 | * The plugin name. |
| 25 | */ |
| 26 | public function getPlugin(): string; |
| 27 | |
| 28 | /** |
| 29 | * Processes the event. |
| 30 | * |
| 31 | * @param array $context |
| 32 | * The context array containing: |
| 33 | * - visit_id: The visit ID |
| 34 | * - page_view: The unique page view ID |
| 35 | * - title: The page title |
| 36 | * - url: The page URL |
| 37 | * - path: The Drupal path |
| 38 | * - route: The route name |
| 39 | * - referrer_url: The referrer URL |
| 40 | * - uid: The user ID. |
| 41 | * |
| 42 | * @return array|null |
| 43 | * NULL if the plugin does not apply to the current context, |
| 44 | * otherwise an array with the following structure: |
| 45 | * - event: The plugin event. |
| 46 | * - variables: The plugin variables. |
| 47 | */ |
| 48 | public function process(array $context): ?array; |
| 49 | |
| 50 | /** |
| 51 | * Gets the weight of the event. |
| 52 | * |
| 53 | * @return int |
| 54 | * The weight of the event. |
| 55 | */ |
| 56 | public function getWeight(): int; |
| 57 | |
| 58 | } |