Skip to content

Commit

Permalink
Upgrade to PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ipf committed Apr 3, 2023
1 parent c66bc35 commit 3ede0ab
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .php-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4
8.1
64 changes: 31 additions & 33 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
{
"name": "subugoe/oai-model",
"description": "OAI-PMH Model",
"type": "library",
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.8",
"rector/rector": "^0.14",
"phpstan/phpstan": "^1.7"
},
"license": "AGPL-3.0-or-later",
"autoload": {
"psr-4": {
"Subugoe\\OaiModel\\": "src/"
"name": "subugoe/oai-model",
"description": "OAI-PMH Model",
"type": "library",
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.8",
"rector/rector": "^0.15.23",
"phpstan/phpstan": "^1.7"
},
"license": "AGPL-3.0-or-later",
"autoload": {
"psr-4": {
"Subugoe\\OaiModel\\": "src/"
}
},
"authors": [{
"name": "Ingo Pfennigstorf",
"email": "[email protected]"
}],
"require": {
"php": "^8.0",
"jms/serializer": "^3.17",
"subugoe/iiif-model": "^0.2.4",
"doctrine/collections": "^2.0"
},
"scripts": {
"lint": [
"php-cs-fixer fix --dry-run",
"rector process --dry-run",
"phpstan analyze src --level=5"
]
}
},
"authors": [
{
"name": "Ingo Pfennigstorf",
"email": "[email protected]"
}
],
"require": {
"php": "^7.4 || ^8.0 || ^8.1",
"jms/serializer": "^3.17",
"subugoe/iiif-model": "^0.2.4",
"doctrine/collections": "^1.6"
},
"scripts": {
"lint": [
"php-cs-fixer fix --dry-run",
"rector process --dry-run",
"phpstan analyze src --level=5"
]
}
}
}
4 changes: 2 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
use Rector\Set\ValueObject\SetList;

return static function (Rector\Config\RectorConfig $containerConfigurator): void {
$containerConfigurator->disableImportShortClasses();
$containerConfigurator->importShortClasses(false);

$containerConfigurator->sets([
SetList::PHP_74,
SetList::PHP_80,
SetList::CODING_STYLE,
SetList::CODE_QUALITY,
]);
Expand Down
3 changes: 3 additions & 0 deletions src/Model/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class Collection

/**
* @Serializer\Expose()
*
* @Serializer\SerializedName("setSpec")
*
* @Serializer\XmlElement(cdata=false)
*/
private ?string $id = null;
Expand All @@ -28,6 +30,7 @@ class Collection

/**
* @Serializer\Expose()
*
* @Serializer\SerializedName("setName")
*/
private ?string $label = null;
Expand Down
1 change: 1 addition & 0 deletions src/Model/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Error

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\Inline()
*/
private string $message;
Expand Down
6 changes: 6 additions & 0 deletions src/Model/Identify/Identification.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ class Identification
{
/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("adminEmail")
*/
private ?string $adminEmail = null;

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("baseURL")
*/
private ?string $baseUrl = null;

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("deletedRecord")
*/
private ?string $deletedRecord = null;
Expand All @@ -28,6 +31,7 @@ class Identification

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("earliestDatestamp")
*/
private ?\DateTimeImmutable $earliestDatestamp = null;
Expand All @@ -39,12 +43,14 @@ class Identification

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("protocolVersion")
*/
private ?string $protocolVersion = null;

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("repositoryName")
*/
private ?string $repositoryName = null;
Expand Down
5 changes: 5 additions & 0 deletions src/Model/Identify/OaiIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,28 @@ class OaiIdentifier

/**
* @Serializer\SerializedName("xmlns")
*
* @Serializer\XmlAttribute
*/
private ?string $namespace = null;

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("repositoryIdentifier")
*/
private ?string $repositoryIdentifier = null;

/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("sampleIdentifier")
*/
private ?string $sampleIdentifier = null;

/**
* @Serializer\SerializedName("xsi:schemaLocation")
*
* @Serializer\XmlAttribute
*/
private ?string $schemaLocation = null;
Expand All @@ -42,6 +46,7 @@ class OaiIdentifier

/**
* @Serializer\SerializedName("xmlns:xsi")
*
* @Serializer\XmlAttribute
*/
private ?string $xsi = null;
Expand Down
1 change: 1 addition & 0 deletions src/Model/ListRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ListRecords
{
/**
* @Serializer\SerializedName("Record")
*
* @Serializer\XmlList(inline = true, entry = "record")
*/
private \Doctrine\Common\Collections\Collection $records;
Expand Down
1 change: 1 addition & 0 deletions src/Model/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Metadata
{
/**
* @Serializer\XmlList(inline = true, entry = "date")
*
* @Serializer\Type("ArrayCollection<string>")
*/
private \Doctrine\Common\Collections\Collection $dates;
Expand Down
2 changes: 2 additions & 0 deletions src/Model/MetadataFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ class MetadataFormat
{
/**
* @Serializer\SerializedName("metadataNamespace")
*
* @Serializer\XmlElement(cdata=false)
*/
private ?string $namespace = null;

/**
* @Serializer\SerializedName("metadataPrefix")
*
* @Serializer\XmlElement(cdata=false)
*/
private ?string $prefix = null;
Expand Down
1 change: 1 addition & 0 deletions src/Model/MetadataFormats.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class MetadataFormats extends Oai
{
/**
* @Serializer\SerializedName("ListMetadataFormats")
*
* @Serializer\XmlList(entry = "metadataFormat")
*/
private ?array $metadataFormats = null;
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Oai.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* @Serializer\XmlRoot("OAI-PMH")
*
* @Serializer\XmlNamespace(uri="https://www.openarchives.org/OAI/2.0/")
* @Serializer\XmlNamespace(uri="http://www.w3.org/2001/XMLSchema-instance", prefix="xsi")
* @Serializer\XmlNamespace(uri="https://www.openarchives.org/OAI/2.0/OAI-PMH.xsd", prefix="schemaLocation")
Expand All @@ -14,6 +15,7 @@ class Oai
{
/**
* @Serializer\XmlElement(cdata=false)
*
* @Serializer\SerializedName("responseDate")
*/
private ?\DateTimeImmutable $date = null;
Expand Down
1 change: 1 addition & 0 deletions src/Model/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Request

/**
* @Serializer\XmlValue
*
* @Serializer\XmlElement(cdata=false)
*/
private ?string $url = null;
Expand Down
2 changes: 2 additions & 0 deletions src/Model/ResumptionToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ResumptionToken
{
/**
* @Serializer\XmlAttribute
*
* @Serializer\SerializedName("completeListSize")
*/
private int $completeListSize;
Expand All @@ -21,6 +22,7 @@ class ResumptionToken

/**
* @Serializer\XmlAttribute
*
* @Serializer\SerializedName("expirationDate")
*/
private \DateTimeInterface $expirationDate;
Expand Down
1 change: 1 addition & 0 deletions src/Model/Sets.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Sets extends Oai
{
/**
* @Serializer\SerializedName("ListSets")
*
* @Serializer\XmlList(inline = false, entry = "set")
*/
private ?array $sets = null;
Expand Down

0 comments on commit 3ede0ab

Please sign in to comment.