Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 0209a45

Browse files
committed
:octocat:
1 parent 37ab7e1 commit 0209a45

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Core/OAuthProvider.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function __construct(ClientInterface $http, OAuthStorageInterface $storag
133133

134134
$this->serviceName = (new ReflectionClass($this))->getShortName();
135135

136-
if(!empty($this->endpointMap) && class_exists($this->endpointMap)){
136+
if($this instanceof ApiClientInterface && !empty($this->endpointMap) && class_exists($this->endpointMap)){
137137
$this->endpoints = new $this->endpointMap;
138138

139139
if(!$this->endpoints instanceof EndpointMapInterface){
@@ -207,7 +207,11 @@ public function setUriFactory(UriFactoryInterface $uriFactory):OAuthInterface{
207207
*/
208208
public function __call(string $name, array $arguments):ResponseInterface{
209209

210-
if(!$this->endpoints instanceof EndpointMapInterface || !$this->endpoints->__isset($name)){
210+
if(!$this instanceof ApiClientInterface){
211+
throw new ApiClientException('MagicAPI not available');
212+
}
213+
214+
if(!$this->endpoints->__isset($name)){
211215
throw new ApiClientException('endpoint not found');
212216
}
213217

0 commit comments

Comments
 (0)