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.
|
* 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.");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user