CoreFiles by mySites.guru
RelatedTo.php27 lines, 593 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
d3047320674c85ecc49dd965d85d6271
sha1
4b6e901ccddfec38941519e305158c430b52ca8a
sha256
d0401990b578327d0a2740b2dae65eb9044c8d93811e678f1b913cf725e95229
<?php

namespace Lcobucci\JWT\Validation\Constraint;

use Lcobucci\JWT\Token;
use Lcobucci\JWT\Validation\Constraint;
use Lcobucci\JWT\Validation\ConstraintViolation;

final class RelatedTo implements Constraint
{
    /** @var string */
    private $subject;

    public function __construct($subject)
    {
        $this->subject = $subject;
    }

    public function assert(Token $token)
    {
        if (! $token->isRelatedTo($this->subject)) {
            throw new ConstraintViolation(
                'The token is not related to the expected subject'
            );
        }
    }
}

The same content is in 75 releases, Joomla 4.2.0-beta3 to 4.4.14. See them all, or every version of this file.