diff --git a/README.md b/README.md index f47996aaa..0736e8ec5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Created by Daniil Gen `#StandWithUkraine πŸ‡ΊπŸ‡¦` +[![status-badge](https://ci.daniil.it/api/badges/danog/MadelineProto/status.svg)](https://ci.daniil.it/danog/MadelineProto) + Do join the official channel, [@MadelineProto](https://t.me/MadelineProto) and the [support groups](https://t.me/pwrtelegramgroup)! Approved by Telegram! diff --git a/src/danog/MadelineProto/APIFactory.php b/src/danog/MadelineProto/APIFactory.php index 06773205d..99d929197 100644 --- a/src/danog/MadelineProto/APIFactory.php +++ b/src/danog/MadelineProto/APIFactory.php @@ -20,7 +20,7 @@ declare(strict_types=1); namespace danog\MadelineProto; -abstract class APIFactory extends AbstractAPIFactory +class APIFactory extends AbstractAPIFactory { /** * @internal this is a internal property generated by build_docs.php, don't change manually diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index ffeba4849..007d83161 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -675,9 +675,9 @@ trait PeerHandler * InputUser?: {_: string, user_id?: int, access_hash?: int, min?: bool}, * InputChannel?: {_: string, channel_id: int, access_hash: int, min: bool}, * type: string - * }&array : array) + * }&array : array|int) */ - private function genAll($constructor, $folder_id, int $type): array + private function genAll($constructor, $folder_id, int $type): array|int { if ($type === MTProto::INFO_TYPE_CONSTRUCTOR) { if ($constructor['_'] === 'user') { diff --git a/src/danog/MadelineProto/Stream/Proxy/HttpProxy.php b/src/danog/MadelineProto/Stream/Proxy/HttpProxy.php index fb2b350ac..2dd03941d 100644 --- a/src/danog/MadelineProto/Stream/Proxy/HttpProxy.php +++ b/src/danog/MadelineProto/Stream/Proxy/HttpProxy.php @@ -67,7 +67,7 @@ final class HttpProxy implements RawProxyStreamInterface, BufferedProxyStreamInt $address = $uri->getHost(); $port = $uri->getPort(); try { - if (\strlen(\inet_pton($address)) === 16) { + if (\strlen(\inet_pton($address) ?: '') === 16) { $address = '['.$address.']'; } } catch (Exception) { diff --git a/tests/testing.php b/tests/testing.php index f43472d70..1c2f1f7f0 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -66,18 +66,6 @@ if ($loader) { } } -/* - * Load .env for settings - */ -if (file_exists('.env') && class_exists(Dotenv\Dotenv::class)) { - echo 'Loading .env...'.PHP_EOL; - $dotenv = Dotenv\Dotenv::create(getcwd()); - $dotenv->load(); - if (getenv('TEST_SECRET_CHAT') == '') { - echo('TEST_SECRET_CHAT is not defined in .env, please define it (copy .env.example).'.PHP_EOL); - die(1); - } -} echo 'Loading settings...'.PHP_EOL; $settings = json_decode(getenv('MTPROTO_SETTINGS'), true) ?: [];