-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8653b07
Showing
86 changed files
with
7,589 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
parameters: | ||
level: 5 | ||
paths: | ||
- ../src/ | ||
treatPhpDocTypesAsCertain: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: PHPStan | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
phpstan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
command: update | ||
php_version: "7.4" | ||
|
||
- name: PHPStan Static Analysis | ||
uses: php-actions/phpstan@v3 | ||
with: | ||
configuration: ./.github/phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.buildpath | ||
.project | ||
.settings/ | ||
/vendor/ | ||
/composer.lock | ||
/composer.phar |
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "slub/php-mods-reader", | ||
"description": "Read MODS metadata into PHP objects that offer some convenient data extraction methods", | ||
"type": "library", | ||
"keywords": [ | ||
"mods", | ||
"mods-reader" | ||
], | ||
"require": { | ||
"php": ">=7.4" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~7.5" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Slub\\Mods\\": "src/Mods/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Slub\\Mods\\": "tests/Mods/" | ||
} | ||
}, | ||
"minimum-stability": "stable", | ||
"license": "GPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "Beatrycze Volk", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="MODS Reader Test Suite"> | ||
<directory>./tests/Mods/</directory> | ||
<directory>./tests/Mods/Context</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2024 Saxon State and University Library Dresden | ||
* | ||
* This file is part of the php-mods-reader. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Slub\Mods\Attribute\Common; | ||
|
||
trait AuthorityAttribute | ||
{ | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $authority; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $authorityURI; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $valueURI; | ||
|
||
/** | ||
* Get the value of authority | ||
* | ||
* @return string | ||
*/ | ||
public function getAuthority(): string | ||
{ | ||
return $this->authority; | ||
} | ||
|
||
/** | ||
* Get the value of authorityURI | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getAuthorityURI(): string | ||
{ | ||
return $this->authorityURI; | ||
} | ||
|
||
/** | ||
* Get the value of valueURI | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getValueURI(): string | ||
{ | ||
return $this->valueURI; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2024 Saxon State and University Library Dresden | ||
* | ||
* This file is part of the php-mods-reader. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Slub\Mods\Attribute\Common; | ||
|
||
trait DateAttribute | ||
{ | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $encoding; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $point; | ||
|
||
/** | ||
* @access private | ||
* @var bool | ||
*/ | ||
private bool $keyDate = false; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $qualifier; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $calendar; | ||
|
||
/** | ||
* @access private | ||
* @var array | ||
*/ | ||
private array $allowedEncodings = [ | ||
'w3cdtf', | ||
'iso8601', | ||
'marc', | ||
'edtf', | ||
'temper' | ||
]; | ||
|
||
/** | ||
* @access private | ||
* @var array | ||
*/ | ||
private array $allowedPoints = [ | ||
'start', | ||
'end' | ||
]; | ||
|
||
/** | ||
* @access private | ||
* @var array | ||
*/ | ||
private array $allowedQualifiers = [ | ||
'approximate', | ||
'inferred', | ||
'questionable' | ||
]; | ||
|
||
/** | ||
* Get the value of encoding | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getEncoding(): string | ||
{ | ||
return $this->encoding; | ||
} | ||
|
||
/** | ||
* Get the value of point | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getPoint(): string | ||
{ | ||
return $this->point; | ||
} | ||
|
||
/** | ||
* Get the value of keyDate | ||
* | ||
* @access public | ||
* | ||
* @return bool | ||
*/ | ||
public function isKeyDate(): bool | ||
{ | ||
return $this->keyDate; | ||
} | ||
|
||
/** | ||
* Get the value of qualifier | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getQualifier(): string | ||
{ | ||
return $this->qualifier; | ||
} | ||
|
||
/** | ||
* Get the value of calendar | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getCalendar(): string | ||
{ | ||
return $this->calendar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (C) 2024 Saxon State and University Library Dresden | ||
* | ||
* This file is part of the php-mods-reader. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Slub\Mods\Attribute\Common; | ||
|
||
trait LanguageAttribute | ||
{ | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $lang; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $xmlLang; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $script; | ||
|
||
/** | ||
* @access private | ||
* @var string | ||
*/ | ||
private string $transliteration; | ||
|
||
/** | ||
* Get the value of lang | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getLang(): string | ||
{ | ||
return $this->lang; | ||
} | ||
|
||
/** | ||
* Get the value of xmlLang | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getXmlLang(): string | ||
{ | ||
return $this->xmlLang; | ||
} | ||
|
||
/** | ||
* Get the value of script | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getScript(): string | ||
{ | ||
return $this->script; | ||
} | ||
|
||
/** | ||
* Get the value of transliteration | ||
* | ||
* @access public | ||
* | ||
* @return string | ||
*/ | ||
public function getTransliteration(): string | ||
{ | ||
return $this->transliteration; | ||
} | ||
} |
Oops, something went wrong.