cookie_blocking_libraries-1.0.x-dev/src/CookieImplementationInterface.php
src/CookieImplementationInterface.php
<?php namespace Drupal\cookie_blocking_libraries; /** * Interface for cookie_blocking_libraries_implementation plugins. */ interface CookieImplementationInterface { /** * Returns the translated plugin label. * * @return string * The translated title. */ public function label(); /** * Get a list of cookie categories that will be shown on the config form. * * This keys typically would be used as the attribute value on the * identified scripts. * * @return array * The cookie categories. */ public function getCategories() : array; /** * Get the default category key. * * @return string * The default category. Should match one of the getCategory() keys. */ public function getDefaultCategory() : string; /** * Alter a library definition. * * @param array $library_js * The library's JS definition. * @param string $extension * The extension. * @param string $type * The type of script, form the categorisation settings form. */ public function alterLibrary(array &$library_js, $extension, $type): void; /** * Alter a script attachment. * * @param array $attachment * The attachment HTML script tag. * @param string $extension * The extension name. * @param string $type * The type of script, form the categorisation settings form. */ public function alterAttachment(array &$attachment, $extension, $type): void; }