"Fossies" - the Fresh Open Source Software Archive

Member "framework-8.65.0/src/Illuminate/Mail/Transport/ArrayTransport.php" (19 Oct 2021, 1173 Bytes) of package /linux/www/laravel-framework-8.65.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ArrayTransport.php" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 8.61.0_vs_8.62.0.

    1 <?php
    2 
    3 namespace Illuminate\Mail\Transport;
    4 
    5 use Illuminate\Support\Collection;
    6 use Swift_Mime_SimpleMessage;
    7 
    8 class ArrayTransport extends Transport
    9 {
   10     /**
   11      * The collection of Swift Messages.
   12      *
   13      * @var \Illuminate\Support\Collection
   14      */
   15     protected $messages;
   16 
   17     /**
   18      * Create a new array transport instance.
   19      *
   20      * @return void
   21      */
   22     public function __construct()
   23     {
   24         $this->messages = new Collection;
   25     }
   26 
   27     /**
   28      * {@inheritdoc}
   29      *
   30      * @return int
   31      */
   32     public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
   33     {
   34         $this->beforeSendPerformed($message);
   35 
   36         $this->messages[] = $message;
   37 
   38         return $this->numberOfRecipients($message);
   39     }
   40 
   41     /**
   42      * Retrieve the collection of messages.
   43      *
   44      * @return \Illuminate\Support\Collection
   45      */
   46     public function messages()
   47     {
   48         return $this->messages;
   49     }
   50 
   51     /**
   52      * Clear all of the messages from the local collection.
   53      *
   54      * @return \Illuminate\Support\Collection
   55      */
   56     public function flush()
   57     {
   58         return $this->messages = new Collection;
   59     }
   60 }