HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/marisrental/boldt.tech/vendor/sentry/sentry/src/Transport/SpoolTransport.php
<?php

declare(strict_types=1);

namespace Sentry\Transport;

use Sentry\Event;
use Sentry\Spool\SpoolInterface;

/**
 * This transport stores the events in a queue to send them later.
 *
 * @author Stefano Arlandini <sarlandini@alice.it>
 */
final class SpoolTransport implements TransportInterface
{
    /**
     * @var SpoolInterface The spool instance
     */
    private $spool;

    /**
     * Constructor.
     *
     * @param SpoolInterface $spool The spool instance
     */
    public function __construct(SpoolInterface $spool)
    {
        $this->spool = $spool;
    }

    /**
     * Gets the spool.
     */
    public function getSpool(): SpoolInterface
    {
        return $this->spool;
    }

    /**
     * {@inheritdoc}
     */
    public function send(Event $event): ?string
    {
        if ($this->spool->queueEvent($event)) {
            return (string) $event->getId(false);
        }

        return null;
    }
}