D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
lcobucci
/
jwt
/
src
/
Validation
/
Constraint
/
Filename :
IssuedBy.php
back
Copy
<?php declare (strict_types=1); namespace WPToolkitDependenciesIsolationPrefix\Lcobucci\JWT\Validation\Constraint; use WPToolkitDependenciesIsolationPrefix\Lcobucci\JWT\Token; use WPToolkitDependenciesIsolationPrefix\Lcobucci\JWT\Validation\Constraint; use WPToolkitDependenciesIsolationPrefix\Lcobucci\JWT\Validation\ConstraintViolation; final class IssuedBy implements Constraint { /** @var string[] */ private array $issuers; public function __construct(string ...$issuers) { $this->issuers = $issuers; } public function assert(Token $token) : void { if (!$token->hasBeenIssuedBy(...$this->issuers)) { throw new ConstraintViolation('The token was not issued by the given issuers'); } } }