From fd1266f3ab0a942caeb48a07e012284a7e0ec5fc Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Fri, 21 Jun 2024 17:31:22 +0200 Subject: [PATCH] Minor improvements in attribute's classes --- src/Mods/Attribute/Common/AuthorityAttribute.php | 11 ++++++++--- src/Mods/Attribute/Common/DateAttribute.php | 5 +---- src/Mods/Attribute/Common/LanguageAttribute.php | 14 +++++++++----- .../Common/Linking/AltRepGroupAttribute.php | 4 +++- src/Mods/Attribute/Common/Linking/IdAttribute.php | 8 +++++--- .../Common/Linking/NameTitleGroupAttribute.php | 3 ++- .../Common/Linking/XlinkHrefAttribute.php | 3 ++- .../Common/Miscellaneous/AltFormatAttribute.php | 3 ++- .../Common/Miscellaneous/ContentTypeAttribute.php | 5 +++-- .../Common/Miscellaneous/DisplayLabelAttribute.php | 3 ++- .../Common/Miscellaneous/ShareableAttribute.php | 3 ++- .../Common/Miscellaneous/SuppliedAttribute.php | 5 +++-- .../Common/Miscellaneous/TypeUriAttribute.php | 3 ++- .../Common/Miscellaneous/UsageAttribute.php | 1 - src/Mods/Attribute/Specific/InvalidAttribute.php | 3 ++- src/Mods/Attribute/Specific/OtherTypeAttribute.php | 12 ++++++++---- src/Mods/Attribute/Specific/TypeAttribute.php | 2 +- 17 files changed, 55 insertions(+), 33 deletions(-) diff --git a/src/Mods/Attribute/Common/AuthorityAttribute.php b/src/Mods/Attribute/Common/AuthorityAttribute.php index 9089841..c742989 100644 --- a/src/Mods/Attribute/Common/AuthorityAttribute.php +++ b/src/Mods/Attribute/Common/AuthorityAttribute.php @@ -16,7 +16,10 @@ trait AuthorityAttribute { /** - * Get the value of authority + * Get the value of the 'authority' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#authority + * + * @access public * * @return string */ @@ -26,7 +29,8 @@ public function getAuthority(): string } /** - * Get the value of authorityURI + * Get the value of the 'authorityURI' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#authorityURI * * @access public * @@ -38,7 +42,8 @@ public function getAuthorityURI(): string } /** - * Get the value of valueURI + * Get the value of the 'valueURI' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#valueURI * * @access public * diff --git a/src/Mods/Attribute/Common/DateAttribute.php b/src/Mods/Attribute/Common/DateAttribute.php index 8eb03db..f185a3f 100644 --- a/src/Mods/Attribute/Common/DateAttribute.php +++ b/src/Mods/Attribute/Common/DateAttribute.php @@ -18,7 +18,6 @@ trait DateAttribute { /** - * @access private * @var array */ private array $allowedEncodings = [ @@ -30,7 +29,6 @@ trait DateAttribute ]; /** - * @access private * @var array */ private array $allowedPoints = [ @@ -39,7 +37,6 @@ trait DateAttribute ]; /** - * @access private * @var array */ private array $allowedQualifiers = [ @@ -110,7 +107,7 @@ public function isKeyDate(): bool * @access public * * @return string - * + * * @throws IncorrectValueInAttributeException */ public function getQualifier(): string diff --git a/src/Mods/Attribute/Common/LanguageAttribute.php b/src/Mods/Attribute/Common/LanguageAttribute.php index 6f52b64..5278b87 100644 --- a/src/Mods/Attribute/Common/LanguageAttribute.php +++ b/src/Mods/Attribute/Common/LanguageAttribute.php @@ -16,7 +16,8 @@ trait LanguageAttribute { /** - * Get the value of lang + * Get the value of the 'lang' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#lang * * @access public * @@ -28,7 +29,8 @@ public function getLang(): string } /** - * Get the value of xmlLang + * Get the value of the 'xml:lang' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#xml:lang * * @access public * @@ -36,11 +38,12 @@ public function getLang(): string */ public function getXmlLang(): string { - return $this->getStringAttribute('xmlLang'); + return $this->getStringAttribute('xml:lang'); } /** - * Get the value of script + * Get the value of the 'script' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#script * * @access public * @@ -52,7 +55,8 @@ public function getScript(): string } /** - * Get the value of transliteration + * Get the value of the 'transliteration' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#transliteration * * @access public * diff --git a/src/Mods/Attribute/Common/Linking/AltRepGroupAttribute.php b/src/Mods/Attribute/Common/Linking/AltRepGroupAttribute.php index 373c7de..3ab3252 100644 --- a/src/Mods/Attribute/Common/Linking/AltRepGroupAttribute.php +++ b/src/Mods/Attribute/Common/Linking/AltRepGroupAttribute.php @@ -16,7 +16,9 @@ trait AltRepGroupAttribute { /** - * Get used to link alternative representations of the same element content, for different languages, scripts, transliterations, and translations + * Get used to link alternative representations of the same element content, + * for different languages, scripts, transliterations, and translations. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#altRepGroup * * @access public * diff --git a/src/Mods/Attribute/Common/Linking/IdAttribute.php b/src/Mods/Attribute/Common/Linking/IdAttribute.php index 385176d..c6223db 100644 --- a/src/Mods/Attribute/Common/Linking/IdAttribute.php +++ b/src/Mods/Attribute/Common/Linking/IdAttribute.php @@ -16,7 +16,8 @@ trait IdAttribute { /** - * Get the value of id + * Get the value of the 'ID' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#ID * * @access public * @@ -27,8 +28,9 @@ public function getId(): string return $this->getStringAttribute('ID'); } - /** - * Get the value of idRef + /** + * Get the value of the 'IDREF' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#IDREF * * @access public * diff --git a/src/Mods/Attribute/Common/Linking/NameTitleGroupAttribute.php b/src/Mods/Attribute/Common/Linking/NameTitleGroupAttribute.php index 9b6d531..8440661 100644 --- a/src/Mods/Attribute/Common/Linking/NameTitleGroupAttribute.php +++ b/src/Mods/Attribute/Common/Linking/NameTitleGroupAttribute.php @@ -16,7 +16,8 @@ trait NameTitleGroupAttribute { /** - * Get used with and to link a name and a title + * Get used with and to link a name and a title. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#nameTitleGroup * * @access public * diff --git a/src/Mods/Attribute/Common/Linking/XlinkHrefAttribute.php b/src/Mods/Attribute/Common/Linking/XlinkHrefAttribute.php index 551fca0..64fabda 100644 --- a/src/Mods/Attribute/Common/Linking/XlinkHrefAttribute.php +++ b/src/Mods/Attribute/Common/Linking/XlinkHrefAttribute.php @@ -16,7 +16,8 @@ trait XlinkHrefAttribute { /** - * Get the value of xlinkHref + * Get the value of the 'xlink:href' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#xlink:href * * @access public * diff --git a/src/Mods/Attribute/Common/Miscellaneous/AltFormatAttribute.php b/src/Mods/Attribute/Common/Miscellaneous/AltFormatAttribute.php index 3dfebf4..00154c1 100644 --- a/src/Mods/Attribute/Common/Miscellaneous/AltFormatAttribute.php +++ b/src/Mods/Attribute/Common/Miscellaneous/AltFormatAttribute.php @@ -19,7 +19,8 @@ trait AltFormatAttribute { /** - * Get the value of alternative format + * Get the value of the 'altFormat' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#altFormat * * @access public * diff --git a/src/Mods/Attribute/Common/Miscellaneous/ContentTypeAttribute.php b/src/Mods/Attribute/Common/Miscellaneous/ContentTypeAttribute.php index 2dd1dcc..737bc5a 100644 --- a/src/Mods/Attribute/Common/Miscellaneous/ContentTypeAttribute.php +++ b/src/Mods/Attribute/Common/Miscellaneous/ContentTypeAttribute.php @@ -13,13 +13,14 @@ namespace Slub\Mods\Attribute\Common\Miscellaneous; /** - * Trait for displayLabel common attribute + * Trait for contentType common attribute */ trait ContentTypeAttribute { /** - * Get the value of contentType + * Get the value of the 'contentType' attribute. + * @see @see https://www.loc.gov/standards/mods/userguide/attributes.html#altFormat * * @access public * diff --git a/src/Mods/Attribute/Common/Miscellaneous/DisplayLabelAttribute.php b/src/Mods/Attribute/Common/Miscellaneous/DisplayLabelAttribute.php index d8f6d90..9b6329a 100644 --- a/src/Mods/Attribute/Common/Miscellaneous/DisplayLabelAttribute.php +++ b/src/Mods/Attribute/Common/Miscellaneous/DisplayLabelAttribute.php @@ -19,7 +19,8 @@ trait DisplayLabelAttribute { /** - * Get the value of displayLabel + * Get the value of the 'displayLabel' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#displayLabel * * @access public * diff --git a/src/Mods/Attribute/Common/Miscellaneous/ShareableAttribute.php b/src/Mods/Attribute/Common/Miscellaneous/ShareableAttribute.php index fb48678..9591c8c 100644 --- a/src/Mods/Attribute/Common/Miscellaneous/ShareableAttribute.php +++ b/src/Mods/Attribute/Common/Miscellaneous/ShareableAttribute.php @@ -19,7 +19,8 @@ trait ShareableAttribute { /** - * Get the value of shareable + * Get the value of the 'shareable' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#shareable * * @access public * diff --git a/src/Mods/Attribute/Common/Miscellaneous/SuppliedAttribute.php b/src/Mods/Attribute/Common/Miscellaneous/SuppliedAttribute.php index 00c0d6e..31d1308 100644 --- a/src/Mods/Attribute/Common/Miscellaneous/SuppliedAttribute.php +++ b/src/Mods/Attribute/Common/Miscellaneous/SuppliedAttribute.php @@ -19,7 +19,8 @@ trait SuppliedAttribute { /** - * Get the value of supplied + * Get the value of the 'supplied' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#supplied * * @access public * @@ -27,6 +28,6 @@ trait SuppliedAttribute */ public function isSupplied(): bool { - return !empty($this->xml->attributes()->shareable); + return !empty($this->xml->attributes()->supplied); } } diff --git a/src/Mods/Attribute/Common/Miscellaneous/TypeUriAttribute.php b/src/Mods/Attribute/Common/Miscellaneous/TypeUriAttribute.php index 2b9d905..c229031 100644 --- a/src/Mods/Attribute/Common/Miscellaneous/TypeUriAttribute.php +++ b/src/Mods/Attribute/Common/Miscellaneous/TypeUriAttribute.php @@ -19,7 +19,8 @@ trait TypeUriAttribute { /** - * Get the value of type URI + * Get the value of the 'typeURI' attribute. + * @see https://www.loc.gov/standards/mods/userguide/attributes.html#typeURI * * @access public * diff --git a/src/Mods/Attribute/Common/Miscellaneous/UsageAttribute.php b/src/Mods/Attribute/Common/Miscellaneous/UsageAttribute.php index 51bc020..b923074 100644 --- a/src/Mods/Attribute/Common/Miscellaneous/UsageAttribute.php +++ b/src/Mods/Attribute/Common/Miscellaneous/UsageAttribute.php @@ -21,7 +21,6 @@ trait UsageAttribute { /** - * @access private * @var array */ private array $allowedUsages = [ diff --git a/src/Mods/Attribute/Specific/InvalidAttribute.php b/src/Mods/Attribute/Specific/InvalidAttribute.php index a88d413..12549ef 100644 --- a/src/Mods/Attribute/Specific/InvalidAttribute.php +++ b/src/Mods/Attribute/Specific/InvalidAttribute.php @@ -19,7 +19,8 @@ trait InvalidAttribute { /** - * Get the value of invalid + * Get the value of the 'invalid' attribute. + * @see https://www.loc.gov/standards/mods/userguide/identifier.html#invalid * * @access public * diff --git a/src/Mods/Attribute/Specific/OtherTypeAttribute.php b/src/Mods/Attribute/Specific/OtherTypeAttribute.php index c6fde11..9c2170c 100644 --- a/src/Mods/Attribute/Specific/OtherTypeAttribute.php +++ b/src/Mods/Attribute/Specific/OtherTypeAttribute.php @@ -19,7 +19,8 @@ trait OtherTypeAttribute { /** - * Get the value of otherType + * Get the value of the 'otherType' attribute. + * @see https://www.loc.gov/standards/mods/userguide/relateditem.html#othertype * * @access public * @@ -31,7 +32,8 @@ public function getOtherType(): string } /** - * Get the value of otherTypeAuth + * Get the value of the 'otherTypeAuth' attribute. + * @see https://www.loc.gov/standards/mods/userguide/relateditem.html#othertypeauth * * @access public * @@ -43,7 +45,8 @@ public function getOtherTypeAuth(): string } /** - * Get the value of otherTypeAuthURI + * Get the value of the 'otherTypeAuthURI' attribute. + * @see https://www.loc.gov/standards/mods/userguide/relateditem.html#othertypeauthuri * * @access public * @@ -55,7 +58,8 @@ public function getOtherTypeAuthURI(): string } /** - * Get the value of otherTypeURI + * Get the value of the 'otherTypeURI' attribute. + * @see https://www.loc.gov/standards/mods/userguide/relateditem.html#othertypeuri * * @access public * diff --git a/src/Mods/Attribute/Specific/TypeAttribute.php b/src/Mods/Attribute/Specific/TypeAttribute.php index 1145974..5d175cb 100644 --- a/src/Mods/Attribute/Specific/TypeAttribute.php +++ b/src/Mods/Attribute/Specific/TypeAttribute.php @@ -21,7 +21,6 @@ trait TypeAttribute { /** - * @access private * @var array */ private array $allowedTypes = [ @@ -31,6 +30,7 @@ trait TypeAttribute /** * Get the value of the 'type' attribute. + * @see https://www.loc.gov/standards/mods/userguide/origininfo.html#placeTermtype * * @access public *