This commit is contained in:
Daniil Gentili 2020-02-12 21:15:22 +01:00
parent afbc6a3e0e
commit c8635c12d6
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -97,7 +97,7 @@ abstract class AbstractAPIFactory extends AsyncConstruct
public function __call(string $name, array $arguments) public function __call(string $name, array $arguments)
{ {
$yielded = Tools::call($this->__call_async($name, $arguments)); $yielded = Tools::call($this->__call_async($name, $arguments));
$async = !$this->lua && (\end($arguments)['async'] ?? ($this->async && $name !== 'loop')); $async = !$this->lua && ((is_array(\end($arguments)) ? \end($arguments) : [])['async'] ?? ($this->async && $name !== 'loop'));
if ($async) { if ($async) {
return $yielded; return $yielded;
} }