Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Mail/Transport/ArrayTransport.php
Строк: 81
<?php

namespace IlluminateMailTransport;

use 
IlluminateSupportCollection;
use 
SymfonyComponentMailerEnvelope;
use 
SymfonyComponentMailerSentMessage;
use 
SymfonyComponentMailerTransportTransportInterface;
use 
SymfonyComponentMimeRawMessage;

class 
ArrayTransport implements TransportInterface
{
    
/**
     * The collection of Symfony Messages.
     *
     * @var IlluminateSupportCollection
     */
    
protected $messages;

    
/**
     * Create a new array transport instance.
     *
     * @return void
     */
    
public function __construct()
    {
        
$this->messages = new Collection;
    }

    
/**
     * {@inheritdoc}
     */
    
public function send(RawMessage $message, ?Envelope $envelope null): ?SentMessage
    
{
        return 
$this->messages[] = new SentMessage($message$envelope ?? Envelope::create($message));
    }

    
/**
     * Retrieve the collection of messages.
     *
     * @return IlluminateSupportCollection
     */
    
public function messages()
    {
        return 
$this->messages;
    }

    
/**
     * Clear all of the messages from the local collection.
     *
     * @return IlluminateSupportCollection
     */
    
public function flush()
    {
        return 
$this->messages = new Collection;
    }

    
/**
     * Get the string representation of the transport.
     *
     * @return string
     */
    
public function __toString(): string
    
{
        return 
'array';
    }
}
Онлайн: 0
Реклама