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/SBogers10/finsteps.komma.pro/vendor/sentry/sentry/src/Spool/MemorySpool.php
<?php

declare(strict_types=1);

namespace Sentry\Spool;

use Sentry\Event;
use Sentry\Transport\TransportInterface;

/**
 * This spool stores the events in memory.
 *
 * @author Stefano Arlandini <sarlandini@alice.it>
 */
final class MemorySpool implements SpoolInterface
{
    /**
     * @var Event[] List of enqueued events
     */
    private $events = [];

    /**
     * {@inheritdoc}
     */
    public function queueEvent(Event $event): bool
    {
        $this->events[] = $event;

        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function flushQueue(TransportInterface $transport): void
    {
        if (empty($this->events)) {
            return;
        }

        while ($event = array_pop($this->events)) {
            $transport->send($event);
        }
    }
}