Fixed return type hints to not fail when objects are null
This commit is contained in:
@@ -206,7 +206,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
|
||||
/**
|
||||
* Get an object description and return a CloudObject.
|
||||
*/
|
||||
public function getCloudObject(IRI $coid) : CloudObject {
|
||||
public function getCloudObject(IRI $coid) : ?CloudObject {
|
||||
$node = $this->getObjectNode($coid);
|
||||
if (!$node) {
|
||||
// Object not found
|
||||
@@ -239,7 +239,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
|
||||
* @param IRI $coid COID of the object
|
||||
* @return Node|null
|
||||
*/
|
||||
public function getObjectNode(IRI $coid) : Node {
|
||||
public function getObjectNode(IRI $coid) : ?Node {
|
||||
if (!COIDParser::isValidCOID($coid))
|
||||
throw new Exception("Not a valid COID.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user