Skip to content

Commit

Permalink
Coding standards.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-vessey committed Nov 21, 2023
1 parent 42be2b0 commit 77401ef
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Annotation/V3/IdentifierPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
*/
class IdentifierPlugin extends Plugin {

/**
* The plugin ID.
*
* @var string
*/
public string $id;

}
22 changes: 21 additions & 1 deletion src/Event/V3/ImageBodyEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Drupal\Component\EventDispatcher\Event;
use Drupal\file\FileInterface;

/**
* Image body generation event.
*/
class ImageBodyEvent extends Event {

protected array $bodies = [];
Expand All @@ -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;
}
Expand Down
6 changes: 6 additions & 0 deletions src/IdProcessPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 77401ef

Please sign in to comment.