Replace deprecated getObject with getObjectNode
This commit is contained in:
@@ -59,7 +59,7 @@ class CryptoHelper {
|
||||
|
||||
$this->objectRetriever = $objectRetriever;
|
||||
$this->namespace = isset($namespaceCoid)
|
||||
? $objectRetriever->getObject($namespaceCoid)
|
||||
? $objectRetriever->getObjectNode($namespaceCoid)
|
||||
: $objectRetriever->getAuthenticatingNamespaceObject();
|
||||
|
||||
$this->reader = new NodeReader([
|
||||
|
||||
@@ -50,7 +50,7 @@ class SharedSecretAuthentication {
|
||||
return self::RESULT_INVALID_PASSWORD;
|
||||
|
||||
// Retrieve namespace
|
||||
$namespace = $retriever->getObject($namespaceCoid);
|
||||
$namespace = $retriever->getObjectNode($namespaceCoid);
|
||||
if (!isset($namespace))
|
||||
return self::RESULT_NAMESPACE_NOT_FOUND;
|
||||
|
||||
@@ -87,7 +87,7 @@ class SharedSecretAuthentication {
|
||||
return self::RESULT_INVALID_PASSWORD;
|
||||
|
||||
// Retrieve namespace
|
||||
$namespace = $this->objectRetriever->getObject($namespaceCoid);
|
||||
$namespace = $this->objectRetriever->getObjectNode($namespaceCoid);
|
||||
if (!isset($namespace))
|
||||
return self::RESULT_NAMESPACE_NOT_FOUND;
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class SchemaValidator {
|
||||
* @param Node $node The COID of the specification.
|
||||
*/
|
||||
public function validateAgainstCOID($data, IRI $coid) {
|
||||
$object = $this->objectRetriever->getObject($coid);
|
||||
$object = $this->objectRetriever->getObjectNode($coid);
|
||||
Assert::true($this->reader->hasType($object, 'json:Element'),
|
||||
"You can only validate data against JSON elements!");
|
||||
$this->validateAgainstNode($data, $object);
|
||||
|
||||
@@ -157,7 +157,7 @@ class APIClientFactory {
|
||||
if ($this->reader->hasProperty($api, 'oauth2:hasAuthorizationServer')) {
|
||||
// We have an authorization server for this endpoint/API
|
||||
$authServerCoid = $this->reader->getFirstValueIRI($api, 'oauth2:hasAuthorizationServer');
|
||||
$authServerObject = $this->objectRetriever->getObject($authServerCoid);
|
||||
$authServerObject = $this->objectRetriever->getObjectNode($authServerCoid);
|
||||
if (!isset($authServerObject))
|
||||
throw new InvalidObjectConfigurationException("Authorization server object <"
|
||||
. (string)$authServerCoid . "> not available.");
|
||||
@@ -220,7 +220,7 @@ class APIClientFactory {
|
||||
public function __construct(ObjectRetriever $objectRetriever, IRI $namespaceCoid = null) {
|
||||
$this->objectRetriever = $objectRetriever;
|
||||
$this->namespace = isset($namespaceCoid)
|
||||
? $objectRetriever->getObject($namespaceCoid)
|
||||
? $objectRetriever->getObjectNode($namespaceCoid)
|
||||
: $objectRetriever->getAuthenticatingNamespaceObject();
|
||||
|
||||
$this->reader = new NodeReader([
|
||||
@@ -242,7 +242,7 @@ class APIClientFactory {
|
||||
public function getClientWithCOID(IRI $apiCoid, bool $specificClient = false) {
|
||||
$idString = (string)$apiCoid.(string)$specificClient;
|
||||
if (!isset($this->apiClients[$idString])) {
|
||||
$object = $this->objectRetriever->getObject($apiCoid);
|
||||
$object = $this->objectRetriever->getObjectNode($apiCoid);
|
||||
if (!isset($object))
|
||||
throw new CoreAPIException("Could not retrieve API <".(string)$apiCoid.">.");
|
||||
$this->apiClients[$idString] = $this->createClient($object, $specificClient);
|
||||
|
||||
Reference in New Issue
Block a user