Skip to content

Commit

Permalink
Minor improvements in attribute's classes
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Jun 21, 2024
1 parent b80bef9 commit fd1266f
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 33 deletions.
11 changes: 8 additions & 3 deletions src/Mods/Attribute/Common/AuthorityAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*
Expand All @@ -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
*
Expand Down
5 changes: 1 addition & 4 deletions src/Mods/Attribute/Common/DateAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ trait DateAttribute
{

/**
* @access private
* @var array
*/
private array $allowedEncodings = [
Expand All @@ -30,7 +29,6 @@ trait DateAttribute
];

/**
* @access private
* @var array
*/
private array $allowedPoints = [
Expand All @@ -39,7 +37,6 @@ trait DateAttribute
];

/**
* @access private
* @var array
*/
private array $allowedQualifiers = [
Expand Down Expand Up @@ -110,7 +107,7 @@ public function isKeyDate(): bool
* @access public
*
* @return string
*
*
* @throws IncorrectValueInAttributeException
*/
public function getQualifier(): string
Expand Down
14 changes: 9 additions & 5 deletions src/Mods/Attribute/Common/LanguageAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -28,19 +29,21 @@ 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
*
* @return 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
*
Expand All @@ -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
*
Expand Down
4 changes: 3 additions & 1 deletion src/Mods/Attribute/Common/Linking/AltRepGroupAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
8 changes: 5 additions & 3 deletions src/Mods/Attribute/Common/Linking/IdAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ trait NameTitleGroupAttribute
{

/**
* Get used with <name> and <titleInfo> to link a name and a title
* Get used with <name> and <titleInfo> to link a name and a title.
* @see https://www.loc.gov/standards/mods/userguide/attributes.html#nameTitleGroup
*
* @access public
*
Expand Down
3 changes: 2 additions & 1 deletion src/Mods/Attribute/Common/Linking/XlinkHrefAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
5 changes: 3 additions & 2 deletions src/Mods/Attribute/Common/Miscellaneous/SuppliedAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ 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
*
* @return bool
*/
public function isSupplied(): bool
{
return !empty($this->xml->attributes()->shareable);
return !empty($this->xml->attributes()->supplied);
}
}
3 changes: 2 additions & 1 deletion src/Mods/Attribute/Common/Miscellaneous/TypeUriAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
1 change: 0 additions & 1 deletion src/Mods/Attribute/Common/Miscellaneous/UsageAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ trait UsageAttribute
{

/**
* @access private
* @var array
*/
private array $allowedUsages = [
Expand Down
3 changes: 2 additions & 1 deletion src/Mods/Attribute/Specific/InvalidAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
12 changes: 8 additions & 4 deletions src/Mods/Attribute/Specific/OtherTypeAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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
*
Expand All @@ -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
*
Expand All @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/Mods/Attribute/Specific/TypeAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ trait TypeAttribute
{

/**
* @access private
* @var array
*/
private array $allowedTypes = [
Expand All @@ -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
*
Expand Down

0 comments on commit fd1266f

Please sign in to comment.