Fixed return type hints to not fail when objects are null

This commit is contained in:
2026-06-12 17:30:25 +00:00
parent cb03c811ef
commit 69a16e64d1

View File

@@ -206,7 +206,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
/** /**
* Get an object description and return a CloudObject. * Get an object description and return a CloudObject.
*/ */
public function getCloudObject(IRI $coid) : CloudObject { public function getCloudObject(IRI $coid) : ?CloudObject {
$node = $this->getObjectNode($coid); $node = $this->getObjectNode($coid);
if (!$node) { if (!$node) {
// Object not found // Object not found
@@ -239,7 +239,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
* @param IRI $coid COID of the object * @param IRI $coid COID of the object
* @return Node|null * @return Node|null
*/ */
public function getObjectNode(IRI $coid) : Node { public function getObjectNode(IRI $coid) : ?Node {
if (!COIDParser::isValidCOID($coid)) if (!COIDParser::isValidCOID($coid))
throw new Exception("Not a valid COID."); throw new Exception("Not a valid COID.");