Loading src/Commands/PanolensCommands.php +9 −13 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** * Panolens drush commandfile. */ class PanolensCommands extends DrushCommands { class PanolensCommands extends DrushCommands implements PanolensCommandsInterface { const LIBRARY_PANOLENS_VERSION = '0.11.0'; Loading @@ -24,24 +24,20 @@ class PanolensCommands extends DrushCommands { const LIBRARY_DESTINATION = 'libraries'; /** * Filesystem. * * @var \Drupal\Core\File\FileSystemInterface */ protected $fileSystem; /** * Constructs a new PanolensCommands. * * @param \Drupal\Core\File\FileSystemInterface $file_system * File system. * {@inheritdoc} */ public function __construct(FileSystemInterface $file_system) { parent::__construct(); $this->fileSystem = $file_system; } /** * Filesystem. * * @var \Drupal\Core\File\FileSystemInterface */ protected $fileSystem; /** * {@inheritDoc} */ Loading src/Commands/PanolensCommandsInterface.php 0 → 100644 +20 −0 Original line number Diff line number Diff line <?php namespace Drupal\panolens\Commands; use Drupal\Core\File\FileSystemInterface; /** * Provides a drush commands interface. */ interface PanolensCommandsInterface { /** * Constructs a new Panolens Drush command. * * @param \Drupal\Core\File\FileSystemInterface $file_system * File system. */ public function __construct(FileSystemInterface $file_system); } src/Plugin/Field/FieldFormatter/ImagePanoramaFormatter.php +3 −23 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * } * ) */ class ImagePanoramaFormatter extends ImageFormatter { class ImagePanoramaFormatter extends ImageFormatter implements ImagePanoramaFormatterInterface { /** * The file URL generator. Loading @@ -32,28 +32,7 @@ class ImagePanoramaFormatter extends ImageFormatter { protected $fileUrlGenerator; /** * Constructs a ImagePanoramaFormatter object. * * @param string $plugin_id * The plugin_id for the formatter. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The definition of the field to which the formatter is associated. * @param array $settings * The formatter settings. * @param string $label * The formatter label display setting. * @param string $view_mode * The view mode. * @param array $third_party_settings * Any third party settings. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\image\ImageStyleStorageInterface $image_style_storage * The image style entity storage handler. * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator * The file URL generator. * {@inheritdoc} */ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, ImageStyleStorageInterface $image_style_storage, FileUrlGeneratorInterface $file_url_generator) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $current_user, $image_style_storage); Loading Loading @@ -99,6 +78,7 @@ class ImagePanoramaFormatter extends ImageFormatter { $base_cache_tags = $image_style->getCacheTags(); } /** @var \Drupal\file\FileInterface $file */ foreach ($files as $delta => $file) { $cache_contexts = []; Loading src/Plugin/Field/FieldFormatter/ImagePanoramaFormatterInterface.php 0 → 100644 +41 −0 Original line number Diff line number Diff line <?php namespace Drupal\panolens\Plugin\Field\FieldFormatter; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\File\FileUrlGeneratorInterface; use Drupal\Core\Session\AccountInterface; use Drupal\image\ImageStyleStorageInterface; /** * Provides an image panorama formatter interface. */ interface ImagePanoramaFormatterInterface { /** * Constructs a ImagePanoramaFormatter object. * * @param string $plugin_id * The plugin_id for the formatter. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The definition of the field to which the formatter is associated. * @param array $settings * The formatter settings. * @param string $label * The formatter label display setting. * @param string $view_mode * The view mode. * @param array $third_party_settings * Any third party settings. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\image\ImageStyleStorageInterface $image_style_storage * The image style entity storage handler. * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator * The file URL generator. */ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, ImageStyleStorageInterface $image_style_storage, FileUrlGeneratorInterface $file_url_generator); } src/Plugin/Field/FieldFormatter/VideoPanoramaFormatter.php +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * } * ) */ class VideoPanoramaFormatter extends FileVideoFormatter { class VideoPanoramaFormatter extends FileVideoFormatter implements VideoPanoramaFormatterInterface { /** * The file URL generator. Loading Loading
src/Commands/PanolensCommands.php +9 −13 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** * Panolens drush commandfile. */ class PanolensCommands extends DrushCommands { class PanolensCommands extends DrushCommands implements PanolensCommandsInterface { const LIBRARY_PANOLENS_VERSION = '0.11.0'; Loading @@ -24,24 +24,20 @@ class PanolensCommands extends DrushCommands { const LIBRARY_DESTINATION = 'libraries'; /** * Filesystem. * * @var \Drupal\Core\File\FileSystemInterface */ protected $fileSystem; /** * Constructs a new PanolensCommands. * * @param \Drupal\Core\File\FileSystemInterface $file_system * File system. * {@inheritdoc} */ public function __construct(FileSystemInterface $file_system) { parent::__construct(); $this->fileSystem = $file_system; } /** * Filesystem. * * @var \Drupal\Core\File\FileSystemInterface */ protected $fileSystem; /** * {@inheritDoc} */ Loading
src/Commands/PanolensCommandsInterface.php 0 → 100644 +20 −0 Original line number Diff line number Diff line <?php namespace Drupal\panolens\Commands; use Drupal\Core\File\FileSystemInterface; /** * Provides a drush commands interface. */ interface PanolensCommandsInterface { /** * Constructs a new Panolens Drush command. * * @param \Drupal\Core\File\FileSystemInterface $file_system * File system. */ public function __construct(FileSystemInterface $file_system); }
src/Plugin/Field/FieldFormatter/ImagePanoramaFormatter.php +3 −23 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * } * ) */ class ImagePanoramaFormatter extends ImageFormatter { class ImagePanoramaFormatter extends ImageFormatter implements ImagePanoramaFormatterInterface { /** * The file URL generator. Loading @@ -32,28 +32,7 @@ class ImagePanoramaFormatter extends ImageFormatter { protected $fileUrlGenerator; /** * Constructs a ImagePanoramaFormatter object. * * @param string $plugin_id * The plugin_id for the formatter. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The definition of the field to which the formatter is associated. * @param array $settings * The formatter settings. * @param string $label * The formatter label display setting. * @param string $view_mode * The view mode. * @param array $third_party_settings * Any third party settings. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\image\ImageStyleStorageInterface $image_style_storage * The image style entity storage handler. * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator * The file URL generator. * {@inheritdoc} */ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, ImageStyleStorageInterface $image_style_storage, FileUrlGeneratorInterface $file_url_generator) { parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, $current_user, $image_style_storage); Loading Loading @@ -99,6 +78,7 @@ class ImagePanoramaFormatter extends ImageFormatter { $base_cache_tags = $image_style->getCacheTags(); } /** @var \Drupal\file\FileInterface $file */ foreach ($files as $delta => $file) { $cache_contexts = []; Loading
src/Plugin/Field/FieldFormatter/ImagePanoramaFormatterInterface.php 0 → 100644 +41 −0 Original line number Diff line number Diff line <?php namespace Drupal\panolens\Plugin\Field\FieldFormatter; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\File\FileUrlGeneratorInterface; use Drupal\Core\Session\AccountInterface; use Drupal\image\ImageStyleStorageInterface; /** * Provides an image panorama formatter interface. */ interface ImagePanoramaFormatterInterface { /** * Constructs a ImagePanoramaFormatter object. * * @param string $plugin_id * The plugin_id for the formatter. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The definition of the field to which the formatter is associated. * @param array $settings * The formatter settings. * @param string $label * The formatter label display setting. * @param string $view_mode * The view mode. * @param array $third_party_settings * Any third party settings. * @param \Drupal\Core\Session\AccountInterface $current_user * The current user. * @param \Drupal\image\ImageStyleStorageInterface $image_style_storage * The image style entity storage handler. * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator * The file URL generator. */ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, ImageStyleStorageInterface $image_style_storage, FileUrlGeneratorInterface $file_url_generator); }
src/Plugin/Field/FieldFormatter/VideoPanoramaFormatter.php +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * } * ) */ class VideoPanoramaFormatter extends FileVideoFormatter { class VideoPanoramaFormatter extends FileVideoFormatter implements VideoPanoramaFormatterInterface { /** * The file URL generator. Loading