private function setTxPropsBasedOnHttpRequestData()

in agent/php/ElasticApm/Impl/AutoInstrument/TransactionForExtensionRequest.php [277:305]


    private function setTxPropsBasedOnHttpRequestData(TransactionInterface $tx): void
    {
        if ($this->httpMethod !== null) {
            $tx->context()->request()->setMethod($this->httpMethod);
        }

        if ($this->urlParts !== null) {
            if ($this->urlParts->host !== null) {
                $tx->context()->request()->url()->setDomain($this->urlParts->host);
            }
            if ($this->urlParts->path !== null) {
                $tx->context()->request()->url()->setPath($this->urlParts->path);
            }
            if ($this->urlParts->port !== null) {
                $tx->context()->request()->url()->setPort($this->urlParts->port);
            }
            if ($this->urlParts->scheme !== null) {
                $tx->context()->request()->url()->setProtocol($this->urlParts->scheme);
            }
            if ($this->urlParts->query !== null) {
                $tx->context()->request()->url()->setQuery($this->urlParts->query);
            }
        }

        if ($this->fullUrl !== null) {
            $tx->context()->request()->url()->setFull($this->fullUrl);
            $tx->context()->request()->url()->setOriginal($this->fullUrl);
        }
    }