We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 51dea6d + 1aac4a9 commit d9c45f4Copy full SHA for d9c45f4
lib/Bitbucket/API/Api.php
@@ -207,11 +207,15 @@ public function api($name)
207
throw new \InvalidArgumentException('No child specified.');
208
}
209
210
- /** @var Api $child */
211
- $class = '\\Bitbucket\\API\\'.$name;
+ if (class_exists($name)) {
+ $class = $name;
212
+ } else {
213
+ /** @var Api $child */
214
+ $class = '\\Bitbucket\\API\\'.$name;
215
- if (!class_exists($class)) {
- throw new \InvalidArgumentException(sprintf('No such child class [%s].', $name));
216
+ if (!class_exists($class)) {
217
+ throw new \InvalidArgumentException(sprintf('No such child class [%s].', $name));
218
+ }
219
220
221
$child = new $class();
0 commit comments