public function setRefererPolicy(string $refererPolicy):void
    {
        if (!in_array($refererPolicy, self::REFERER_POLICY_VALUES)) {
            throw new MiddlewareException(
                $this,
                sprintf(
                    "%s is not a valid CSP referer policy, correct values are: %s (see %s)",
                    $refererPolicy, implode(', ', self::REFERER_POLICY_VALUES),
                    'https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/referrer'
                )
            );
        }
        $this->tags['referer'] = $refererPolicy;
    }
public function setRefererPolicy(string $refererPolicy):void
    {
        if (!in_array($refererPolicy, self::REFERER_POLICY_VALUES)) {
            throw new MiddlewareException(
                $this,
                sprintf(
                    "%s is not a valid CSP referer policy, correct values are: %s (see %s)",
                    $refererPolicy, implode(', ', self::REFERER_POLICY_VALUES),
                    'https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/referrer'
                )
            );
        }
        $this->tags['referer'] = $refererPolicy;
    }
public function setRefererPolicy ( string $ refererPolicy ) : void { if ( ! in_array ( $ refererPolicy , self :: REFERER_POLICY_VALUES ) ) { throw new MiddlewareException ( $ this , sprintf ( "%s is not a valid CSP referer policy, correct values are: %s (see %s)" , $ refererPolicy , implode ( ', ' , self :: REFERER_POLICY_VALUES ) , 'https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/referrer' ) ) ; } $ this -> tags [ 'referer' ] = $ refererPolicy ; }
Sets the 'referrer' value of the CSP. See the REFERER_POLICY_XYZ class constants for the possible values.

@link https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/referrer
@param string $refererPolicy
@throws MiddlewareException
Sets the referrer value of the CSP . See the REFERER_POLICY_XYZ class constants for the possible values .