Fix PHPStan false-positive
This commit is contained in:
parent
a2cb531bbc
commit
c2f3e7493e
|
@ -121,7 +121,7 @@ class ListIdentifiers extends Middleware
|
||||||
}
|
}
|
||||||
|
|
||||||
$header = $document->createElement('header');
|
$header = $document->createElement('header');
|
||||||
if ($oaiRecord->getContent() === null) {
|
if (!$oaiRecord->hasContent()) {
|
||||||
$header->setAttribute('status', 'deleted');
|
$header->setAttribute('status', 'deleted');
|
||||||
}
|
}
|
||||||
$baseNode->appendChild($header);
|
$baseNode->appendChild($header);
|
||||||
|
@ -137,11 +137,13 @@ class ListIdentifiers extends Middleware
|
||||||
$header->appendChild($setSpec);
|
$header->appendChild($setSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($verb === 'ListRecords' && $oaiRecord->getContent() !== null) {
|
if ($verb === 'ListRecords' && $oaiRecord->hasContent()) {
|
||||||
$metadata = $document->createElement('metadata');
|
$metadata = $document->createElement('metadata');
|
||||||
$baseNode->appendChild($metadata);
|
$baseNode->appendChild($metadata);
|
||||||
|
|
||||||
$data = $document->importData($oaiRecord->getContent());
|
/** @var string */
|
||||||
|
$content = $oaiRecord->getContent();
|
||||||
|
$data = $document->importData($content);
|
||||||
$metadata->appendChild($data);
|
$metadata->appendChild($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,8 +94,10 @@ class ListSets extends Middleware
|
||||||
$setDescription = $document->createElement('setDescription');
|
$setDescription = $document->createElement('setDescription');
|
||||||
$set->appendChild($setDescription);
|
$set->appendChild($setDescription);
|
||||||
|
|
||||||
$description = $document->importData($oaiSet->getDescription());
|
/** @var string */
|
||||||
$setDescription->appendChild($description);
|
$description = $oaiSet->getDescription();
|
||||||
|
$data = $document->importData($description);
|
||||||
|
$setDescription->appendChild($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue