patrickkerrigan/php-xray

View on GitHub
src/HttpSegment.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Pkerrigan\Xray;

use function array_filter;

/**
 *
 * @author Patrick Kerrigan (patrickkerrigan.uk)
 * @since 13/05/2018
 */
class HttpSegment extends RemoteSegment
{
    use HttpTrait;

    /**
     * @inheritdoc
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        $data = parent::jsonSerialize();

        $data['http'] = $this->serialiseHttpData();

        return array_filter($data);
    }

    /**
     * @param bool $traced
     * @return static
     */
    public function setTraced(bool $traced)
    {
        $this->traced = $traced;

        return $this;
    }
}