From 77401ef6f21772dafa75da81d8b91266b6c563d3 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 21 Nov 2023 15:02:58 -0400 Subject: [PATCH] Coding standards. --- src/Annotation/V3/IdentifierPlugin.php | 5 +++++ src/Event/V3/ImageBodyEvent.php | 22 +++++++++++++++++++++- src/IdProcessPluginManager.php | 6 ++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Annotation/V3/IdentifierPlugin.php b/src/Annotation/V3/IdentifierPlugin.php index 669180d..b52983d 100644 --- a/src/Annotation/V3/IdentifierPlugin.php +++ b/src/Annotation/V3/IdentifierPlugin.php @@ -11,6 +11,11 @@ */ class IdentifierPlugin extends Plugin { + /** + * The plugin ID. + * + * @var string + */ public string $id; } diff --git a/src/Event/V3/ImageBodyEvent.php b/src/Event/V3/ImageBodyEvent.php index 253dda4..6e7af60 100644 --- a/src/Event/V3/ImageBodyEvent.php +++ b/src/Event/V3/ImageBodyEvent.php @@ -5,6 +5,9 @@ use Drupal\Component\EventDispatcher\Event; use Drupal\file\FileInterface; +/** + * Image body generation event. + */ class ImageBodyEvent extends Event { protected array $bodies = []; @@ -15,17 +18,34 @@ class ImageBodyEvent extends Event { public function __construct( protected FileInterface $image, ) { - } + /** + * Get the image for which we are generating a body. + * + * @return \Drupal\file\FileInterface + * The file entity of the image for which we are generating a body. + */ public function getImage() : FileInterface { return $this->image; } + /** + * Add a body. + * + * @param array $body + * The body to add. + */ public function addBody(array $body) : void { $this->bodies[] = $body; } + /** + * Get all bodies that were added. + * + * @return array + * The bodies that were added. + */ public function getBodies() : array { return $this->bodies; } diff --git a/src/IdProcessPluginManager.php b/src/IdProcessPluginManager.php index c4f673a..4f3d161 100644 --- a/src/IdProcessPluginManager.php +++ b/src/IdProcessPluginManager.php @@ -7,8 +7,14 @@ use Drupal\iiif_presentation_api\Annotation\V3\IdentifierPlugin; use Drupal\iiif_presentation_api\Plugin\IdentifierPluginInterface; +/** + * ID processing plugin manager service. + */ class IdProcessPluginManager extends DefaultPluginManager { + /** + * Constructor. + */ public function __construct($version, \Traversable $namespaces, ModuleHandlerInterface $module_handler) { parent::__construct( "Plugin/iiif_presentation_api/$version/Identifier",