public function withPayload(string $payload, bool $isPayloadDetached = false): self
    {
        if (false === \mb_detect_encoding($payload, 'UTF-8', true)) {
            throw new \InvalidArgumentException('The payload must be encoded in UTF-8');
        }
        $clone = clone $this;
        $clone->payload = $payload;
        $clone->isPayloadDetached = $isPayloadDetached;

        return $clone;
    }
public function withPayload(string $payload, bool $isPayloadDetached = false): self
    {
        if (false === \mb_detect_encoding($payload, 'UTF-8', true)) {
            throw new \InvalidArgumentException('The payload must be encoded in UTF-8');
        }
        $clone = clone $this;
        $clone->payload = $payload;
        $clone->isPayloadDetached = $isPayloadDetached;

        return $clone;
    }
public function withPayload ( string $ payload , bool $ isPayloadDetached = false ) : self { if ( false === \ mb_detect_encoding ( $ payload , 'UTF-8' , true ) ) { throw new \ InvalidArgumentException ( 'The payload must be encoded in UTF-8' ) ; } $ clone = clone $ this ; $ clone -> payload = $ payload ; $ clone -> isPayloadDetached = $ isPayloadDetached ; return $ clone ; }
Set the payload.
This method will return a new JWSBuilder object.

@return JWSBuilder
Set the payload . This method will return a new JWSBuilder object .