Skip to content

Commit

Permalink
PHP 8.4 depraction fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Sep 26, 2024
1 parent 3e85bc3 commit 64060ae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/acdhOeaw/arche/oaipmh/data/HeaderData.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class HeaderData {
* - date - an OAI-PMH record datestamp field
* - deleted - if an object is deleted (presence of a field means deletion)
* - sets - a list of OAI-PMH sets a record belongs to
* @param object $src data to copy from
* @param object|null $src data to copy from
*/
public function __construct(object $src = null) {
public function __construct(?object $src = null) {
if ($src === null) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/acdhOeaw/arche/oaipmh/data/MetadataFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ class MetadataFormat extends \stdClass {
* Creates a metadata format descriptor
* @param object $fields values to set in the descriptor
*/
public function __construct(object $fields = null) {
foreach ($fields as $k => $v) {
public function __construct(object $fields = []) {
foreach ((array) $fields as $k => $v) {
$this->$k = is_array($this->$k ?? null) ? (array) $v : $v;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/acdhOeaw/arche/oaipmh/data/RepositoryInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class RepositoryInfo {
* @param object $param property values
*/
public function __construct(object $param) {
foreach ($param as $k => $v) {
foreach ((array) $param as $k => $v) {
if (isset($this->$k)) {
$this->$k = $v;
}
Expand Down
11 changes: 5 additions & 6 deletions src/acdhOeaw/arche/oaipmh/data/SetInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,30 @@ class SetInfo {
* Set spec - see the OAI-PMH documentation
* @var string
*/
public $spec;
public string $spec;

/**
* Set name - see the OAI-PMH documentation
* @var string
*/
public $name;
public string $name;

/**
* Set metadata to be put inside a <setDescription>
* @var ?DOMElement
*/
public $description;
public DOMElement | null $description;

/**
* Creates a set descriptor object by copying provided values.
* @param string $spec setSpec value
* @param string $name setName value
* @param DOMElement $description XML containing setDescription
* @param DOMElement|null $description XML containing setDescription
*/
public function __construct(string $spec, string $name,
DOMElement $description = null) {
?DOMElement $description = null) {
$this->spec = $spec;
$this->name = $name;
$this->description = $description;
}

}

0 comments on commit 64060ae

Please sign in to comment.