BlockedLibraryManager.php in Cookie Content Blocker 8
File
src/BlockedLibraryManager.php
View source
<?php
namespace Drupal\cookie_content_blocker;
use function in_array;
class BlockedLibraryManager implements BlockedLibraryManagerInterface {
protected $blockedLibraries = [];
public function addBlockedLibrary(string $library) : void {
$this->blockedLibraries[$library] = $library;
}
public function getBlockedLibraries() : array {
return $this->blockedLibraries;
}
public function hasBlockedLibraries() : bool {
return !empty($this->blockedLibraries);
}
public function isBlocked(string $library) : bool {
return in_array($library, $this->blockedLibraries, TRUE);
}
}