You are here

public function TextimageDownloadController::__construct in Textimage 8.3

Same name and namespace in other branches
  1. 8.4 src/Controller/TextimageDownloadController.php \Drupal\textimage\Controller\TextimageDownloadController::__construct()

Constructs a TextimageDownloadController object.

Parameters

\Drupal\textimage\TextimageFactory $textimage_factory: The Textimage factory.

\Drupal\Core\Image\ImageFactory $image_factory: The image factory.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Psr\Log\LoggerInterface $logger: The Textimage logger.

\Drupal\Core\File\FileSystemInterface|null $file_system: The file system service.

Overrides FileDownloadController::__construct

File

src/Controller/TextimageDownloadController.php, line 75

Class

TextimageDownloadController
Defines a controller to serve image styles.

Namespace

Drupal\textimage\Controller

Code

public function __construct(TextimageFactory $textimage_factory, ImageFactory $image_factory, ConfigFactoryInterface $config_factory, LoggerInterface $logger, FileSystemInterface $file_system = NULL) {

  // @todo in next major, add the 'stream_wrapper_manager' service to the
  // constructor to ensure D8.8+ compatibility.
  parent::__construct();
  $this->textimageFactory = $textimage_factory;
  $this->imageFactory = $image_factory;
  $this->configFactory = $config_factory;
  $this->logger = $logger;
  $this->fileSystem = $file_system ?: \Drupal::service('file_system');
}