From a36b648a364f4f9113307442da491c0978ce7297 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Thu, 3 Oct 2019 12:08:50 -0300 Subject: [PATCH] Fix islandora for latest 3.6 coding standard update. --- includes/dublin_core.inc | 11 ++++++++ includes/mime_detect.inc | 12 ++++++++ includes/tuque_wrapper.inc | 54 ++++++++++++++++++++++++++++++++++++ includes/utilities.inc | 12 ++++---- tests/includes/utilities.inc | 20 +++++++++++++ 5 files changed, 103 insertions(+), 6 deletions(-) diff --git a/includes/dublin_core.inc b/includes/dublin_core.inc index cff1bebe..b61b913a 100644 --- a/includes/dublin_core.inc +++ b/includes/dublin_core.inc @@ -13,6 +13,11 @@ */ class DublinCore { + /** + * The DC represented as an array. + * + * @var array + */ public $dc = array( 'dc:title' => array(), 'dc:creator' => array(), @@ -30,6 +35,12 @@ class DublinCore { 'dc:coverage' => array(), 'dc:rights' => array(), ); + + /** + * Doesn't appear to be used? Deprecated perhaps. + * + * @var string + */ public $owner; /** diff --git a/includes/mime_detect.inc b/includes/mime_detect.inc index 818e150b..b34a3995 100644 --- a/includes/mime_detect.inc +++ b/includes/mime_detect.inc @@ -59,7 +59,19 @@ class MimeDetect { * $this->get_extension('image/jpeg') will always return 'jpg'. */ protected $protectedMimeTypes = array(); + + /** + * This is populated internally from protectedMimeTypes. + * + * @var array + */ protected $protectedFileExtensions; + + /** + * This is deprecated and shouldn't be used. + * + * @var array + */ protected $extensionExceptions = array( // XXX: Deprecated... Only here due to old 'tif' => 'image/tif' mapping... // The correct MIMEtype is 'image/tiff'. diff --git a/includes/tuque_wrapper.inc b/includes/tuque_wrapper.inc index 3b08a9fd..d94ab37e 100644 --- a/includes/tuque_wrapper.inc +++ b/includes/tuque_wrapper.inc @@ -80,8 +80,19 @@ function islandora_invoke_datastream_hooks($hook, array $models, $dsid) { * Implementation of the FedoraRepository class. */ class IslandoraFedoraRepository extends FedoraRepository { + /** + * {@inheritdoc} + */ protected $queryClass = 'IslandoraRepositoryQuery'; + + /** + * {@inheritdoc} + */ protected $newObjectClass = 'IslandoraNewFedoraObject'; + + /** + * {@inheritdoc} + */ protected $objectClass = 'IslandoraFedoraObject'; /** @@ -179,8 +190,19 @@ class IslandoraRepositoryQuery extends RepositoryQuery {} * Implementation of NewFedoraObject class. */ class IslandoraNewFedoraObject extends NewFedoraObject { + /** + * {@inheritdoc} + */ protected $newFedoraDatastreamClass = 'IslandoraNewFedoraDatastream'; + + /** + * {@inheritdoc} + */ protected $fedoraDatastreamClass = 'IslandoraFedoraDatastream'; + + /** + * {@inheritdoc} + */ protected $fedoraRelsExtClass = 'IslandoraFedoraRelsExt'; } @@ -188,8 +210,19 @@ class IslandoraNewFedoraObject extends NewFedoraObject { * Implementation, magic functions for a FedoraObject class. */ class IslandoraFedoraObject extends FedoraObject { + /** + * {@inheritdoc} + */ protected $newFedoraDatastreamClass = 'IslandoraNewFedoraDatastream'; + + /** + * {@inheritdoc} + */ protected $fedoraDatastreamClass = 'IslandoraFedoraDatastream'; + + /** + * {@inheritdoc} + */ protected $fedoraRelsExtClass = 'IslandoraFedoraRelsExt'; /** @@ -568,7 +601,14 @@ class IslandoraSimpleCache extends SimpleCache {} * Implementation of NewFedoraDatastream class. */ class IslandoraNewFedoraDatastream extends NewFedoraDatastream { + /** + * {@inheritdoc} + */ protected $fedoraRelsIntClass = 'IslandoraFedoraRelsInt'; + + /** + * {@inheritdoc} + */ protected $fedoraDatastreamVersionClass = 'IslandoraFedoraDatastreamVersion'; } @@ -576,7 +616,14 @@ class IslandoraNewFedoraDatastream extends NewFedoraDatastream { * Implementation and magic functions for FedoraDatastream class. */ class IslandoraFedoraDatastream extends FedoraDatastream { + /** + * {@inheritdoc} + */ protected $fedoraRelsIntClass = 'IslandoraFedoraRelsInt'; + + /** + * {@inheritdoc} + */ protected $fedoraDatastreamVersionClass = 'IslandoraFedoraDatastreamVersion'; /** @@ -650,7 +697,14 @@ class IslandoraFedoraDatastream extends FedoraDatastream { * Implementation of FedoraDatastreamVersion class. */ class IslandoraFedoraDatastreamVersion extends FedoraDatastreamVersion { + /** + * {@inheritdoc} + */ protected $fedoraRelsIntClass = 'IslandoraFedoraRelsInt'; + + /** + * {@inheritdoc} + */ protected $fedoraDatastreamVersionClass = 'IslandoraFedoraDatastreamVersion'; } diff --git a/includes/utilities.inc b/includes/utilities.inc index b1405330..10ac2d1f 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -267,9 +267,9 @@ function islandora_escape_pid_for_function($pid) { * below are fine. * * @code - * 'islandora', - * 'islandora:', - * 'islandora:1234', + * 'islandora', + * 'islandora:', + * 'islandora:1234', * @endcode * * @return string @@ -291,9 +291,9 @@ function islandora_get_namespace($id) { * below are fine. * * @code - * 'islandora', - * 'islandora:', - * 'islandora:1234', + * 'islandora', + * 'islandora:', + * 'islandora:1234', * @endcode * * @return bool diff --git a/tests/includes/utilities.inc b/tests/includes/utilities.inc index 2549d21b..9d06ca21 100644 --- a/tests/includes/utilities.inc +++ b/tests/includes/utilities.inc @@ -19,12 +19,32 @@ */ class IslandoraTestUtilities extends IslandoraTestUtilityClass { + /** + * The passed test configuration. + * + * @var array + */ protected $configuration; + /** + * Any additional parameters the method called may need to function. + * + * @var array + */ protected $params; + /** + * An array of IslandoraTestUtilityResults. + * + * @var array + */ public $results = array(); + /** + * The repository used for the tests. + * + * @var FedoraRepository + */ protected $repository; /**