1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 03:11:12 +01:00

Add support for PHP 8 named arguments

This commit is contained in:
Daniil Gentili 2021-10-12 21:18:53 +02:00
parent 21c6c5bb89
commit 4b3cbeabd4
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

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