Services/AzineTwigSwiftMailer.php
private function cachedEmbedImage($filePath)
    {
        $filePath = realpath($filePath);
        if (!array_key_exists($filePath, $this->imageCache)) {
            if (is_file($filePath)) {
                $image = \Swift_Image::fromPath($filePath);
                $id = $image->getId();

                // $id and $value must not be the same => this happens if the file cannot be found/read
                if ($id == $filePath) {
                    // @codeCoverageIgnoreStart
                    // add a null-value to the cache for this path, so we don't try again.
                    $this->imageCache[$filePath] = null;
                } else {
                    // @codeCoverageIgnoreEnd
                    // add the image to the cache
                    $this->imageCache[$filePath] = $image;
                }
            }
        }

        return $this->imageCache[$filePath];
    }
private function cachedEmbedImage($filePath)
    {
        $filePath = realpath($filePath);
        if (!array_key_exists($filePath, $this->imageCache)) {
            if (is_file($filePath)) {
                $image = \Swift_Image::fromPath($filePath);
                $id = $image->getId();

                // $id and $value must not be the same => this happens if the file cannot be found/read
                if ($id == $filePath) {
                    // @codeCoverageIgnoreStart
                    // add a null-value to the cache for this path, so we don't try again.
                    $this->imageCache[$filePath] = null;
                } else {
                    // @codeCoverageIgnoreEnd
                    // add the image to the cache
                    $this->imageCache[$filePath] = $image;
                }
            }
        }

        return $this->imageCache[$filePath];
    }
private function cachedEmbedImage ( $ filePath ) { $ filePath = realpath ( $ filePath ) ; if ( ! array_key_exists ( $ filePath , $ this -> imageCache ) ) { if ( is_file ( $ filePath ) ) { $ image = \ Swift_Image :: fromPath ( $ filePath ) ; $ id = $ image -> getId ( ) ; // $id and $value must not be the same => this happens if the file cannot be found/read if ( $ id == $ filePath ) { // @codeCoverageIgnoreStart // add a null-value to the cache for this path, so we don't try again. $ this -> imageCache [ $ filePath ] = null ; } else { // @codeCoverageIgnoreEnd // add the image to the cache $ this -> imageCache [ $ filePath ] = $ image ; } } } return $ this -> imageCache [ $ filePath ] ; }
Get the Swift_Image for the file.

@param string $filePath

@return \Swift_Image|null
Get the Swift_Image for the file .