setono/consent-contracts
Composer 安装命令:
composer require setono/consent-contracts
包简介
Generic abstraction related to consent
README 文档
README
This library serves as a building block for handling consent related implementations in your library or application.
Install
composer require setono/consent-contracts
Usage
<?php use Setono\Consent\Consents; use Setono\Consent\ConsentCheckerInterface; final class YourService { private ConsentCheckerInterface $consentChecker; public function __construct(ConsentCheckerInterface $consentChecker) { $this->consentChecker = $consentChecker; } public function __invoke() { if ($this->consentChecker->isGranted(Consents::CONSENT_MARKETING)) { // marketing consent is granted, and you can set your marketing related cookie ;) } } }
Default consent checkers
This library also provides two implementations of the ConsentCheckerInterface, namely the DenyAllConsentChecker and
GrantAllConsentChecker. You can use these two to provide default consents if a consent management system isn't implemented.
统计信息
- 总下载量: 71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-12