diff --git a/.travis.yml b/.travis.yml index 9404f079..3d02d4e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ php: before_install: - echo "phar.readonly = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini +- tests/waitPackagist.php script: - tests/makephar.sh diff --git a/composer.json b/composer.json index ae1046af..36f0cf2c 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "project", "minimum-stability": "dev", "license": "AGPL-3.0-only", - "homepage": "https://daniil.it/MadelineProto", + "homepage": "https://docs.madelineproto.xyz", "keywords": ["telegram", "mtproto", "protocol", "bytes", "messenger", "client", "PHP", "video", "stickers", "audio", "files", "GB"], "conflict": { "krakjoe/pthreads-polyfill": "*" @@ -83,4 +83,4 @@ "docs": "php tools/build_docs.php", "test": "@php -dzend.assertions=1 -dassert.exception=1 ./vendor/bin/phpunit --coverage-text" } -} \ No newline at end of file +} diff --git a/src/BigIntegor.php b/src/BigIntegor.php index 0711c6d1..077a0d91 100644 --- a/src/BigIntegor.php +++ b/src/BigIntegor.php @@ -19,7 +19,7 @@ namespace phpseclib\Math; -if (PHP_MAJOR_VERSION < 7 && !((\class_exists(\Phar::class) && \Phar::running()) || defined('TESTING_VERSIONS'))) { +if (PHP_MAJOR_VERSION < 7 && !((\class_exists(\Phar::class) && \Phar::running()) || \defined('TESTING_VERSIONS'))) { throw new \Exception('MadelineProto requires php 7 to run natively, use phar.madelineproto.xyz to run on PHP 5.6'); } if (\defined('HHVM_VERSION')) { diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 17975823..d99786fc 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -637,9 +637,9 @@ class TL } elseif ($method === 'messages.sendEncryptedFile') { if (isset($arguments['file'])) { if (( - !\is_array($arguments['file']) || + !\is_array($arguments['file']) || !(isset($arguments['file']['_']) && $this->constructors->findByPredicate($arguments['file']['_']) === 'InputEncryptedFile') - ) && + ) && $this->API->settings['upload']['allow_automatic_upload'] ) { $arguments['file'] = yield $this->API->uploadEncrypted($arguments['file']); diff --git a/src/polyfill.php b/src/polyfill.php index ceef0d30..48207388 100644 --- a/src/polyfill.php +++ b/src/polyfill.php @@ -8,16 +8,18 @@ function returnMe($res) { return $res; } -function __coalesce($ifNotNull, $then) { +function __coalesce($ifNotNull, $then) +{ return $ifNotNull ? $ifNotNull : $then; } -function __destructure($list, $value) { +function __destructure($list, $value) +{ $res = []; foreach ($list as $key) { - if (is_string($key)) { + if (\is_string($key)) { $res []= $value[$key]; } else { - $res = array_merge($res, __destructure($key, $value[$key])); + $res = \array_merge($res, __destructure($key, $value[$key])); } } return $res; diff --git a/tests/waitPackagist.php b/tests/waitPackagist.php new file mode 100755 index 00000000..17d729af --- /dev/null +++ b/tests/waitPackagist.php @@ -0,0 +1,10 @@ +#!/usr/bin/env php +