vendor/swiftmailer/swiftmailer/lib/classes/Swift/Image.php line 29

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of SwiftMailer.
  4.  * (c) 2004-2009 Chris Corbyn
  5.  *
  6.  * For the full copyright and license information, please view the LICENSE
  7.  * file that was distributed with this source code.
  8.  */
  9. /**
  10.  * An image, embedded in a multipart message.
  11.  *
  12.  * @author Chris Corbyn
  13.  */
  14. class Swift_Image extends Swift_EmbeddedFile
  15. {
  16.     /**
  17.      * Create a new EmbeddedFile.
  18.      *
  19.      * Details may be optionally provided to the constructor.
  20.      *
  21.      * @param string|Swift_OutputByteStream $data
  22.      * @param string                        $filename
  23.      * @param string                        $contentType
  24.      */
  25.     public function __construct($data null$filename null$contentType null)
  26.     {
  27.         parent::__construct($data$filename$contentType);
  28.     }
  29.     /**
  30.      * Create a new Image from a filesystem path.
  31.      *
  32.      * @param string $path
  33.      *
  34.      * @return self
  35.      */
  36.     public static function fromPath($path)
  37.     {
  38.         return (new self())->setFile(new Swift_ByteStream_FileByteStream($path));
  39.     }
  40. }