From 0ae6b4022c84ed383afbaa14838af2e1a73f7a19 Mon Sep 17 00:00:00 2001
From: Alexander O'Neill <alexander@born-digital.com>
Date: Sun, 17 Mar 2024 23:06:29 -0300
Subject: [PATCH] Islandora IIIF: Address PHPCS errors.

---
 .../src/Plugin/views/style/IIIFManifest.php   | 26 ++++++++++++-------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php
index cef91f9e..05462a03 100644
--- a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php
+++ b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php
@@ -232,7 +232,7 @@ class IIIFManifest extends StylePluginBase {
 
     $content_type = 'json';
 
-    // Add a search endpoint if one is defined
+    // Add a search endpoint if one is defined.
     $this->addSearchEndpoint($json, $url_components);
 
     // Give other modules a chance to alter the manifest.
@@ -251,6 +251,8 @@ class IIIFManifest extends StylePluginBase {
    * @param string $iiif_base_id
    *   The URL for the request, minus the last part of the URL,
    *   which is likely "manifest".
+   * @param \Drupal\taxonomy\TermInterface $structured_text_term
+   *   The term representing the media use.
    *
    * @return array
    *   List of IIIF URLs to display in the Openseadragon viewer.
@@ -398,10 +400,8 @@ class IIIFManifest extends StylePluginBase {
    *
    * @param \Drupal\Core\Entity\EntityInterface $entity
    *   The entity at the current row.
-   * @param \Drupal\views\ResultRow $row
-   *   Result row.
-   * @param int $delta
-   *   The delta in case there are multiple canvases on one media.
+   * @param \Drupal\taxonomy\TermInterface $structured_text_term
+   *   The term representing the media use.
    *
    * @return string|false
    *   The absolute URL of the current row's structured text,
@@ -476,6 +476,14 @@ class IIIFManifest extends StylePluginBase {
     return $options;
   }
 
+  /**
+   * Undocumented function
+   *
+   * @param array $json
+   *   The IIIF manifest.
+   * @param array $url_components
+   *   The search endpoint URL as array.
+   */
   protected function addSearchEndpoint(array &$json, array $url_components) {
     $url_base = $this->getRequest()->getSchemeAndHttpHost();
     $hocr_search_path = $this->options['search_endpoint'];
@@ -484,10 +492,10 @@ class IIIFManifest extends StylePluginBase {
     $hocr_search_url = str_replace('%node', $url_components[1], $hocr_search_url);
 
     $json['service'][] = [
-          "@context" => "http://iiif.io/api/search/0/context.json",
-          "@id" => $hocr_search_url,
-          "profile" => "http://iiif.io/api/search/0/search",
-          "label" => t("Search inside this work"),
+      "@context" => "http://iiif.io/api/search/0/context.json",
+      "@id" => $hocr_search_url,
+      "profile" => "http://iiif.io/api/search/0/search",
+      "label" => t("Search inside this work"),
     ];
   }