public function withPayload($payload): self
    {
        $payload = \is_string($payload) ? $payload : $this->jsonConverter->encode($payload);
        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;

        return $clone;
    }
public function withPayload($payload): self
    {
        $payload = \is_string($payload) ? $payload : $this->jsonConverter->encode($payload);
        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;

        return $clone;
    }
public function withPayload ( $ payload ) : self { $ payload = \ is_string ( $ payload ) ? $ payload : $ this -> jsonConverter -> encode ( $ payload ) ; 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 ; return $ clone ; }
Set the payload of the JWE to build.

@return JWEBuilder
Set the payload of the JWE to build .