From 1cd7a593b1263a94744d4414df683cdec6f32563 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 21:27:19 +0400 Subject: [PATCH 01/63] Initial commit --- .gitignore | 6 ++++++ LICENSE | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c422267 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +composer.phar +/vendor/ + +# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9095007 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 PHP Telegram Bot + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 02b0404f2060b080bbd7193e925ff40fc8cb4c11 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 22:15:15 +0400 Subject: [PATCH 02/63] Initial commit --- .editorconfig | 20 + .gitignore | 33 +- .scrutinizer.yml | 3 + .travis.yml | 33 + CONTRIBUTING.md | 27 + CREDITS | 14 + LICENSE => LICENSE.md | 5 +- README.md | 28 + composer.json | 60 + composer.lock | 3745 +++++++++++++++++ phpcs.xml | 7 + phpunit.xml.dist | 44 + src/Laravel/PhpTelegramBot.php | 18 + src/Laravel/PhpTelegramBotContract.php | 16 + src/Laravel/PhpTelegramBotServiceProvider.php | 69 + src/config/config.php | 17 + src/database/migrations/migration.php | 1 + tests/Bootstrap.php | 38 + 18 files changed, 4172 insertions(+), 6 deletions(-) create mode 100644 .editorconfig create mode 100644 .scrutinizer.yml create mode 100644 .travis.yml create mode 100644 CONTRIBUTING.md create mode 100644 CREDITS rename LICENSE => LICENSE.md (87%) create mode 100644 README.md create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 phpcs.xml create mode 100644 phpunit.xml.dist create mode 100644 src/Laravel/PhpTelegramBot.php create mode 100644 src/Laravel/PhpTelegramBotContract.php create mode 100644 src/Laravel/PhpTelegramBotServiceProvider.php create mode 100644 src/config/config.php create mode 100644 src/database/migrations/migration.php create mode 100644 tests/Bootstrap.php diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..660dccf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_style = space +indent_size = 2 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab diff --git a/.gitignore b/.gitignore index c422267..a63a9b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,31 @@ +# IDE & System Related Files # +.buildpath +.project +.settings +.DS_Store +.idea +.phpintel composer.phar -/vendor/ -# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock +# Local System Files (i.e. cache, logs, etc.) # +/cache +/build/logs +/build/coverage +/tmp + +# Test Related Files # +/phpunit.xml + +# Composer +vendor/ + +.fuse_hidden* + +# phpDocumentor Logs # +phpdoc-* + +# OSX # +._* +.Spotlight-V100 +.Trashes +_ide_helper.php diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 0000000..6dd940c --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,3 @@ +tools: + external_code_coverage: + timeout: 600 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..088cd93 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +language: php + +php: + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - 7.2 + +sudo: false + +before_install: + - composer self-update + +install: + - travis_retry composer update --no-interaction --prefer-source + +script: + - ./vendor/bin/phpcs --standard=phpcs.xml -spn --encoding=utf-8 src/ --report-width=150 + - ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml + + +after_script: + - wget https://scrutinizer-ci.com/ocular.phar + - then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + +matrix: + fast_finish: true + + +notifications: + on_success: never + on_failure: always diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0609226 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +Contributing +------------- + +Before you contribute code to this project, please make sure it conforms to the PSR-2 coding standard +and that the project unit tests still pass. The easiest way to contribute is to work on a checkout of the repository, +or your own fork. If you do this, you can run the following commands to check if everything is ready to submit: + + cd project + composer update + ./vendor/bin/phpcs --standard=phpcs.xml -spn --encoding=utf-8 src/ --report-width=150 + +Which should give you no output, indicating that there are no coding standard errors. And then: + + ./vendor/bin/phpunit + +Which should give you no failures or errors. You can ignore any skipped tests as these are for external tools. + +Pushing +------- + +Development is based on the git flow branching model (see http://nvie.com/posts/a-successful-git-branching-model/ ) +If you fix a bug please push in hotfix branch. +If you develop a new feature please create a new branch. + +Version +------- +Version number: 0.#version.#hotfix diff --git a/CREDITS b/CREDITS new file mode 100644 index 0000000..2422cb5 --- /dev/null +++ b/CREDITS @@ -0,0 +1,14 @@ + This is at least a partial credits-file of people that have + contributed to the current project. It is sorted by name and + formatted to allow easy grepping and beautification by + scripts. The fields are: name (N), email (E), web-address + (W) and description (D). + Thanks, + + Avtandil Kikabidze +---------- + +N: Avtandil Kikabidze aka LONGMAN +E: akalongman@gmail.com +W: http://longman.me +D: Project owner, Maintainer diff --git a/LICENSE b/LICENSE.md similarity index 87% rename from LICENSE rename to LICENSE.md index 9095007..334f39f 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,6 +1,6 @@ -MIT License +The [MIT License](http://opensource.org/licenses/mit-license.php) -Copyright (c) 2018 PHP Telegram Bot +Copyright (c) 2016 [Avtandil Kikabidze aka LONGMAN](https://github.com/akalongman) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..4281662 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Telegram Bot Package for Laravel 5.x + +TBD + +## TODO + +write more tests + +## Troubleshooting + +If you like living on the edge, please report any bugs you find on the +[php-telegram-bot/laravel issues](https://github.com/php-telegram-bot/laravel/issues) page. + +## Contributing + +Pull requests are welcome. +See [CONTRIBUTING.md](CONTRIBUTING.md) for information. + +## License + +Please see the [LICENSE](LICENSE.md) included in this repository for a full copy of the MIT license, +which this project is licensed under. + +## Credits + +- [Avtandil Kikabidze aka LONGMAN](https://github.com/akalongman) + +Full credit list in [CREDITS](CREDITS) diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..a6de186 --- /dev/null +++ b/composer.json @@ -0,0 +1,60 @@ +{ + "name": "php-telegram-bot/laravel", + "type": "library", + "description": "Package to integrate PHP Telegram Bot library in Laravel 5.x", + "keywords": [ + "laravel", + "telegram", + "bot" + ], + "license": "MIT", + "homepage": "https://github.com/php-telegram-bot/laravel", + "support": { + "issues": "https://github.com/php-telegram-bot/laravel/issues", + "source": "https://github.com/php-telegram-bot/laravel" + }, + "authors": [ + { + "name": "Avtandil Kikabidze aka LONGMAN", + "email": "akalongman@gmail.com", + "homepage": "http://longman.me", + "role": "Maintainer, Developer" + } + ], + "require": { + "php": ">=5.5.9", + "illuminate/database": "5.*", + "illuminate/http": "5.*", + "illuminate/support": "5.*", + "longman/telegram-bot": "^0.53.0" + }, + "require-dev": { + "mockery/mockery": "0.9.*", + "phpunit/phpunit": "~4.8|~5.7", + "longman/php-code-style": "^1.0", + "graham-campbell/testbench": "^3.4" + }, + "autoload": { + "psr-4": { + "PhpTelegramBot\\Laravel\\": "src/Laravel" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "config": { + "sort-packages": true + }, + "extra": { + "laravel": { + "providers": [ + "PhpTelegramBot\\Laravel\\PhpTelegramBotServiceProvider" + ], + "aliases": { + "PhpTelegramBot": "PhpTelegramBot\\Laravel\\Facades\\PhpTelegramBot" + } + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..8849a2c --- /dev/null +++ b/composer.lock @@ -0,0 +1,3745 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "c03a39c549b5f4efbbba2bd14849fb0a", + "packages": [ + { + "name": "doctrine/inflector", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "5527a48b7313d15261292c149e55e26eae771b0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", + "reference": "5527a48b7313d15261292c149e55e26eae771b0a", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2018-01-09T20:05:19+00:00" + }, + { + "name": "erusev/parsedown", + "version": "1.7.1", + "source": { + "type": "git", + "url": "https://github.com/erusev/parsedown.git", + "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", + "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35" + }, + "type": "library", + "autoload": { + "psr-0": { + "Parsedown": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" + } + ], + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", + "keywords": [ + "markdown", + "parser" + ], + "time": "2018-03-08T01:11:30+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90", + "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-03-26T16:33:04+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "laravel/framework", + "version": "v5.4.36", + "source": { + "type": "git", + "url": "https://github.com/laravel/framework.git", + "reference": "1062a22232071c3e8636487c86ec1ae75681bbf9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/framework/zipball/1062a22232071c3e8636487c86ec1ae75681bbf9", + "reference": "1062a22232071c3e8636487c86ec1ae75681bbf9", + "shasum": "" + }, + "require": { + "doctrine/inflector": "~1.1", + "erusev/parsedown": "~1.6", + "ext-mbstring": "*", + "ext-openssl": "*", + "league/flysystem": "~1.0", + "monolog/monolog": "~1.11", + "mtdowling/cron-expression": "~1.0", + "nesbot/carbon": "~1.20", + "paragonie/random_compat": "~1.4|~2.0", + "php": ">=5.6.4", + "ramsey/uuid": "~3.0", + "swiftmailer/swiftmailer": "~5.4", + "symfony/console": "~3.2", + "symfony/debug": "~3.2", + "symfony/finder": "~3.2", + "symfony/http-foundation": "~3.2", + "symfony/http-kernel": "~3.2", + "symfony/process": "~3.2", + "symfony/routing": "~3.2", + "symfony/var-dumper": "~3.2", + "tijsverkoyen/css-to-inline-styles": "~2.2", + "vlucas/phpdotenv": "~2.2" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/broadcasting": "self.version", + "illuminate/bus": "self.version", + "illuminate/cache": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/contracts": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/exception": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/log": "self.version", + "illuminate/mail": "self.version", + "illuminate/notifications": "self.version", + "illuminate/pagination": "self.version", + "illuminate/pipeline": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version", + "tightenco/collect": "self.version" + }, + "require-dev": { + "aws/aws-sdk-php": "~3.0", + "doctrine/dbal": "~2.5", + "mockery/mockery": "~0.9.4", + "pda/pheanstalk": "~3.0", + "phpunit/phpunit": "~5.7", + "predis/predis": "~1.0", + "symfony/css-selector": "~3.2", + "symfony/dom-crawler": "~3.2" + }, + "suggest": { + "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", + "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", + "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).", + "laravel/tinker": "Required to use the tinker console command (~1.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", + "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", + "nexmo/client": "Required to use the Nexmo transport (~1.0).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", + "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", + "symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.2).", + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.2).", + "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "files": [ + "src/Illuminate/Foundation/helpers.php", + "src/Illuminate/Support/helpers.php" + ], + "psr-4": { + "Illuminate\\": "src/Illuminate/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Laravel Framework.", + "homepage": "https://laravel.com", + "keywords": [ + "framework", + "laravel" + ], + "time": "2017-08-30T09:26:16+00:00" + }, + { + "name": "league/flysystem", + "version": "1.0.44", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "168dbe519737221dc87d17385cde33073881fd02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/168dbe519737221dc87d17385cde33073881fd02", + "reference": "168dbe519737221dc87d17385cde33073881fd02", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "ext-fileinfo": "*", + "phpspec/phpspec": "^3.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-fileinfo": "Required for MimeType", + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "time": "2018-04-06T09:58:14+00:00" + }, + { + "name": "longman/telegram-bot", + "version": "0.53.0", + "source": { + "type": "git", + "url": "https://github.com/php-telegram-bot/core.git", + "reference": "ed50346851088a13f2af27e067d3f595b900b55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-telegram-bot/core/zipball/ed50346851088a13f2af27e067d3f595b900b55f", + "reference": "ed50346851088a13f2af27e067d3f595b900b55f", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-mbstring": "*", + "ext-pdo": "*", + "guzzlehttp/guzzle": "^6.3", + "monolog/monolog": "^1.23", + "php": "^5.5|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.7|^6.5|^7.0", + "squizlabs/php_codesniffer": "^3.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Longman\\TelegramBot\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Avtandil Kikabidze aka LONGMAN", + "email": "akalongman@gmail.com", + "homepage": "http://longman.me", + "role": "Developer" + } + ], + "description": "PHP Telegram bot", + "homepage": "https://github.com/php-telegram-bot/core", + "keywords": [ + "api", + "bot", + "telegram" + ], + "time": "2018-03-31T22:35:18+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.23.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2017-06-19T01:22:40+00:00" + }, + { + "name": "mtdowling/cron-expression", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/mtdowling/cron-expression.git", + "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad", + "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "time": "2017-01-23T04:29:33+00:00" + }, + { + "name": "nesbot/carbon", + "version": "1.26.4", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "e3d9014279133a3cccc01f6a691322a2d5a6a87b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e3d9014279133a3cccc01f6a691322a2d5a6a87b", + "reference": "e3d9014279133a3cccc01f6a691322a2d5a6a87b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/translation": "~2.6 || ~3.0 || ~4.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "^4.8.35 || ^5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + } + ], + "description": "A simple API extension for DateTime.", + "homepage": "http://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "time": "2018-04-17T15:35:42+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.12", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb", + "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ], + "time": "2018-04-04T21:24:14+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "ramsey/uuid", + "version": "3.7.3", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76", + "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "^1.0|^2.0", + "php": "^5.4 || ^7.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "codeception/aspect-mock": "^1.0 | ~2.0.0", + "doctrine/annotations": "~1.2.0", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", + "ircmaxell/random-lib": "^1.1", + "jakub-onderka/php-parallel-lint": "^0.9.0", + "mockery/mockery": "^0.9.9", + "moontoast/math": "^1.1", + "php-mock/php-mock-phpunit": "^0.3|^1.1", + "phpunit/phpunit": "^4.7|^5.0", + "squizlabs/php_codesniffer": "^2.3" + }, + "suggest": { + "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", + "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", + "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", + "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marijn Huizendveld", + "email": "marijn.huizendveld@gmail.com" + }, + { + "name": "Thibaud Fabre", + "email": "thibaud@aztech.io" + }, + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", + "homepage": "https://github.com/ramsey/uuid", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "time": "2018-01-20T00:28:24+00:00" + }, + { + "name": "swiftmailer/swiftmailer", + "version": "v5.4.9", + "source": { + "type": "git", + "url": "https://github.com/swiftmailer/swiftmailer.git", + "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/7ffc1ea296ed14bf8260b6ef11b80208dbadba91", + "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "files": [ + "lib/swift_required.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Corbyn" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Swiftmailer, free feature-rich PHP mailer", + "homepage": "https://swiftmailer.symfony.com", + "keywords": [ + "email", + "mail", + "mailer" + ], + "time": "2018-01-23T07:37:21+00:00" + }, + { + "name": "symfony/console", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "d4bb70fa24d540c309d88a9d6e43fb2d339b1fbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/d4bb70fa24d540c309d88a9d6e43fb2d339b1fbf", + "reference": "d4bb70fa24d540c309d88a9d6e43fb2d339b1fbf", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-04-03T05:22:50+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/03f965583147957f1ecbad7ea1c9d6fd5e525ec2", + "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2018-03-19T22:35:49+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "9cf7c2271cfb89ef9727db1b740ca77be57bf9d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/9cf7c2271cfb89ef9727db1b740ca77be57bf9d7", + "reference": "9cf7c2271cfb89ef9727db1b740ca77be57bf9d7", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2018-04-03T05:22:50+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "63353a71073faf08f62caab4e6889b06a787f07b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/63353a71073faf08f62caab4e6889b06a787f07b", + "reference": "63353a71073faf08f62caab4e6889b06a787f07b", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "conflict": { + "symfony/dependency-injection": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-04-06T07:35:43+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/bd14efe8b1fabc4de82bf50dce62f05f9a102433", + "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-04-04T05:07:11+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", + "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2018-04-03T05:22:50+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "3cc2d4374aa9590c09277ad68657671cf49dbbf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3cc2d4374aa9590c09277ad68657671cf49dbbf4", + "reference": "3cc2d4374aa9590c09277ad68657671cf49dbbf4", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "^3.4.4|^4.0.4" + }, + "conflict": { + "symfony/config": "<2.8", + "symfony/dependency-injection": "<3.4.5|<4.0.5,>=4", + "symfony/var-dumper": "<3.3", + "twig/twig": "<1.34|<2.4,>=2" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/cache": "~1.0", + "symfony/browser-kit": "~2.8|~3.0|~4.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/console": "~2.8|~3.0|~4.0", + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "^3.4.5|^4.0.5", + "symfony/dom-crawler": "~2.8|~3.0|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0", + "symfony/templating": "~2.8|~3.0|~4.0", + "symfony/translation": "~2.8|~3.0|~4.0", + "symfony/var-dumper": "~3.3|~4.0" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "", + "symfony/var-dumper": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "https://symfony.com", + "time": "2018-04-06T15:19:48+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-01-30T19:27:44+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3532bfcd8f933a7816f3a0a59682fc404776600f", + "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-01-30T19:27:44+00:00" + }, + { + "name": "symfony/process", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "4b7d64e852886319e93ddfdecff0d744ab87658b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/4b7d64e852886319e93ddfdecff0d744ab87658b", + "reference": "4b7d64e852886319e93ddfdecff0d744ab87658b", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2018-04-03T05:22:50+00:00" + }, + { + "name": "symfony/routing", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/50f333b707bef9f6972ad04e6df3ec8875c9a67c", + "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "^3.3.1|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "time": "2018-04-04T13:22:16+00:00" + }, + { + "name": "symfony/translation", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "e20a9b7f9f62cb33a11638b345c248e7d510c938" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/e20a9b7f9f62cb33a11638b345c248e7d510c938", + "reference": "e20a9b7f9f62cb33a11638b345c248e7d510c938", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<3.4", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/intl": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2018-02-22T10:50:29+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v3.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "951643091b39a6fd40fce56cd16e21e12bef3feb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/951643091b39a6fd40fce56cd16e21e12bef3feb", + "reference": "951643091b39a6fd40fce56cd16e21e12bef3feb", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + }, + "require-dev": { + "ext-iconv": "*", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "ext-symfony_debug": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2018-04-03T20:34:11+00:00" + }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "0ed4a2ea4e0902dac0489e6436ebcd5bbcae9757" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/0ed4a2ea4e0902dac0489e6436ebcd5bbcae9757", + "reference": "0ed4a2ea4e0902dac0489e6436ebcd5bbcae9757", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "symfony/css-selector": "^2.7 || ^3.0 || ^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "time": "2017-11-27T11:13:29+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause-Attribution" + ], + "authors": [ + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "http://www.vancelucas.com" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2016-09-01T10:05:43+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "fzaninotto/faker", + "version": "v1.7.1", + "source": { + "type": "git", + "url": "https://github.com/fzaninotto/Faker.git", + "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", + "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "ext-intl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "squizlabs/php_codesniffer": "^1.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "time": "2017-08-15T16:48:10+00:00" + }, + { + "name": "graham-campbell/testbench", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Laravel-TestBench.git", + "reference": "1e8864eb65628e7a23708d9dc8f4f6eba436eb37" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Laravel-TestBench/zipball/1e8864eb65628e7a23708d9dc8f4f6eba436eb37", + "reference": "1e8864eb65628e7a23708d9dc8f4f6eba436eb37", + "shasum": "" + }, + "require": { + "graham-campbell/testbench-core": "^1.1", + "orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*", + "php": ">=5.5.9" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.8|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "GrahamCampbell\\TestBench\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" + } + ], + "description": "TestBench Provides Some Testing Functionality For Laravel 5", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Laravel TestBench", + "Laravel-TestBench", + "TestBench", + "framework", + "laravel", + "testing" + ], + "time": "2017-06-16T19:34:43+00:00" + }, + { + "name": "graham-campbell/testbench-core", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Laravel-TestBench-Core.git", + "reference": "9dcc8fe7feb891e4c7ffb85d7bc316de9699cf41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Laravel-TestBench-Core/zipball/9dcc8fe7feb891e4c7ffb85d7bc316de9699cf41", + "reference": "9dcc8fe7feb891e4c7ffb85d7bc316de9699cf41", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.0" + }, + "suggest": { + "illuminate/support": "Required to use the laravel trait.", + "mockery/mockery": "Required to use the mockery trait.", + "phpunit/phpunit": "Required to use the most of the features." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "GrahamCampbell\\TestBenchCore\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" + } + ], + "description": "TestBench Core Provides Some Testing Functionality For Laravel 5", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Laravel TestBench Core", + "Laravel-TestBench-Core", + "TestBench", + "framework", + "laravel", + "testbench-core", + "testing" + ], + "time": "2017-01-01T13:06:17+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "hamcrest" + ], + "files": [ + "hamcrest/Hamcrest.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2015-05-11T14:41:42+00:00" + }, + { + "name": "longman/php-code-style", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/akalongman/php-code-style.git", + "reference": "9329af04fdf29d0d4d04580ef69c2a1e322355b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/akalongman/php-code-style/zipball/9329af04fdf29d0d4d04580ef69c2a1e322355b0", + "reference": "9329af04fdf29d0d4d04580ef69c2a1e322355b0", + "shasum": "" + }, + "require": { + "squizlabs/php_codesniffer": "~2.9|~3.0" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Longish Code style configurations", + "time": "2017-10-26T15:17:16+00:00" + }, + { + "name": "mockery/mockery", + "version": "0.9.9", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", + "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~1.1", + "lib-pcre": ">=7.0", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "homepage": "http://github.com/padraic/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2017-02-28T12:52:32+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "orchestra/testbench", + "version": "v3.4.12", + "source": { + "type": "git", + "url": "https://github.com/orchestral/testbench.git", + "reference": "1a040537b09fa3e5a6c6a703a1180cf6b29e1f0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/1a040537b09fa3e5a6c6a703a1180cf6b29e1f0e", + "reference": "1a040537b09fa3e5a6c6a703a1180cf6b29e1f0e", + "shasum": "" + }, + "require": { + "fzaninotto/faker": "~1.4", + "laravel/framework": "~5.4.36", + "orchestra/testbench-core": "~3.4.6", + "php": ">=5.6.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4 || ~1.0", + "orchestra/database": "~3.4.0", + "phpunit/phpunit": "~5.7" + }, + "suggest": { + "mockery/mockery": "Allow to use Mockery for testing (^0.9.4).", + "orchestra/database": "Allow to use --realpath migration for testing (~3.4).", + "orchestra/testbench-browser-kit": "Allow to use legacy BrowserKit for testing (~3.4).", + "phpunit/phpunit": "Allow to use PHPUnit for testing (~5.7)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com", + "homepage": "https://github.com/crynobone" + } + ], + "description": "Laravel Testing Helper for Packages Development", + "homepage": "http://orchestraplatform.com/docs/latest/components/testbench/", + "keywords": [ + "BDD", + "TDD", + "laravel", + "orchestra-platform", + "orchestral", + "testing" + ], + "time": "2018-02-20T05:27:50+00:00" + }, + { + "name": "orchestra/testbench-core", + "version": "v3.4.6", + "source": { + "type": "git", + "url": "https://github.com/orchestral/testbench-core.git", + "reference": "07f5fca738b7f1a5745e4f9e4049df048019f790" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/07f5fca738b7f1a5745e4f9e4049df048019f790", + "reference": "07f5fca738b7f1a5745e4f9e4049df048019f790", + "shasum": "" + }, + "require": { + "fzaninotto/faker": "~1.4", + "php": ">=5.6.0" + }, + "require-dev": { + "laravel/framework": "~5.4.17", + "mockery/mockery": "^0.9.4", + "orchestra/database": "~3.4.0", + "phpunit/phpunit": "~5.7 || ~6.0" + }, + "suggest": { + "laravel/framework": "Required for testing (~5.4.0).", + "mockery/mockery": "Allow to use Mockery for testing (^0.9.4).", + "orchestra/database": "Allow to use --realpath migration for testing (~3.4).", + "orchestra/testbench-browser-kit": "Allow to use legacy BrowserKit for testing (~3.4).", + "orchestra/testbench-dusk": "Allow to use Laravel Dusk for testing (~3.4).", + "phpunit/phpunit": "Allow to use PHPUnit for testing (~6.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Orchestra\\Testbench\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mior Muhammad Zaki", + "email": "crynobone@gmail.com", + "homepage": "https://github.com/crynobone" + } + ], + "description": "Testing Helper for Laravel Development", + "homepage": "http://orchestraplatform.com/docs/latest/components/testbench/", + "keywords": [ + "BDD", + "TDD", + "laravel", + "orchestra-platform", + "orchestral", + "testing" + ], + "time": "2018-02-20T04:05:07+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.7.6", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-04-18T13:57:24+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "5.7.27", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-02-01T05:50:59+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19T08:54:04+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.2.3", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "4842476c434e375f9d3182ff7b89059583aa8b27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4842476c434e375f9d3182ff7b89059583aa8b27", + "reference": "4842476c434e375f9d3182ff7b89059583aa8b27", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-02-20T21:35:23+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/8b34ebb5989df61cbd77eff29a02c4db9ac1069c", + "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-04-03T05:24:00+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.9" + }, + "platform-dev": [] +} diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..d0c2e20 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..02abe4d --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,44 @@ + + + + + + + + + + + + ./tests/ + + + + + ./src + + ./src/config + ./src/database + + + + diff --git a/src/Laravel/PhpTelegramBot.php b/src/Laravel/PhpTelegramBot.php new file mode 100644 index 0000000..09368c2 --- /dev/null +++ b/src/Laravel/PhpTelegramBot.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace PhpTelegramBot\Laravel; + +use Longman\TelegramBot\Telegram; + +class PhpTelegramBot extends Telegram implements PhpTelegramBotContract +{ + +} diff --git a/src/Laravel/PhpTelegramBotContract.php b/src/Laravel/PhpTelegramBotContract.php new file mode 100644 index 0000000..4090d71 --- /dev/null +++ b/src/Laravel/PhpTelegramBotContract.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace PhpTelegramBot\Laravel; + +interface PhpTelegramBotContract +{ + +} diff --git a/src/Laravel/PhpTelegramBotServiceProvider.php b/src/Laravel/PhpTelegramBotServiceProvider.php new file mode 100644 index 0000000..7ae4ebb --- /dev/null +++ b/src/Laravel/PhpTelegramBotServiceProvider.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace PhpTelegramBot\Laravel; + +use Illuminate\Contracts\Foundation\Application; +use Illuminate\Support\ServiceProvider; + +class PhpTelegramBotServiceProvider extends ServiceProvider +{ + /** + * Indicates if loading of the provider is deferred. + * + * @var bool + */ + protected $defer = true; + + /** + * Bootstrap any application services. + * + * @return void + */ + public function boot() + { + // Publish config files + $this->publishes([ + __DIR__ . '/../config/config.php' => config_path('phptelegrambot.php'), + ]); + + // Append the default settings + $this->mergeConfigFrom( + __DIR__ . '/../config/config.php', + 'phptelegrambot' + ); + } + + /** + * Register any application services. + * + * @return void + */ + public function register() + { + $this->app->bind(PhpTelegramBotContract::class, function (Application $app) { + $config = $app['config']->get('phptelegrambot'); + + $bot = new PhpTelegramBot($config['api_key'], ! empty($config['name']) ? $config['name'] : []); + + return $bot; + }); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return [PhpTelegramBotContract::class]; + } +} diff --git a/src/config/config.php b/src/config/config.php new file mode 100644 index 0000000..0b84640 --- /dev/null +++ b/src/config/config.php @@ -0,0 +1,17 @@ + [ + 'name' => env('PHP_TELEGRAM_BOT_NAME', ''), + 'api_key' => env('PHP_TELEGRAM_BOT_API_KEY', ''), + ], + + 'database' => [ + 'enabled' => false, + 'connection' => 'default', + ], + +]; diff --git a/src/database/migrations/migration.php b/src/database/migrations/migration.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/src/database/migrations/migration.php @@ -0,0 +1 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Set error reporting to the level to which Mockery code must comply. + */ +error_reporting(-1); + +/* + * Set UTC timezone. + */ +date_default_timezone_set('UTC'); + +$root = realpath(dirname(dirname(__FILE__))); +/** + * Check that --dev composer installation was done + */ +if (! file_exists($root . '/vendor/autoload.php')) { + throw new Exception( + 'Please run "php composer.phar install --dev" in root directory ' + . 'to setup unit test dependencies before running the tests' + ); +} + +// Include the Composer autoloader +$loader = require __DIR__ . '/../vendor/autoload.php'; + +/* + * Unset global variables that are no longer needed. + */ +unset($root, $loader); From 26030850fc3ae1323654defe08c32764b1702298 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 22:21:23 +0400 Subject: [PATCH 03/63] Shorten lib namespace --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a6de186..7767460 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "php-telegram-bot/laravel", + "name": "php-telegram/laravel", "type": "library", "description": "Package to integrate PHP Telegram Bot library in Laravel 5.x", "keywords": [ From 350f9d65ff190aae9a622efb9d9df2652a91dbc3 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:51:37 +0400 Subject: [PATCH 04/63] Add more items to the config --- src/config/config.php | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/config/config.php b/src/config/config.php index 0b84640..1c04671 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -5,13 +5,40 @@ * Bot configuration */ 'bot' => [ - 'name' => env('PHP_TELEGRAM_BOT_NAME', ''), - 'api_key' => env('PHP_TELEGRAM_BOT_API_KEY', ''), + 'name' => env('PHP_TELEGRAM_BOT_NAME', 'Test Name'), + 'api_key' => env('PHP_TELEGRAM_BOT_API_KEY', '489567508:AAEJgd80WMYbl7NisJYpkWCJLt2o_0RkpXs'), ], + /** + * Database integration + */ 'database' => [ 'enabled' => false, - 'connection' => 'default', + 'connection' => env('DB_CONNECTION', 'mysql'), + ], + + 'commands' => [ + 'before' => true, + 'paths' => [ + // Custom command paths + ], + 'configs' => [ + // Custom commands configs + ], + ], + + 'admins' => [ + // Admin ids + ], + + /** + * Request limiter + */ + 'limiter' => [ + 'enabled' => false, + 'interval' => 1, ], + 'upload_path' => '', + 'download_path' => '', ]; From a47d4061f5788b282409c88b60d9ddb3b3688dcf Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:51:52 +0400 Subject: [PATCH 05/63] Add migration files --- ...18_193554_create_botan_shortener_table.php | 35 ++++++++++ ..._18_193554_create_callback_query_table.php | 38 ++++++++++ .../2018_04_18_193554_create_chat_table.php | 37 ++++++++++ ...3554_create_chosen_inline_result_table.php | 37 ++++++++++ ...04_18_193554_create_conversation_table.php | 37 ++++++++++ ..._18_193554_create_edited_message_table.php | 40 +++++++++++ ...04_18_193554_create_inline_query_table.php | 36 ++++++++++ ...2018_04_18_193554_create_message_table.php | 70 +++++++++++++++++++ ...18_193554_create_request_limiter_table.php | 35 ++++++++++ ...18_193554_create_telegram_update_table.php | 38 ++++++++++ ...18_04_18_193554_create_user_chat_table.php | 33 +++++++++ .../2018_04_18_193554_create_user_table.php | 37 ++++++++++ ..._foreign_keys_to_botan_shortener_table.php | 33 +++++++++ ...d_foreign_keys_to_callback_query_table.php | 35 ++++++++++ ...ign_keys_to_chosen_inline_result_table.php | 33 +++++++++ ...add_foreign_keys_to_conversation_table.php | 35 ++++++++++ ...d_foreign_keys_to_edited_message_table.php | 37 ++++++++++ ...add_foreign_keys_to_inline_query_table.php | 33 +++++++++ ...3555_add_foreign_keys_to_message_table.php | 45 ++++++++++++ ..._foreign_keys_to_telegram_update_table.php | 42 +++++++++++ ...55_add_foreign_keys_to_user_chat_table.php | 35 ++++++++++ 21 files changed, 801 insertions(+) create mode 100644 src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_callback_query_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_chat_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_conversation_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_edited_message_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_inline_query_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_message_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_request_limiter_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_telegram_update_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_user_chat_table.php create mode 100644 src/database/migrations/2018_04_18_193554_create_user_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php create mode 100644 src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php diff --git a/src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php b/src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php new file mode 100644 index 0000000..cf8377e --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php @@ -0,0 +1,35 @@ +bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->text('url', 65535)->comment('Original URL'); + $table->char('short_url')->default('')->comment('Shortened URL'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('botan_shortener'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_callback_query_table.php b/src/database/migrations/2018_04_18_193554_create_callback_query_table.php new file mode 100644 index 0000000..9f9baee --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_callback_query_table.php @@ -0,0 +1,38 @@ +bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier'); + $table->bigInteger('message_id')->unsigned()->nullable()->index('message_id')->comment('Unique message identifier'); + $table->char('inline_message_id')->nullable()->comment('Identifier of the message sent via the bot in inline mode, that originated the query'); + $table->char('data')->default('')->comment('Data associated with the callback button'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->index(['chat_id', 'message_id'], 'chat_id_2'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('callback_query'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_chat_table.php b/src/database/migrations/2018_04_18_193554_create_chat_table.php new file mode 100644 index 0000000..5ded55a --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_chat_table.php @@ -0,0 +1,37 @@ +bigInteger('id')->primary()->comment('Unique user or chat identifier'); + $table->enum('type', ['private', 'group', 'supergroup', 'channel'])->comment('Chat type, either private, group, supergroup or channel'); + $table->char('title')->nullable()->default('')->comment('Chat (group) title, is null if chat type is private'); + $table->char('username')->nullable()->comment('Username, for private chats, supergroups and channels if available'); + $table->boolean('all_members_are_administrators')->nullable()->default(0)->comment('True if a all members of this group are admins'); + $table->timestamps(); + $table->bigInteger('old_id')->nullable()->index('old_id')->comment('Unique chat identifier, this is filled when a group is converted to a supergroup'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('chat'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php b/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php new file mode 100644 index 0000000..91c5198 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php @@ -0,0 +1,37 @@ +bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); + $table->char('result_id')->default('')->comment('Identifier for this result'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->char('location')->nullable()->comment('Location object, user\'s location'); + $table->char('inline_message_id')->nullable()->comment('Identifier of the sent inline message'); + $table->text('query', 65535)->comment('The query that was used to obtain the result'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('chosen_inline_result'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_conversation_table.php b/src/database/migrations/2018_04_18_193554_create_conversation_table.php new file mode 100644 index 0000000..4069aa8 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_conversation_table.php @@ -0,0 +1,37 @@ +bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique user or chat identifier'); + $table->enum('status', ['active', 'cancelled', 'stopped'])->default('active')->index('status')->comment('Conversation state'); + $table->string('command', 160)->nullable()->default('')->comment('Default command to execute'); + $table->text('notes', 65535)->nullable()->comment('Data stored from command'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('conversation'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_edited_message_table.php b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php new file mode 100644 index 0000000..af43541 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php @@ -0,0 +1,40 @@ +bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); + $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier'); + $table->bigInteger('message_id')->unsigned()->nullable()->index('message_id')->comment('Unique message identifier'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->dateTime('edit_date')->nullable()->comment('Date the message was edited in timestamp format'); + $table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8'); + $table->text('entities', + 65535)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); + $table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); + $table->index(['chat_id', 'message_id'], 'chat_id_2'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('edited_message'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_inline_query_table.php b/src/database/migrations/2018_04_18_193554_create_inline_query_table.php new file mode 100644 index 0000000..e33acf3 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_inline_query_table.php @@ -0,0 +1,36 @@ +bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->char('location')->nullable()->comment('Location of the user'); + $table->text('query', 65535)->comment('Text of the query'); + $table->char('offset')->nullable()->comment('Offset of the result'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('inline_query'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_message_table.php b/src/database/migrations/2018_04_18_193554_create_message_table.php new file mode 100644 index 0000000..57a754a --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_message_table.php @@ -0,0 +1,70 @@ +bigInteger('chat_id')->comment('Unique chat identifier'); + $table->bigInteger('id')->unsigned()->comment('Unique message identifier'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->dateTime('date')->nullable()->comment('Date the message was sent in timestamp format'); + $table->bigInteger('forward_from')->nullable()->index('forward_from')->comment('Unique user identifier, sender of the original message'); + $table->bigInteger('forward_from_chat')->nullable()->index('forward_from_chat')->comment('Unique chat identifier, chat the original message belongs to'); + $table->bigInteger('forward_from_message_id')->nullable()->comment('Unique chat identifier of the original message in the channel'); + $table->dateTime('forward_date')->nullable()->comment('date the original message was sent in timestamp format'); + $table->bigInteger('reply_to_chat')->nullable()->index('reply_to_chat')->comment('Unique chat identifier'); + $table->bigInteger('reply_to_message')->unsigned()->nullable()->index('reply_to_message')->comment('Message that this message is reply to'); + $table->text('media_group_id', 65535)->nullable()->comment('The unique identifier of a media message group this message belongs to'); + $table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4'); + $table->text('entities', + 65535)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); + $table->text('audio', 65535)->nullable()->comment('Audio object. Message is an audio file, information about the file'); + $table->text('document', 65535)->nullable()->comment('Document object. Message is a general file, information about the file'); + $table->text('photo', 65535)->nullable()->comment('Array of PhotoSize objects. Message is a photo, available sizes of the photo'); + $table->text('sticker', 65535)->nullable()->comment('Sticker object. Message is a sticker, information about the sticker'); + $table->text('video', 65535)->nullable()->comment('Video object. Message is a video, information about the video'); + $table->text('voice', 65535)->nullable()->comment('Voice Object. Message is a Voice, information about the Voice'); + $table->text('video_note', 65535)->nullable()->comment('VoiceNote Object. Message is a Video Note, information about the Video Note'); + $table->text('contact', 65535)->nullable()->comment('Contact object. Message is a shared contact, information about the contact'); + $table->text('location', 65535)->nullable()->comment('Location object. Message is a shared location, information about the location'); + $table->text('venue', 65535)->nullable()->comment('Venue object. Message is a Venue, information about the Venue'); + $table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); + $table->text('new_chat_members', + 65535)->nullable()->comment('List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)'); + $table->bigInteger('left_chat_member')->nullable()->index('left_chat_member')->comment('Unique user identifier, a member was removed from the group, information about them (this member may be the bot itself)'); + $table->char('new_chat_title')->nullable()->comment('A chat title was changed to this value'); + $table->text('new_chat_photo', 65535)->nullable()->comment('Array of PhotoSize objects. A chat photo was change to this value'); + $table->boolean('delete_chat_photo')->nullable()->default(0)->comment('Informs that the chat photo was deleted'); + $table->boolean('group_chat_created')->nullable()->default(0)->comment('Informs that the group has been created'); + $table->boolean('supergroup_chat_created')->nullable()->default(0)->comment('Informs that the supergroup has been created'); + $table->boolean('channel_chat_created')->nullable()->default(0)->comment('Informs that the channel chat has been created'); + $table->bigInteger('migrate_to_chat_id')->nullable()->index('migrate_to_chat_id')->comment('Migrate to chat identifier. The group has been migrated to a supergroup with the specified identifier'); + $table->bigInteger('migrate_from_chat_id')->nullable()->index('migrate_from_chat_id')->comment('Migrate from chat identifier. The supergroup has been migrated from a group with the specified identifier'); + $table->text('pinned_message', 65535)->nullable()->comment('Message object. Specified message was pinned'); + $table->text('connected_website', 65535)->nullable()->comment('The domain name of the website on which the user has logged in.'); + $table->primary(['chat_id', 'id']); + $table->index(['reply_to_chat', 'reply_to_message'], 'reply_to_chat_2'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('message'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php b/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php new file mode 100644 index 0000000..c680d60 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php @@ -0,0 +1,35 @@ +bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); + $table->char('chat_id')->nullable()->comment('Unique chat identifier'); + $table->char('inline_message_id')->nullable()->comment('Identifier of the sent inline message'); + $table->char('method')->nullable()->comment('Request method'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('request_limiter'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php b/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php new file mode 100644 index 0000000..cd96dc3 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php @@ -0,0 +1,38 @@ +bigInteger('id')->unsigned()->primary()->comment('Update\'s unique identifier'); + $table->bigInteger('chat_id')->nullable()->comment('Unique chat identifier'); + $table->bigInteger('message_id')->unsigned()->nullable()->comment('Unique message identifier'); + $table->bigInteger('inline_query_id')->unsigned()->nullable()->index('inline_query_id')->comment('Unique inline query identifier'); + $table->bigInteger('chosen_inline_result_id')->unsigned()->nullable()->index('chosen_inline_result_id')->comment('Local chosen inline result identifier'); + $table->bigInteger('callback_query_id')->unsigned()->nullable()->index('callback_query_id')->comment('Unique callback query identifier'); + $table->bigInteger('edited_message_id')->unsigned()->nullable()->index('edited_message_id')->comment('Local edited message identifier'); + $table->index(['chat_id', 'message_id'], 'message_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('telegram_update'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_user_chat_table.php b/src/database/migrations/2018_04_18_193554_create_user_chat_table.php new file mode 100644 index 0000000..dcee577 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_user_chat_table.php @@ -0,0 +1,33 @@ +bigInteger('user_id')->comment('Unique user identifier'); + $table->bigInteger('chat_id')->index('chat_id')->comment('Unique user or chat identifier'); + $table->primary(['user_id', 'chat_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('user_chat'); + } + +} diff --git a/src/database/migrations/2018_04_18_193554_create_user_table.php b/src/database/migrations/2018_04_18_193554_create_user_table.php new file mode 100644 index 0000000..8d3f977 --- /dev/null +++ b/src/database/migrations/2018_04_18_193554_create_user_table.php @@ -0,0 +1,37 @@ +bigInteger('id')->primary()->comment('Unique user identifier'); + $table->boolean('is_bot')->nullable()->default(0)->comment('True if this user is a bot'); + $table->char('first_name')->default('')->comment('User\'s first name'); + $table->char('last_name')->nullable()->comment('User\'s last name'); + $table->char('username', 191)->nullable()->index('username')->comment('User\'s username'); + $table->char('language_code', 10)->nullable()->comment('User\'s system language'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('user'); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php new file mode 100644 index 0000000..a7a706a --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php @@ -0,0 +1,33 @@ +foreign('user_id', 'botan_shortener_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('botan_shortener', function (Blueprint $table) { + $table->dropForeign('botan_shortener_ibfk_1'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php new file mode 100644 index 0000000..bce9620 --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php @@ -0,0 +1,35 @@ +foreign('user_id', 'callback_query_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('chat_id', 'callback_query_ibfk_2')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('callback_query', function (Blueprint $table) { + $table->dropForeign('callback_query_ibfk_1'); + $table->dropForeign('callback_query_ibfk_2'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php new file mode 100644 index 0000000..834e830 --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php @@ -0,0 +1,33 @@ +foreign('user_id', 'chosen_inline_result_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('chosen_inline_result', function (Blueprint $table) { + $table->dropForeign('chosen_inline_result_ibfk_1'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php new file mode 100644 index 0000000..86a382e --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php @@ -0,0 +1,35 @@ +foreign('user_id', 'conversation_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('chat_id', 'conversation_ibfk_2')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('conversation', function (Blueprint $table) { + $table->dropForeign('conversation_ibfk_1'); + $table->dropForeign('conversation_ibfk_2'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php new file mode 100644 index 0000000..7f29cc4 --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php @@ -0,0 +1,37 @@ +foreign('chat_id', 'edited_message_ibfk_1')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('chat_id', 'edited_message_ibfk_2')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('user_id', 'edited_message_ibfk_3')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('edited_message', function (Blueprint $table) { + $table->dropForeign('edited_message_ibfk_1'); + $table->dropForeign('edited_message_ibfk_2'); + $table->dropForeign('edited_message_ibfk_3'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php new file mode 100644 index 0000000..556fbba --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php @@ -0,0 +1,33 @@ +foreign('user_id', 'inline_query_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('inline_query', function (Blueprint $table) { + $table->dropForeign('inline_query_ibfk_1'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php new file mode 100644 index 0000000..8466543 --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php @@ -0,0 +1,45 @@ +foreign('user_id', 'message_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('chat_id', 'message_ibfk_2')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('forward_from', 'message_ibfk_3')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('forward_from_chat', 'message_ibfk_4')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('reply_to_chat', 'message_ibfk_5')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('forward_from', 'message_ibfk_6')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('left_chat_member', 'message_ibfk_7')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('message', function (Blueprint $table) { + $table->dropForeign('message_ibfk_1'); + $table->dropForeign('message_ibfk_2'); + $table->dropForeign('message_ibfk_3'); + $table->dropForeign('message_ibfk_4'); + $table->dropForeign('message_ibfk_5'); + $table->dropForeign('message_ibfk_6'); + $table->dropForeign('message_ibfk_7'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php new file mode 100644 index 0000000..913f416 --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php @@ -0,0 +1,42 @@ +foreign('chat_id', 'telegram_update_ibfk_1')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('inline_query_id', 'telegram_update_ibfk_2')->references('id')->on('inline_query')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('chosen_inline_result_id', + 'telegram_update_ibfk_3')->references('id')->on('chosen_inline_result')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('callback_query_id', 'telegram_update_ibfk_4')->references('id')->on('callback_query')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('edited_message_id', 'telegram_update_ibfk_5')->references('id')->on('edited_message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('telegram_update', function (Blueprint $table) { + $table->dropForeign('telegram_update_ibfk_1'); + $table->dropForeign('telegram_update_ibfk_2'); + $table->dropForeign('telegram_update_ibfk_3'); + $table->dropForeign('telegram_update_ibfk_4'); + $table->dropForeign('telegram_update_ibfk_5'); + }); + } + +} diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php new file mode 100644 index 0000000..880cecb --- /dev/null +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php @@ -0,0 +1,35 @@ +foreign('user_id', 'user_chat_ibfk_1')->references('id')->on('user')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('chat_id', 'user_chat_ibfk_2')->references('id')->on('chat')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('user_chat', function (Blueprint $table) { + $table->dropForeign('user_chat_ibfk_1'); + $table->dropForeign('user_chat_ibfk_2'); + }); + } + +} From e06959b90728270915375a25ed1abb2d0832ee6e Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:52:12 +0400 Subject: [PATCH 06/63] Add mixin doc block --- src/Laravel/PhpTelegramBotContract.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Laravel/PhpTelegramBotContract.php b/src/Laravel/PhpTelegramBotContract.php index 4090d71..0049b79 100644 --- a/src/Laravel/PhpTelegramBotContract.php +++ b/src/Laravel/PhpTelegramBotContract.php @@ -10,6 +10,9 @@ namespace PhpTelegramBot\Laravel; +/** + * @mixin \Longman\TelegramBot\Telegram + */ interface PhpTelegramBotContract { From 1eac648775eda823939fbea7ccebfa5e2767d78d Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:52:33 +0400 Subject: [PATCH 07/63] Improve service provider --- src/Laravel/PhpTelegramBotServiceProvider.php | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/Laravel/PhpTelegramBotServiceProvider.php b/src/Laravel/PhpTelegramBotServiceProvider.php index 7ae4ebb..6f7e3a5 100644 --- a/src/Laravel/PhpTelegramBotServiceProvider.php +++ b/src/Laravel/PhpTelegramBotServiceProvider.php @@ -32,13 +32,17 @@ public function boot() // Publish config files $this->publishes([ __DIR__ . '/../config/config.php' => config_path('phptelegrambot.php'), - ]); + ], 'config'); // Append the default settings $this->mergeConfigFrom( __DIR__ . '/../config/config.php', 'phptelegrambot' ); + + $this->publishes([ + __DIR__.'/../database/migrations/' => database_path('migrations') + ], 'migrations'); } /** @@ -51,7 +55,39 @@ public function register() $this->app->bind(PhpTelegramBotContract::class, function (Application $app) { $config = $app['config']->get('phptelegrambot'); - $bot = new PhpTelegramBot($config['api_key'], ! empty($config['name']) ? $config['name'] : []); + $bot = new PhpTelegramBot($config['bot']['api_key'], ! empty($config['bot']['name']) ? $config['bot']['name'] : ''); + + // Add commands if paths are given + if (! empty($config['commands']['paths'])) { + $bot->addCommandsPaths($config['commands']['paths']); + } + + // Set command related configs + if (! empty($config['commands']['configs'])) { + foreach ($config['commands']['configs'] as $command_name => $command_config) { + $bot->setCommandConfig($command_name, $command_config); + } + } + + // Set database connection + if ($config['database']['enabled'] === true) { + /** @var \Illuminate\Database\Connection $connection */ + $connection = $app['db']->connection($config['database']['connection']); + $bot->enableExternalMySql($connection->getPdo()); + } + + // Enable admins if provided + if (! empty($config['admins'])) { + $bot->enableAdmins($config['admins']); + } + + // Set paths + if (! empty($config['download_path'])) { + $bot->setDownloadPath($config['download_path']); + } + if (! empty($config['upload_path'])) { + $bot->setUploadPath($config['upload_path']); + } return $bot; }); From 4e9a9ad489f45a9deb32ddf4bf11adc09986ca34 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:52:43 +0400 Subject: [PATCH 08/63] Update readme file --- README.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4281662..e2ede24 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,82 @@ # Telegram Bot Package for Laravel 5.x -TBD +## Table of Contents +- [Installation](#installation) +- [Usage](#usage) +- [TODO](#todo) +- [Troubleshooting](#troubleshooting) +- [Contributing](#contributing) +- [License](#license) +- [Credits](#credits) + +## Installation + +Install this package through [Composer](https://getcomposer.org/). + +Edit your project's `composer.json` file to require `longman/laravel-multilang` + +Create *composer.json* file: +```json +{ + "name": "yourproject/yourproject", + "type": "project", + "require": { + "php-telegram-bot/laravel": "~0.1" + } +} +``` +And run composer update + +**Or** run a command in your command line: + + composer require php-telegram-bot/laravel + +In Laravel 5.5 the service provider will automatically get registered. +In older versions of the framework just add the service provider in `config/app.php` file: + +```php +PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider::class, +``` + +Copy the package config and migrations to your project with the publish command: + + php artisan vendor:publish --provider="PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider" + + +After run migration command + + php artisan migrate + +## Usage + +You can inject `PhpTelegramBot\Laravel\PhpTelegramBotContract` in anywhere and use bot instance + +For example: + +```php +handle(); + + // Or set webhook + $telegram_bot->setWebhook($hook_url); + + // Or handle telegram getUpdates request + $telegram_bot->handleGetUpdates(); + } +} + +``` + +More details about usage you can see on the PHP Telegram Bot docs: https://github.com/php-telegram-bot/core#instructions ## TODO From c5e4117a0259c0b5281f852d9b8402e35fdd8f40 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:53:09 +0400 Subject: [PATCH 09/63] Update namespace --- composer.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 7767460..9fce955 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "php-telegram/laravel", + "name": "php-telegram-bot/laravel", "type": "library", "description": "Package to integrate PHP Telegram Bot library in Laravel 5.x", "keywords": [ @@ -24,7 +24,6 @@ "require": { "php": ">=5.5.9", "illuminate/database": "5.*", - "illuminate/http": "5.*", "illuminate/support": "5.*", "longman/telegram-bot": "^0.53.0" }, @@ -51,10 +50,7 @@ "laravel": { "providers": [ "PhpTelegramBot\\Laravel\\PhpTelegramBotServiceProvider" - ], - "aliases": { - "PhpTelegramBot": "PhpTelegramBot\\Laravel\\Facades\\PhpTelegramBot" - } + ] } } } From ef6fcc6a6a0bc95bab8f4e52ac89a08f7fa75cb4 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:53:44 +0400 Subject: [PATCH 10/63] Fix typo in the readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e2ede24..98bf23d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Install this package through [Composer](https://getcomposer.org/). -Edit your project's `composer.json` file to require `longman/laravel-multilang` +Edit your project's `composer.json` file to require `php-telegram-bot/laravel` Create *composer.json* file: ```json From b1d8ed66e8c1a2d83bfe9f0f42a50a953e99ab89 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Wed, 18 Apr 2018 23:59:20 +0400 Subject: [PATCH 11/63] Remove redundant strings --- src/config/config.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/config.php b/src/config/config.php index 1c04671..d80247c 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -4,9 +4,9 @@ /** * Bot configuration */ - 'bot' => [ - 'name' => env('PHP_TELEGRAM_BOT_NAME', 'Test Name'), - 'api_key' => env('PHP_TELEGRAM_BOT_API_KEY', '489567508:AAEJgd80WMYbl7NisJYpkWCJLt2o_0RkpXs'), + 'bot' => [ + 'name' => env('PHP_TELEGRAM_BOT_NAME', ''), + 'api_key' => env('PHP_TELEGRAM_BOT_API_KEY', ''), ], /** @@ -27,7 +27,7 @@ ], ], - 'admins' => [ + 'admins' => [ // Admin ids ], From d6c394a15beef99b66f1095aed6a7779aee49279 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Thu, 19 Apr 2018 00:09:46 +0400 Subject: [PATCH 12/63] Add api key mention in the readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 98bf23d..7e87e03 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ After run migration command php artisan migrate +In the config you have to specify Telegram API KEY + ## Usage You can inject `PhpTelegramBot\Laravel\PhpTelegramBotContract` in anywhere and use bot instance From f5707c24a24b8c2020ab6f00b71000f7731c85c2 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Sat, 21 Apr 2018 14:14:16 +0400 Subject: [PATCH 13/63] Update readme --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 7e87e03..e9a1426 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ # Telegram Bot Package for Laravel 5.x +[![Build Status](https://travis-ci.org/php-telegram-bot/laravel.svg?branch=master)](https://travis-ci.org/php-telegram-bot/laravel) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-telegram-bot/laravel/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-telegram-bot/laravel/?b=master) +[![Code Quality](https://img.shields.io/scrutinizer/g/php-telegram-bot/laravel/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-telegram-bot/laravel/?b=master) +[![Latest Stable Version](https://img.shields.io/packagist/v/php-telegram-bot/laravel.svg)](https://packagist.org/packages/php-telegram-bot/laravel) +[![Total Downloads](https://img.shields.io/packagist/dt/php-telegram-bot/laravel.svg)](https://packagist.org/packages/php-telegram-bot/laravel) +[![Downloads Month](https://img.shields.io/packagist/dm/php-telegram-bot/laravel.svg)](https://packagist.org/packages/php-telegram-bot/laravel) +[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D5.5.9-8892BF.svg)](https://php.net/) +[![License](https://img.shields.io/packagist/l/php-telegram-bot/laravel.svg)](https://github.com/php-telegram-bot/laravel/LICENSE.md) + +This package helps easily integrate [PHP Telegram Bot](https://github.com/php-telegram-bot/core) library in Laravel application. + ## Table of Contents - [Installation](#installation) - [Usage](#usage) From eb400cd192cc8efe3fa008a4af93851e193e962c Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Sat, 21 Apr 2018 14:27:28 +0400 Subject: [PATCH 14/63] IUmprove build scenario and fix code style --- composer.json | 17 +++++++++++++++++ composer.lock | 2 +- phpcs.xml | 8 +++++++- src/Laravel/PhpTelegramBotServiceProvider.php | 2 +- ...04_18_193554_create_edited_message_table.php | 6 ++++-- .../2018_04_18_193554_create_message_table.php | 12 ++++++++---- ...dd_foreign_keys_to_telegram_update_table.php | 6 ++++-- tests/Bootstrap.php | 3 +-- 8 files changed, 43 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 9fce955..2cb2cb4 100644 --- a/composer.json +++ b/composer.json @@ -46,6 +46,23 @@ "config": { "sort-packages": true }, + "scripts": { + "test": [ + "vendor/bin/phpunit" + ], + "coverage-text": [ + "vendor/bin/phpunit --coverage-text --colors=never" + ], + "coverage-html": [ + "vendor/bin/phpunit --coverage-html public/coverage" + ], + "phpcs": [ + "vendor/bin/phpcs --standard=phpcs.xml -spn --encoding=utf-8 src/ tests/ --report-width=150" + ], + "phpcbf": [ + "vendor/bin/phpcbf --standard=phpcs.xml -spn --encoding=utf-8 src/ tests/ --report-width=150" + ] + }, "extra": { "laravel": { "providers": [ diff --git a/composer.lock b/composer.lock index 8849a2c..9554520 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c03a39c549b5f4efbbba2bd14849fb0a", + "content-hash": "5b8bfb9bc02b78844b651f11364fce14", "packages": [ { "name": "doctrine/inflector", diff --git a/phpcs.xml b/phpcs.xml index d0c2e20..6ea2519 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -3,5 +3,11 @@ + + src/database/* + + + tests/* + - \ No newline at end of file + diff --git a/src/Laravel/PhpTelegramBotServiceProvider.php b/src/Laravel/PhpTelegramBotServiceProvider.php index 6f7e3a5..7b8ee78 100644 --- a/src/Laravel/PhpTelegramBotServiceProvider.php +++ b/src/Laravel/PhpTelegramBotServiceProvider.php @@ -41,7 +41,7 @@ public function boot() ); $this->publishes([ - __DIR__.'/../database/migrations/' => database_path('migrations') + __DIR__ . '/../database/migrations/' => database_path('migrations') ], 'migrations'); } diff --git a/src/database/migrations/2018_04_18_193554_create_edited_message_table.php b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php index af43541..4ef759e 100644 --- a/src/database/migrations/2018_04_18_193554_create_edited_message_table.php +++ b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php @@ -20,8 +20,10 @@ public function up() $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->dateTime('edit_date')->nullable()->comment('Date the message was edited in timestamp format'); $table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8'); - $table->text('entities', - 65535)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); + $table->text( + 'entities', + 65535 + )->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); $table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); $table->index(['chat_id', 'message_id'], 'chat_id_2'); }); diff --git a/src/database/migrations/2018_04_18_193554_create_message_table.php b/src/database/migrations/2018_04_18_193554_create_message_table.php index 57a754a..022c51e 100644 --- a/src/database/migrations/2018_04_18_193554_create_message_table.php +++ b/src/database/migrations/2018_04_18_193554_create_message_table.php @@ -26,8 +26,10 @@ public function up() $table->bigInteger('reply_to_message')->unsigned()->nullable()->index('reply_to_message')->comment('Message that this message is reply to'); $table->text('media_group_id', 65535)->nullable()->comment('The unique identifier of a media message group this message belongs to'); $table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4'); - $table->text('entities', - 65535)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); + $table->text( + 'entities', + 65535 + )->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); $table->text('audio', 65535)->nullable()->comment('Audio object. Message is an audio file, information about the file'); $table->text('document', 65535)->nullable()->comment('Document object. Message is a general file, information about the file'); $table->text('photo', 65535)->nullable()->comment('Array of PhotoSize objects. Message is a photo, available sizes of the photo'); @@ -39,8 +41,10 @@ public function up() $table->text('location', 65535)->nullable()->comment('Location object. Message is a shared location, information about the location'); $table->text('venue', 65535)->nullable()->comment('Venue object. Message is a Venue, information about the Venue'); $table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); - $table->text('new_chat_members', - 65535)->nullable()->comment('List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)'); + $table->text( + 'new_chat_members', + 65535 + )->nullable()->comment('List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)'); $table->bigInteger('left_chat_member')->nullable()->index('left_chat_member')->comment('Unique user identifier, a member was removed from the group, information about them (this member may be the bot itself)'); $table->char('new_chat_title')->nullable()->comment('A chat title was changed to this value'); $table->text('new_chat_photo', 65535)->nullable()->comment('Array of PhotoSize objects. A chat photo was change to this value'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php index 913f416..6dd3ddd 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php @@ -16,8 +16,10 @@ public function up() Schema::table('telegram_update', function (Blueprint $table) { $table->foreign('chat_id', 'telegram_update_ibfk_1')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('inline_query_id', 'telegram_update_ibfk_2')->references('id')->on('inline_query')->onUpdate('RESTRICT')->onDelete('RESTRICT'); - $table->foreign('chosen_inline_result_id', - 'telegram_update_ibfk_3')->references('id')->on('chosen_inline_result')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign( + 'chosen_inline_result_id', + 'telegram_update_ibfk_3' + )->references('id')->on('chosen_inline_result')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('callback_query_id', 'telegram_update_ibfk_4')->references('id')->on('callback_query')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('edited_message_id', 'telegram_update_ibfk_5')->references('id')->on('edited_message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 7563caa..bf9ff6e 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -24,8 +24,7 @@ */ if (! file_exists($root . '/vendor/autoload.php')) { throw new Exception( - 'Please run "php composer.phar install --dev" in root directory ' - . 'to setup unit test dependencies before running the tests' + 'Please run "php composer.phar install --dev" in root directory to setup unit test dependencies before running the tests' ); } From 3665071ed39239a82d44c87d775d003bd9f78fe7 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Sat, 21 Apr 2018 14:37:06 +0400 Subject: [PATCH 15/63] Add tests --- .travis.yml | 2 +- composer.json | 6 ++--- tests/Unit/AbstractTestCase.php | 20 +++++++++++++++++ tests/Unit/ServiceProviderTest.php | 36 ++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 tests/Unit/AbstractTestCase.php create mode 100644 tests/Unit/ServiceProviderTest.php diff --git a/.travis.yml b/.travis.yml index 088cd93..a50e4f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: php php: - - 5.5 + - 5.5.9 - 5.6 - 7.0 - 7.1 diff --git a/composer.json b/composer.json index 2cb2cb4..41f3bdc 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,10 @@ "longman/telegram-bot": "^0.53.0" }, "require-dev": { - "mockery/mockery": "0.9.*", - "phpunit/phpunit": "~4.8|~5.7", + "mockery/mockery": "0.9.*|~1.0", + "phpunit/phpunit": "~4.8|~5.7|~6.3", "longman/php-code-style": "^1.0", - "graham-campbell/testbench": "^3.4" + "graham-campbell/testbench": "^3.4|^4.0" }, "autoload": { "psr-4": { diff --git a/tests/Unit/AbstractTestCase.php b/tests/Unit/AbstractTestCase.php new file mode 100644 index 0000000..84aeb21 --- /dev/null +++ b/tests/Unit/AbstractTestCase.php @@ -0,0 +1,20 @@ +assertIsInjectable(Repository::class); + } + + /** + * @test + */ + public function database_is_injectable() + { + $this->assertIsInjectable(Database::class); + } + + /** + * @test + */ + public function provides() + { + $this->testProvides(); + } +} From 06f502df987bc423a026f18642733e3238417e1d Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Sat, 21 Apr 2018 14:37:42 +0400 Subject: [PATCH 16/63] Delete lock file to avoid errors on different PHP versions --- composer.lock | 3745 ------------------------------------------------- 1 file changed, 3745 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 9554520..0000000 --- a/composer.lock +++ /dev/null @@ -1,3745 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "5b8bfb9bc02b78844b651f11364fce14", - "packages": [ - { - "name": "doctrine/inflector", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "time": "2018-01-09T20:05:19+00:00" - }, - { - "name": "erusev/parsedown", - "version": "1.7.1", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown.git", - "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", - "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35" - }, - "type": "library", - "autoload": { - "psr-0": { - "Parsedown": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "description": "Parser for Markdown.", - "homepage": "http://parsedown.org", - "keywords": [ - "markdown", - "parser" - ], - "time": "2018-03-08T01:11:30+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/68d0ea14d5a3f42a20e87632a5f84931e2709c90", - "reference": "68d0ea14d5a3f42a20e87632a5f84931e2709c90", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.3-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2018-03-26T16:33:04+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" - }, - { - "name": "laravel/framework", - "version": "v5.4.36", - "source": { - "type": "git", - "url": "https://github.com/laravel/framework.git", - "reference": "1062a22232071c3e8636487c86ec1ae75681bbf9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/1062a22232071c3e8636487c86ec1ae75681bbf9", - "reference": "1062a22232071c3e8636487c86ec1ae75681bbf9", - "shasum": "" - }, - "require": { - "doctrine/inflector": "~1.1", - "erusev/parsedown": "~1.6", - "ext-mbstring": "*", - "ext-openssl": "*", - "league/flysystem": "~1.0", - "monolog/monolog": "~1.11", - "mtdowling/cron-expression": "~1.0", - "nesbot/carbon": "~1.20", - "paragonie/random_compat": "~1.4|~2.0", - "php": ">=5.6.4", - "ramsey/uuid": "~3.0", - "swiftmailer/swiftmailer": "~5.4", - "symfony/console": "~3.2", - "symfony/debug": "~3.2", - "symfony/finder": "~3.2", - "symfony/http-foundation": "~3.2", - "symfony/http-kernel": "~3.2", - "symfony/process": "~3.2", - "symfony/routing": "~3.2", - "symfony/var-dumper": "~3.2", - "tijsverkoyen/css-to-inline-styles": "~2.2", - "vlucas/phpdotenv": "~2.2" - }, - "replace": { - "illuminate/auth": "self.version", - "illuminate/broadcasting": "self.version", - "illuminate/bus": "self.version", - "illuminate/cache": "self.version", - "illuminate/config": "self.version", - "illuminate/console": "self.version", - "illuminate/container": "self.version", - "illuminate/contracts": "self.version", - "illuminate/cookie": "self.version", - "illuminate/database": "self.version", - "illuminate/encryption": "self.version", - "illuminate/events": "self.version", - "illuminate/exception": "self.version", - "illuminate/filesystem": "self.version", - "illuminate/hashing": "self.version", - "illuminate/http": "self.version", - "illuminate/log": "self.version", - "illuminate/mail": "self.version", - "illuminate/notifications": "self.version", - "illuminate/pagination": "self.version", - "illuminate/pipeline": "self.version", - "illuminate/queue": "self.version", - "illuminate/redis": "self.version", - "illuminate/routing": "self.version", - "illuminate/session": "self.version", - "illuminate/support": "self.version", - "illuminate/translation": "self.version", - "illuminate/validation": "self.version", - "illuminate/view": "self.version", - "tightenco/collect": "self.version" - }, - "require-dev": { - "aws/aws-sdk-php": "~3.0", - "doctrine/dbal": "~2.5", - "mockery/mockery": "~0.9.4", - "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~5.7", - "predis/predis": "~1.0", - "symfony/css-selector": "~3.2", - "symfony/dom-crawler": "~3.2" - }, - "suggest": { - "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", - "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).", - "laravel/tinker": "Required to use the tinker console command (~1.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", - "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", - "nexmo/client": "Required to use the Nexmo transport (~1.0).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", - "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", - "symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.2).", - "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.2).", - "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "files": [ - "src/Illuminate/Foundation/helpers.php", - "src/Illuminate/Support/helpers.php" - ], - "psr-4": { - "Illuminate\\": "src/Illuminate/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Laravel Framework.", - "homepage": "https://laravel.com", - "keywords": [ - "framework", - "laravel" - ], - "time": "2017-08-30T09:26:16+00:00" - }, - { - "name": "league/flysystem", - "version": "1.0.44", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "168dbe519737221dc87d17385cde33073881fd02" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/168dbe519737221dc87d17385cde33073881fd02", - "reference": "168dbe519737221dc87d17385cde33073881fd02", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "ext-fileinfo": "*", - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-fileinfo": "Required for MimeType", - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "time": "2018-04-06T09:58:14+00:00" - }, - { - "name": "longman/telegram-bot", - "version": "0.53.0", - "source": { - "type": "git", - "url": "https://github.com/php-telegram-bot/core.git", - "reference": "ed50346851088a13f2af27e067d3f595b900b55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-telegram-bot/core/zipball/ed50346851088a13f2af27e067d3f595b900b55f", - "reference": "ed50346851088a13f2af27e067d3f595b900b55f", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-mbstring": "*", - "ext-pdo": "*", - "guzzlehttp/guzzle": "^6.3", - "monolog/monolog": "^1.23", - "php": "^5.5|^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8|^5.7|^6.5|^7.0", - "squizlabs/php_codesniffer": "^3.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Longman\\TelegramBot\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Avtandil Kikabidze aka LONGMAN", - "email": "akalongman@gmail.com", - "homepage": "http://longman.me", - "role": "Developer" - } - ], - "description": "PHP Telegram bot", - "homepage": "https://github.com/php-telegram-bot/core", - "keywords": [ - "api", - "bot", - "telegram" - ], - "time": "2018-03-31T22:35:18+00:00" - }, - { - "name": "monolog/monolog", - "version": "1.23.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "^5.3|^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2017-06-19T01:22:40+00:00" - }, - { - "name": "mtdowling/cron-expression", - "version": "v1.2.1", - "source": { - "type": "git", - "url": "https://github.com/mtdowling/cron-expression.git", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Cron\\": "src/Cron/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", - "keywords": [ - "cron", - "schedule" - ], - "time": "2017-01-23T04:29:33+00:00" - }, - { - "name": "nesbot/carbon", - "version": "1.26.4", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "e3d9014279133a3cccc01f6a691322a2d5a6a87b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e3d9014279133a3cccc01f6a691322a2d5a6a87b", - "reference": "e3d9014279133a3cccc01f6a691322a2d5a6a87b", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "^4.8.35 || ^5.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - } - ], - "description": "A simple API extension for DateTime.", - "homepage": "http://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ], - "time": "2018-04-17T15:35:42+00:00" - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.12", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb", - "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "pseudorandom", - "random" - ], - "time": "2018-04-04T21:24:14+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "ramsey/uuid", - "version": "3.7.3", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "^1.0|^2.0", - "php": "^5.4 || ^7.0" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "codeception/aspect-mock": "^1.0 | ~2.0.0", - "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", - "ircmaxell/random-lib": "^1.1", - "jakub-onderka/php-parallel-lint": "^0.9.0", - "mockery/mockery": "^0.9.9", - "moontoast/math": "^1.1", - "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|^5.0", - "squizlabs/php_codesniffer": "^2.3" - }, - "suggest": { - "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", - "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", - "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", - "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marijn Huizendveld", - "email": "marijn.huizendveld@gmail.com" - }, - { - "name": "Thibaud Fabre", - "email": "thibaud@aztech.io" - }, - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", - "homepage": "https://github.com/ramsey/uuid", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "time": "2018-01-20T00:28:24+00:00" - }, - { - "name": "swiftmailer/swiftmailer", - "version": "v5.4.9", - "source": { - "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/7ffc1ea296ed14bf8260b6ef11b80208dbadba91", - "reference": "7ffc1ea296ed14bf8260b6ef11b80208dbadba91", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "mockery/mockery": "~0.9.1", - "symfony/phpunit-bridge": "~3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "files": [ - "lib/swift_required.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Corbyn" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "https://swiftmailer.symfony.com", - "keywords": [ - "email", - "mail", - "mailer" - ], - "time": "2018-01-23T07:37:21+00:00" - }, - { - "name": "symfony/console", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "d4bb70fa24d540c309d88a9d6e43fb2d339b1fbf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d4bb70fa24d540c309d88a9d6e43fb2d339b1fbf", - "reference": "d4bb70fa24d540c309d88a9d6e43fb2d339b1fbf", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2018-04-03T05:22:50+00:00" - }, - { - "name": "symfony/css-selector", - "version": "v4.0.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/03f965583147957f1ecbad7ea1c9d6fd5e525ec2", - "reference": "03f965583147957f1ecbad7ea1c9d6fd5e525ec2", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2018-03-19T22:35:49+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "9cf7c2271cfb89ef9727db1b740ca77be57bf9d7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/9cf7c2271cfb89ef9727db1b740ca77be57bf9d7", - "reference": "9cf7c2271cfb89ef9727db1b740ca77be57bf9d7", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2018-04-03T05:22:50+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v4.0.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "63353a71073faf08f62caab4e6889b06a787f07b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/63353a71073faf08f62caab4e6889b06a787f07b", - "reference": "63353a71073faf08f62caab4e6889b06a787f07b", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "conflict": { - "symfony/dependency-injection": "<3.4" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/stopwatch": "~3.4|~4.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:43+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/bd14efe8b1fabc4de82bf50dce62f05f9a102433", - "reference": "bd14efe8b1fabc4de82bf50dce62f05f9a102433", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-04-04T05:07:11+00:00" - }, - { - "name": "symfony/http-foundation", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", - "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php70": "~1.6" - }, - "require-dev": { - "symfony/expression-language": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com", - "time": "2018-04-03T05:22:50+00:00" - }, - { - "name": "symfony/http-kernel", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-kernel.git", - "reference": "3cc2d4374aa9590c09277ad68657671cf49dbbf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3cc2d4374aa9590c09277ad68657671cf49dbbf4", - "reference": "3cc2d4374aa9590c09277ad68657671cf49dbbf4", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/http-foundation": "^3.4.4|^4.0.4" - }, - "conflict": { - "symfony/config": "<2.8", - "symfony/dependency-injection": "<3.4.5|<4.0.5,>=4", - "symfony/var-dumper": "<3.3", - "twig/twig": "<1.34|<2.4,>=2" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/cache": "~1.0", - "symfony/browser-kit": "~2.8|~3.0|~4.0", - "symfony/class-loader": "~2.8|~3.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/console": "~2.8|~3.0|~4.0", - "symfony/css-selector": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "^3.4.5|^4.0.5", - "symfony/dom-crawler": "~2.8|~3.0|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/process": "~2.8|~3.0|~4.0", - "symfony/routing": "~3.4|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0", - "symfony/templating": "~2.8|~3.0|~4.0", - "symfony/translation": "~2.8|~3.0|~4.0", - "symfony/var-dumper": "~3.3|~4.0" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/finder": "", - "symfony/var-dumper": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpKernel Component", - "homepage": "https://symfony.com", - "time": "2018-04-06T15:19:48+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2018-01-30T19:27:44+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3532bfcd8f933a7816f3a0a59682fc404776600f", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-01-30T19:27:44+00:00" - }, - { - "name": "symfony/process", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "4b7d64e852886319e93ddfdecff0d744ab87658b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4b7d64e852886319e93ddfdecff0d744ab87658b", - "reference": "4b7d64e852886319e93ddfdecff0d744ab87658b", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2018-04-03T05:22:50+00:00" - }, - { - "name": "symfony/routing", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/50f333b707bef9f6972ad04e6df3ec8875c9a67c", - "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "conflict": { - "symfony/config": "<3.3.1", - "symfony/dependency-injection": "<3.3", - "symfony/yaml": "<3.4" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0", - "symfony/config": "^3.3.1|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/http-foundation": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Routing Component", - "homepage": "https://symfony.com", - "keywords": [ - "router", - "routing", - "uri", - "url" - ], - "time": "2018-04-04T13:22:16+00:00" - }, - { - "name": "symfony/translation", - "version": "v4.0.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "e20a9b7f9f62cb33a11638b345c248e7d510c938" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/e20a9b7f9f62cb33a11638b345c248e7d510c938", - "reference": "e20a9b7f9f62cb33a11638b345c248e7d510c938", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/yaml": "<3.4" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/intl": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2018-02-22T10:50:29+00:00" - }, - { - "name": "symfony/var-dumper", - "version": "v3.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "951643091b39a6fd40fce56cd16e21e12bef3feb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/951643091b39a6fd40fce56cd16e21e12bef3feb", - "reference": "951643091b39a6fd40fce56cd16e21e12bef3feb", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" - }, - "require-dev": { - "ext-iconv": "*", - "twig/twig": "~1.34|~2.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "ext-symfony_debug": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony mechanism for exploring and dumping PHP variables", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "time": "2018-04-03T20:34:11+00:00" - }, - { - "name": "tijsverkoyen/css-to-inline-styles", - "version": "2.2.1", - "source": { - "type": "git", - "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "0ed4a2ea4e0902dac0489e6436ebcd5bbcae9757" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/0ed4a2ea4e0902dac0489e6436ebcd5bbcae9757", - "reference": "0ed4a2ea4e0902dac0489e6436ebcd5bbcae9757", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "symfony/css-selector": "^2.7 || ^3.0 || ^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "TijsVerkoyen\\CssToInlineStyles\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Tijs Verkoyen", - "email": "css_to_inline_styles@verkoyen.eu", - "role": "Developer" - } - ], - "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", - "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", - "time": "2017-11-27T11:13:29+00:00" - }, - { - "name": "vlucas/phpdotenv", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause-Attribution" - ], - "authors": [ - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "time": "2016-09-01T10:05:43+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2017-07-22T11:58:36+00:00" - }, - { - "name": "fzaninotto/faker", - "version": "v1.7.1", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "squizlabs/php_codesniffer": "^1.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "time": "2017-08-15T16:48:10+00:00" - }, - { - "name": "graham-campbell/testbench", - "version": "v3.4.0", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Laravel-TestBench.git", - "reference": "1e8864eb65628e7a23708d9dc8f4f6eba436eb37" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Laravel-TestBench/zipball/1e8864eb65628e7a23708d9dc8f4f6eba436eb37", - "reference": "1e8864eb65628e7a23708d9dc8f4f6eba436eb37", - "shasum": "" - }, - "require": { - "graham-campbell/testbench-core": "^1.1", - "orchestra/testbench": "3.1.*|3.2.*|3.3.*|3.4.*", - "php": ">=5.5.9" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.8|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "GrahamCampbell\\TestBench\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "graham@alt-three.com" - } - ], - "description": "TestBench Provides Some Testing Functionality For Laravel 5", - "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "Laravel TestBench", - "Laravel-TestBench", - "TestBench", - "framework", - "laravel", - "testing" - ], - "time": "2017-06-16T19:34:43+00:00" - }, - { - "name": "graham-campbell/testbench-core", - "version": "v1.1.2", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Laravel-TestBench-Core.git", - "reference": "9dcc8fe7feb891e4c7ffb85d7bc316de9699cf41" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Laravel-TestBench-Core/zipball/9dcc8fe7feb891e4c7ffb85d7bc316de9699cf41", - "reference": "9dcc8fe7feb891e4c7ffb85d7bc316de9699cf41", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "phpunit/phpunit": "^4.8|^5.0" - }, - "suggest": { - "illuminate/support": "Required to use the laravel trait.", - "mockery/mockery": "Required to use the mockery trait.", - "phpunit/phpunit": "Required to use the most of the features." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "GrahamCampbell\\TestBenchCore\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "graham@alt-three.com" - } - ], - "description": "TestBench Core Provides Some Testing Functionality For Laravel 5", - "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "Laravel TestBench Core", - "Laravel-TestBench-Core", - "TestBench", - "framework", - "laravel", - "testbench-core", - "testing" - ], - "time": "2017-01-01T13:06:17+00:00" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "v1.2.2", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "autoload": { - "classmap": [ - "hamcrest" - ], - "files": [ - "hamcrest/Hamcrest.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "time": "2015-05-11T14:41:42+00:00" - }, - { - "name": "longman/php-code-style", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/akalongman/php-code-style.git", - "reference": "9329af04fdf29d0d4d04580ef69c2a1e322355b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/akalongman/php-code-style/zipball/9329af04fdf29d0d4d04580ef69c2a1e322355b0", - "reference": "9329af04fdf29d0d4d04580ef69c2a1e322355b0", - "shasum": "" - }, - "require": { - "squizlabs/php_codesniffer": "~2.9|~3.0" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Longish Code style configurations", - "time": "2017-10-26T15:17:16+00:00" - }, - { - "name": "mockery/mockery", - "version": "0.9.9", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", - "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "~1.1", - "lib-pcre": ">=7.0", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.9.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2017-02-28T12:52:32+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2017-10-19T19:58:43+00:00" - }, - { - "name": "orchestra/testbench", - "version": "v3.4.12", - "source": { - "type": "git", - "url": "https://github.com/orchestral/testbench.git", - "reference": "1a040537b09fa3e5a6c6a703a1180cf6b29e1f0e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/1a040537b09fa3e5a6c6a703a1180cf6b29e1f0e", - "reference": "1a040537b09fa3e5a6c6a703a1180cf6b29e1f0e", - "shasum": "" - }, - "require": { - "fzaninotto/faker": "~1.4", - "laravel/framework": "~5.4.36", - "orchestra/testbench-core": "~3.4.6", - "php": ">=5.6.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4 || ~1.0", - "orchestra/database": "~3.4.0", - "phpunit/phpunit": "~5.7" - }, - "suggest": { - "mockery/mockery": "Allow to use Mockery for testing (^0.9.4).", - "orchestra/database": "Allow to use --realpath migration for testing (~3.4).", - "orchestra/testbench-browser-kit": "Allow to use legacy BrowserKit for testing (~3.4).", - "phpunit/phpunit": "Allow to use PHPUnit for testing (~5.7)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "description": "Laravel Testing Helper for Packages Development", - "homepage": "http://orchestraplatform.com/docs/latest/components/testbench/", - "keywords": [ - "BDD", - "TDD", - "laravel", - "orchestra-platform", - "orchestral", - "testing" - ], - "time": "2018-02-20T05:27:50+00:00" - }, - { - "name": "orchestra/testbench-core", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/orchestral/testbench-core.git", - "reference": "07f5fca738b7f1a5745e4f9e4049df048019f790" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/07f5fca738b7f1a5745e4f9e4049df048019f790", - "reference": "07f5fca738b7f1a5745e4f9e4049df048019f790", - "shasum": "" - }, - "require": { - "fzaninotto/faker": "~1.4", - "php": ">=5.6.0" - }, - "require-dev": { - "laravel/framework": "~5.4.17", - "mockery/mockery": "^0.9.4", - "orchestra/database": "~3.4.0", - "phpunit/phpunit": "~5.7 || ~6.0" - }, - "suggest": { - "laravel/framework": "Required for testing (~5.4.0).", - "mockery/mockery": "Allow to use Mockery for testing (^0.9.4).", - "orchestra/database": "Allow to use --realpath migration for testing (~3.4).", - "orchestra/testbench-browser-kit": "Allow to use legacy BrowserKit for testing (~3.4).", - "orchestra/testbench-dusk": "Allow to use Laravel Dusk for testing (~3.4).", - "phpunit/phpunit": "Allow to use PHPUnit for testing (~6.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, - "autoload": { - "psr-4": { - "Orchestra\\Testbench\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "description": "Testing Helper for Laravel Development", - "homepage": "http://orchestraplatform.com/docs/latest/components/testbench/", - "keywords": [ - "BDD", - "TDD", - "laravel", - "orchestra-platform", - "orchestral", - "testing" - ], - "time": "2018-02-20T04:05:07+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.7.6", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2018-04-18T13:57:24+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" - }, - "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2017-04-02T07:44:40+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-11-27T05:48:46+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "5.7.27", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2018-02-01T05:50:59+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-11-26T07:53:53+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.2.3", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "4842476c434e375f9d3182ff7b89059583aa8b27" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4842476c434e375f9d3182ff7b89059583aa8b27", - "reference": "4842476c434e375f9d3182ff7b89059583aa8b27", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2018-02-20T21:35:23+00:00" - }, - { - "name": "symfony/yaml", - "version": "v4.0.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8b34ebb5989df61cbd77eff29a02c4db9ac1069c", - "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-04-03T05:24:00+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-01-29T19:49:41+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.5.9" - }, - "platform-dev": [] -} From 91d57c183a5f8a6da9304acd93818a5d1ce929c0 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Sat, 21 Apr 2018 14:44:11 +0400 Subject: [PATCH 17/63] Update build config --- .scrutinizer.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 6dd940c..24e3c83 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,3 +1,8 @@ tools: external_code_coverage: - timeout: 600 \ No newline at end of file + timeout: 600 + +checks: + php: + code_rating: true + duplication: true From 8322d0b34549f56b7174129776086f0cbae37f9b Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Sat, 21 Apr 2018 14:44:44 +0400 Subject: [PATCH 18/63] Ignore composer lock file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a63a9b5..136cd3e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .idea .phpintel composer.phar +composer.lock # Local System Files (i.e. cache, logs, etc.) # /cache From a0fadde92a31bb39df03c9c81052bca384265a55 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 15 Oct 2019 17:03:35 +0400 Subject: [PATCH 19/63] Update dependencies --- composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 41f3bdc..0d18a79 100644 --- a/composer.json +++ b/composer.json @@ -23,15 +23,15 @@ ], "require": { "php": ">=5.5.9", - "illuminate/database": "5.*", - "illuminate/support": "5.*", - "longman/telegram-bot": "^0.53.0" + "illuminate/database": "5.*|6.*", + "illuminate/support": "5.*|6.*", + "longman/telegram-bot": "^0.60" }, "require-dev": { - "mockery/mockery": "0.9.*|~1.0", - "phpunit/phpunit": "~4.8|~5.7|~6.3", - "longman/php-code-style": "^1.0", - "graham-campbell/testbench": "^3.4|^4.0" + "mockery/mockery": "~1.2", + "phpunit/phpunit": "~8.0", + "longman/php-code-style": "^3.0", + "graham-campbell/testbench": "^5.3" }, "autoload": { "psr-4": { From fa66d9f8dde8e3fcfa05110c1caff5e474301e08 Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 15 Oct 2019 17:24:25 +0400 Subject: [PATCH 20/63] Reformat the project --- composer.json | 8 ++++---- phpcs.xml | 5 +++++ src/Laravel/PhpTelegramBot.php | 6 ++++-- src/Laravel/PhpTelegramBotContract.php | 6 ++++-- src/Laravel/PhpTelegramBotServiceProvider.php | 8 +++++--- src/config/config.php | 2 ++ ..._18_193554_create_botan_shortener_table.php | 16 +++------------- ...4_18_193554_create_callback_query_table.php | 16 +++------------- .../2018_04_18_193554_create_chat_table.php | 16 +++------------- ...93554_create_chosen_inline_result_table.php | 16 +++------------- ..._04_18_193554_create_conversation_table.php | 16 +++------------- ...4_18_193554_create_edited_message_table.php | 16 +++------------- ..._04_18_193554_create_inline_query_table.php | 16 +++------------- .../2018_04_18_193554_create_message_table.php | 16 +++------------- ..._18_193554_create_request_limiter_table.php | 16 +++------------- ..._18_193554_create_telegram_update_table.php | 16 +++------------- ...018_04_18_193554_create_user_chat_table.php | 16 +++------------- .../2018_04_18_193554_create_user_table.php | 16 +++------------- ...d_foreign_keys_to_botan_shortener_table.php | 18 ++++-------------- ...dd_foreign_keys_to_callback_query_table.php | 18 ++++-------------- ...eign_keys_to_chosen_inline_result_table.php | 18 ++++-------------- ..._add_foreign_keys_to_conversation_table.php | 18 ++++-------------- ...dd_foreign_keys_to_edited_message_table.php | 18 ++++-------------- ..._add_foreign_keys_to_inline_query_table.php | 18 ++++-------------- ...93555_add_foreign_keys_to_message_table.php | 18 ++++-------------- ...d_foreign_keys_to_telegram_update_table.php | 18 ++++-------------- ...555_add_foreign_keys_to_user_chat_table.php | 18 ++++-------------- src/database/migrations/migration.php | 1 - tests/Bootstrap.php | 3 +++ tests/Unit/AbstractTestCase.php | 2 ++ tests/Unit/ServiceProviderTest.php | 2 ++ 31 files changed, 103 insertions(+), 294 deletions(-) delete mode 100644 src/database/migrations/migration.php diff --git a/composer.json b/composer.json index 0d18a79..04540c9 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "php-telegram-bot/laravel", "type": "library", - "description": "Package to integrate PHP Telegram Bot library in Laravel 5.x", + "description": "Package to integrate PHP Telegram Bot library in Laravel 6.x", "keywords": [ "laravel", "telegram", @@ -22,9 +22,9 @@ } ], "require": { - "php": ">=5.5.9", - "illuminate/database": "5.*|6.*", - "illuminate/support": "5.*|6.*", + "php": "^7.2", + "illuminate/database": "^6.0", + "illuminate/support": "^6.0", "longman/telegram-bot": "^0.60" }, "require-dev": { diff --git a/phpcs.xml b/phpcs.xml index 6ea2519..b7d81f5 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -10,4 +10,9 @@ tests/* + + + + + diff --git a/src/Laravel/PhpTelegramBot.php b/src/Laravel/PhpTelegramBot.php index 09368c2..fd5e0f0 100644 --- a/src/Laravel/PhpTelegramBot.php +++ b/src/Laravel/PhpTelegramBot.php @@ -1,4 +1,7 @@ publishes([ - __DIR__ . '/../database/migrations/' => database_path('migrations') + __DIR__ . '/../database/migrations/' => database_path('migrations'), ], 'migrations'); } @@ -52,7 +54,7 @@ public function boot() */ public function register() { - $this->app->bind(PhpTelegramBotContract::class, function (Application $app) { + $this->app->bind(PhpTelegramBotContract::class, static function (Application $app) { $config = $app['config']->get('phptelegrambot'); $bot = new PhpTelegramBot($config['bot']['api_key'], ! empty($config['bot']['name']) ? $config['bot']['name'] : ''); diff --git a/src/config/config.php b/src/config/config.php index d80247c..10ac264 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -1,5 +1,7 @@ bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->text('url', 65535)->comment('Original URL'); @@ -22,14 +18,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('botan_shortener'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_callback_query_table.php b/src/database/migrations/2018_04_18_193554_create_callback_query_table.php index 9f9baee..7f4894b 100644 --- a/src/database/migrations/2018_04_18_193554_create_callback_query_table.php +++ b/src/database/migrations/2018_04_18_193554_create_callback_query_table.php @@ -1,19 +1,15 @@ bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier'); @@ -25,14 +21,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('callback_query'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_chat_table.php b/src/database/migrations/2018_04_18_193554_create_chat_table.php index 5ded55a..babd1af 100644 --- a/src/database/migrations/2018_04_18_193554_create_chat_table.php +++ b/src/database/migrations/2018_04_18_193554_create_chat_table.php @@ -1,19 +1,15 @@ bigInteger('id')->primary()->comment('Unique user or chat identifier'); $table->enum('type', ['private', 'group', 'supergroup', 'channel'])->comment('Chat type, either private, group, supergroup or channel'); $table->char('title')->nullable()->default('')->comment('Chat (group) title, is null if chat type is private'); @@ -24,14 +20,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('chat'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php b/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php index 91c5198..ec678b8 100644 --- a/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php +++ b/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php @@ -1,19 +1,15 @@ bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); $table->char('result_id')->default('')->comment('Identifier for this result'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); @@ -24,14 +20,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('chosen_inline_result'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_conversation_table.php b/src/database/migrations/2018_04_18_193554_create_conversation_table.php index 4069aa8..20e9e9a 100644 --- a/src/database/migrations/2018_04_18_193554_create_conversation_table.php +++ b/src/database/migrations/2018_04_18_193554_create_conversation_table.php @@ -1,19 +1,15 @@ bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique user or chat identifier'); @@ -24,14 +20,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('conversation'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_edited_message_table.php b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php index 4ef759e..c571352 100644 --- a/src/database/migrations/2018_04_18_193554_create_edited_message_table.php +++ b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php @@ -1,19 +1,15 @@ bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier'); $table->bigInteger('message_id')->unsigned()->nullable()->index('message_id')->comment('Unique message identifier'); @@ -29,14 +25,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('edited_message'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_inline_query_table.php b/src/database/migrations/2018_04_18_193554_create_inline_query_table.php index e33acf3..a188c96 100644 --- a/src/database/migrations/2018_04_18_193554_create_inline_query_table.php +++ b/src/database/migrations/2018_04_18_193554_create_inline_query_table.php @@ -1,19 +1,15 @@ bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->char('location')->nullable()->comment('Location of the user'); @@ -23,14 +19,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('inline_query'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_message_table.php b/src/database/migrations/2018_04_18_193554_create_message_table.php index 022c51e..e9ded18 100644 --- a/src/database/migrations/2018_04_18_193554_create_message_table.php +++ b/src/database/migrations/2018_04_18_193554_create_message_table.php @@ -1,19 +1,15 @@ bigInteger('chat_id')->comment('Unique chat identifier'); $table->bigInteger('id')->unsigned()->comment('Unique message identifier'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); @@ -61,14 +57,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('message'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php b/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php index c680d60..d5e7cb7 100644 --- a/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php +++ b/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php @@ -1,19 +1,15 @@ bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); $table->char('chat_id')->nullable()->comment('Unique chat identifier'); $table->char('inline_message_id')->nullable()->comment('Identifier of the sent inline message'); @@ -22,14 +18,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('request_limiter'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php b/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php index cd96dc3..39b552e 100644 --- a/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php +++ b/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php @@ -1,19 +1,15 @@ bigInteger('id')->unsigned()->primary()->comment('Update\'s unique identifier'); $table->bigInteger('chat_id')->nullable()->comment('Unique chat identifier'); $table->bigInteger('message_id')->unsigned()->nullable()->comment('Unique message identifier'); @@ -25,14 +21,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('telegram_update'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_user_chat_table.php b/src/database/migrations/2018_04_18_193554_create_user_chat_table.php index dcee577..3e4f7b7 100644 --- a/src/database/migrations/2018_04_18_193554_create_user_chat_table.php +++ b/src/database/migrations/2018_04_18_193554_create_user_chat_table.php @@ -1,33 +1,23 @@ bigInteger('user_id')->comment('Unique user identifier'); $table->bigInteger('chat_id')->index('chat_id')->comment('Unique user or chat identifier'); $table->primary(['user_id', 'chat_id']); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('user_chat'); } - } diff --git a/src/database/migrations/2018_04_18_193554_create_user_table.php b/src/database/migrations/2018_04_18_193554_create_user_table.php index 8d3f977..c70c12b 100644 --- a/src/database/migrations/2018_04_18_193554_create_user_table.php +++ b/src/database/migrations/2018_04_18_193554_create_user_table.php @@ -1,19 +1,15 @@ bigInteger('id')->primary()->comment('Unique user identifier'); $table->boolean('is_bot')->nullable()->default(0)->comment('True if this user is a bot'); $table->char('first_name')->default('')->comment('User\'s first name'); @@ -24,14 +20,8 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::drop('user'); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php index a7a706a..4e35fcf 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php @@ -1,33 +1,23 @@ foreign('user_id', 'botan_shortener_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('botan_shortener', function (Blueprint $table) { + Schema::table('botan_shortener', static function (Blueprint $table) { $table->dropForeign('botan_shortener_ibfk_1'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php index bce9620..be6101a 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php @@ -1,35 +1,25 @@ foreign('user_id', 'callback_query_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('chat_id', 'callback_query_ibfk_2')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('callback_query', function (Blueprint $table) { + Schema::table('callback_query', static function (Blueprint $table) { $table->dropForeign('callback_query_ibfk_1'); $table->dropForeign('callback_query_ibfk_2'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php index 834e830..a796b49 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php @@ -1,33 +1,23 @@ foreign('user_id', 'chosen_inline_result_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('chosen_inline_result', function (Blueprint $table) { + Schema::table('chosen_inline_result', static function (Blueprint $table) { $table->dropForeign('chosen_inline_result_ibfk_1'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php index 86a382e..5405cf7 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php @@ -1,35 +1,25 @@ foreign('user_id', 'conversation_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('chat_id', 'conversation_ibfk_2')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('conversation', function (Blueprint $table) { + Schema::table('conversation', static function (Blueprint $table) { $table->dropForeign('conversation_ibfk_1'); $table->dropForeign('conversation_ibfk_2'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php index 7f29cc4..f5e0568 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php @@ -1,37 +1,27 @@ foreign('chat_id', 'edited_message_ibfk_1')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('chat_id', 'edited_message_ibfk_2')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('user_id', 'edited_message_ibfk_3')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('edited_message', function (Blueprint $table) { + Schema::table('edited_message', static function (Blueprint $table) { $table->dropForeign('edited_message_ibfk_1'); $table->dropForeign('edited_message_ibfk_2'); $table->dropForeign('edited_message_ibfk_3'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php index 556fbba..3872300 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php @@ -1,33 +1,23 @@ foreign('user_id', 'inline_query_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('inline_query', function (Blueprint $table) { + Schema::table('inline_query', static function (Blueprint $table) { $table->dropForeign('inline_query_ibfk_1'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php index 8466543..92e5cd0 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php @@ -1,19 +1,15 @@ foreign('user_id', 'message_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('chat_id', 'message_ibfk_2')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('forward_from', 'message_ibfk_3')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); @@ -24,14 +20,9 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('message', function (Blueprint $table) { + Schema::table('message', static function (Blueprint $table) { $table->dropForeign('message_ibfk_1'); $table->dropForeign('message_ibfk_2'); $table->dropForeign('message_ibfk_3'); @@ -41,5 +32,4 @@ public function down() $table->dropForeign('message_ibfk_7'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php index 6dd3ddd..fdf3d27 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php @@ -1,19 +1,15 @@ foreign('chat_id', 'telegram_update_ibfk_1')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('inline_query_id', 'telegram_update_ibfk_2')->references('id')->on('inline_query')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign( @@ -25,14 +21,9 @@ public function up() }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('telegram_update', function (Blueprint $table) { + Schema::table('telegram_update', static function (Blueprint $table) { $table->dropForeign('telegram_update_ibfk_1'); $table->dropForeign('telegram_update_ibfk_2'); $table->dropForeign('telegram_update_ibfk_3'); @@ -40,5 +31,4 @@ public function down() $table->dropForeign('telegram_update_ibfk_5'); }); } - } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php index 880cecb..5e0fa1d 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php @@ -1,35 +1,25 @@ foreign('user_id', 'user_chat_ibfk_1')->references('id')->on('user')->onUpdate('CASCADE')->onDelete('CASCADE'); $table->foreign('chat_id', 'user_chat_ibfk_2')->references('id')->on('chat')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { - Schema::table('user_chat', function (Blueprint $table) { + Schema::table('user_chat', static function (Blueprint $table) { $table->dropForeign('user_chat_ibfk_1'); $table->dropForeign('user_chat_ibfk_2'); }); } - } diff --git a/src/database/migrations/migration.php b/src/database/migrations/migration.php deleted file mode 100644 index b3d9bbc..0000000 --- a/src/database/migrations/migration.php +++ /dev/null @@ -1 +0,0 @@ - Date: Tue, 15 Oct 2019 17:25:36 +0400 Subject: [PATCH 21/63] Fix tests --- phpunit.xml.dist | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 02abe4d..d719118 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,6 @@ stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" - syntaxCheck="true" timeoutForLargeTests="60" timeoutForMediumTests="10" timeoutForSmallTests="1" @@ -34,7 +33,7 @@ - ./src + ./src ./src/config ./src/database From edbdd915f56232b7ba7f8463fc972862613cf73b Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 15 Oct 2019 17:26:11 +0400 Subject: [PATCH 22/63] Update PHP version in travis --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a50e4f1..1864b70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,8 @@ language: php php: - - 5.5.9 - - 5.6 - - 7.0 - - 7.1 - 7.2 + - 7.3 sudo: false From 695710b368632abe87e8785507c87ed11f382d9c Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 15 Oct 2019 23:35:19 +0400 Subject: [PATCH 23/63] Add lumen compatibility --- src/Laravel/PhpTelegramBotServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Laravel/PhpTelegramBotServiceProvider.php b/src/Laravel/PhpTelegramBotServiceProvider.php index 6818d00..3dcdf54 100644 --- a/src/Laravel/PhpTelegramBotServiceProvider.php +++ b/src/Laravel/PhpTelegramBotServiceProvider.php @@ -54,7 +54,7 @@ public function boot() */ public function register() { - $this->app->bind(PhpTelegramBotContract::class, static function (Application $app) { + $this->app->bind(PhpTelegramBotContract::class, static function ($app) { $config = $app['config']->get('phptelegrambot'); $bot = new PhpTelegramBot($config['bot']['api_key'], ! empty($config['bot']['name']) ? $config['bot']['name'] : ''); From debe90c861666205ddd16201c28b228045c766ea Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 15 Oct 2019 23:37:42 +0400 Subject: [PATCH 24/63] Update readme --- README.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e9a1426..20b27c3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Telegram Bot Package for Laravel 5.x +# Telegram Bot Package for Laravel 6.x [![Build Status](https://travis-ci.org/php-telegram-bot/laravel.svg?branch=master)](https://travis-ci.org/php-telegram-bot/laravel) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-telegram-bot/laravel/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-telegram-bot/laravel/?b=master) @@ -42,18 +42,10 @@ And run composer update composer require php-telegram-bot/laravel -In Laravel 5.5 the service provider will automatically get registered. -In older versions of the framework just add the service provider in `config/app.php` file: - -```php -PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider::class, -``` - Copy the package config and migrations to your project with the publish command: php artisan vendor:publish --provider="PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider" - After run migration command php artisan migrate @@ -74,16 +66,17 @@ use PhpTelegramBot\Laravel\PhpTelegramBotContract; class CustomController extends Controller { - public function handle(PhpTelegramBotContract $telegram_bot) + public function handle(PhpTelegramBotContract $telegramBot) { // Call handle method - $telegram_bot->handle(); + $telegramBot->handle(); // Or set webhook - $telegram_bot->setWebhook($hook_url); + $hookUrl = 'https://hook.url'; + $telegramBot->setWebhook($hookUrl); // Or handle telegram getUpdates request - $telegram_bot->handleGetUpdates(); + $telegramBot->handleGetUpdates(); } } From 9d4df608a9d428dc971199b4c0c63e944414c8aa Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 15 Oct 2019 23:41:55 +0400 Subject: [PATCH 25/63] Update code --- README.md | 4 ++-- ...PhpTelegramBotServiceProvider.php => ServiceProvider.php} | 5 ++--- tests/Unit/AbstractTestCase.php | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) rename src/Laravel/{PhpTelegramBotServiceProvider.php => ServiceProvider.php} (95%) diff --git a/README.md b/README.md index 20b27c3..3c41793 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Create *composer.json* file: "name": "yourproject/yourproject", "type": "project", "require": { - "php-telegram-bot/laravel": "~0.1" + "php-telegram-bot/laravel": "^1.0" } } ``` @@ -44,7 +44,7 @@ And run composer update Copy the package config and migrations to your project with the publish command: - php artisan vendor:publish --provider="PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider" + php artisan vendor:publish --provider="PhpTelegramBot\Laravel\ServiceProvider" After run migration command diff --git a/src/Laravel/PhpTelegramBotServiceProvider.php b/src/Laravel/ServiceProvider.php similarity index 95% rename from src/Laravel/PhpTelegramBotServiceProvider.php rename to src/Laravel/ServiceProvider.php index 3dcdf54..d549a54 100644 --- a/src/Laravel/PhpTelegramBotServiceProvider.php +++ b/src/Laravel/ServiceProvider.php @@ -12,10 +12,9 @@ */ namespace PhpTelegramBot\Laravel; -use Illuminate\Contracts\Foundation\Application; -use Illuminate\Support\ServiceProvider; +use Illuminate\Support\ServiceProvider as LaravelServiceProvider; -class PhpTelegramBotServiceProvider extends ServiceProvider +class ServiceProvider extends LaravelServiceProvider { /** * Indicates if loading of the provider is deferred. diff --git a/tests/Unit/AbstractTestCase.php b/tests/Unit/AbstractTestCase.php index fedcde1..0439111 100644 --- a/tests/Unit/AbstractTestCase.php +++ b/tests/Unit/AbstractTestCase.php @@ -5,7 +5,7 @@ namespace Tests\Unit; use GrahamCampbell\TestBench\AbstractPackageTestCase; -use PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider; +use PhpTelegramBot\Laravel\ServiceProvider; abstract class AbstractTestCase extends AbstractPackageTestCase { @@ -17,6 +17,6 @@ abstract class AbstractTestCase extends AbstractPackageTestCase */ protected function getServiceProviderClass($app) { - return PhpTelegramBotServiceProvider::class; + return ServiceProvider::class; } } From ab37bd40561124b01940eaa7ebc1fbb2231e1f7f Mon Sep 17 00:00:00 2001 From: Null Date: Wed, 16 Oct 2019 22:18:33 +0300 Subject: [PATCH 26/63] Fix package discovery --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 04540c9..6004329 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "extra": { "laravel": { "providers": [ - "PhpTelegramBot\\Laravel\\PhpTelegramBotServiceProvider" + "PhpTelegramBot\\Laravel\\ServiceProvider" ] } } From c8dd62061bf9525dcd9bb6a26b9894f35f55765b Mon Sep 17 00:00:00 2001 From: LittPi Chan Date: Mon, 16 Dec 2019 11:06:58 +0800 Subject: [PATCH 27/63] Update package to fix Monolog version problem. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6004329..bbf55b8 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "php": "^7.2", "illuminate/database": "^6.0", "illuminate/support": "^6.0", - "longman/telegram-bot": "^0.60" + "longman/telegram-bot": "^0.61" }, "require-dev": { "mockery/mockery": "~1.2", From f236d40854600e037b000f6fff39f77ada74e6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20C=CC=A7ak=C4=B1r?= Date: Sat, 8 Feb 2020 11:47:44 +0300 Subject: [PATCH 28/63] add webhook artisan command --- src/Laravel/Commands/WebhookCommand.php | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/Laravel/Commands/WebhookCommand.php diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php new file mode 100644 index 0000000..c27af33 --- /dev/null +++ b/src/Laravel/Commands/WebhookCommand.php @@ -0,0 +1,63 @@ +$telegramBot = $telegramBot; + } + + public function handle() + { + $webhook = $this->argument('url'); + $delete = $this->option('delete'); + + if (!($webhook && $delete)) { + $this->error("Not enough arguments!"); + $this->error("php artisan telegram:webhook {url?} {--delete}"); + return; + } + + if ($delete) { + try { + $this->telegramBot->deleteWebhook(); + $this->info('Webhook deleted succesfully!'); + } catch (TelegramException $e) { + $this->error("Couldn't delete webhook"); + $this->error($e->getMessage()); + return; + } + } + + + if ($webhook) { + try { + $this->telegramBot->setWebhook($webhook);; + $this->info('Webhook set succesfully!'); + } catch (TelegramException $e) { + $this->error("Couldn't set webhook"); + $this->error($e->getMessage()); + return; + } + + } + + $this->info('All done!'); + } +} From a6a70b043c90000924bb4a1f8128cfd9854725eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20C=CC=A7ak=C4=B1r?= Date: Sat, 8 Feb 2020 11:50:33 +0300 Subject: [PATCH 29/63] register command --- src/Laravel/ServiceProvider.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Laravel/ServiceProvider.php b/src/Laravel/ServiceProvider.php index d549a54..2d55760 100644 --- a/src/Laravel/ServiceProvider.php +++ b/src/Laravel/ServiceProvider.php @@ -13,6 +13,7 @@ namespace PhpTelegramBot\Laravel; use Illuminate\Support\ServiceProvider as LaravelServiceProvider; +use PhpTelegramBot\Laravel\Commands\WebhookCommand; class ServiceProvider extends LaravelServiceProvider { @@ -92,6 +93,13 @@ public function register() return $bot; }); + + if ($this->app->runningInConsole()) { + $this->commands([ + WebhookCommand::class + ]); + } + } /** From 210d54cda837bd517986b8bd0425c3b77452ce1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20C=CC=A7ak=C4=B1r?= Date: Sat, 8 Feb 2020 11:52:30 +0300 Subject: [PATCH 30/63] fix typo --- src/Laravel/Commands/WebhookCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index c27af33..6a0c826 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -20,7 +20,7 @@ public function __construct(PhpTelegramBotContract $telegramBot) { parent::__construct(); - $this->$telegramBot = $telegramBot; + $this->telegramBot = $telegramBot; } public function handle() From 9393b7d9887f56510ac59f3d28964a1914fd2bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20C=CC=A7ak=C4=B1r?= Date: Sat, 8 Feb 2020 11:54:17 +0300 Subject: [PATCH 31/63] fix logical mistake --- src/Laravel/Commands/WebhookCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index 6a0c826..cea2b9b 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -28,7 +28,7 @@ public function handle() $webhook = $this->argument('url'); $delete = $this->option('delete'); - if (!($webhook && $delete)) { + if (!($webhook || $delete)) { $this->error("Not enough arguments!"); $this->error("php artisan telegram:webhook {url?} {--delete}"); return; From 96969a7db69cfda2eb010196500d4eb84c40ffc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20C=CC=A7ak=C4=B1r?= Date: Sat, 8 Feb 2020 12:16:25 +0300 Subject: [PATCH 32/63] fix for PSR-2 coding standard --- .phpunit.result.cache | 1 + src/Laravel/Commands/WebhookCommand.php | 15 ++++++++------- src/Laravel/ServiceProvider.php | 3 +-- 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 0000000..191b754 --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +C:37:"PHPUnit\Runner\DefaultTestResultCache":368:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:5:{s:52:"Tests\Unit\ServiceProviderTest::config_is_injectable";d:0.167;s:54:"Tests\Unit\ServiceProviderTest::database_is_injectable";d:0.009;s:40:"Tests\Unit\ServiceProviderTest::provides";d:0.007;s:54:"Tests\Unit\ServiceProviderTest::testIsAServiceProvider";d:0.009;s:44:"Tests\Unit\ServiceProviderTest::testProvides";d:0.006;}}} \ No newline at end of file diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index cea2b9b..9705b5c 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -1,10 +1,12 @@ argument('url'); $delete = $this->option('delete'); - if (!($webhook || $delete)) { - $this->error("Not enough arguments!"); - $this->error("php artisan telegram:webhook {url?} {--delete}"); + if (! ($webhook || $delete)) { + $this->error('Not enough arguments!'); + $this->error('php artisan telegram:webhook {url?} {--delete}'); return; } @@ -48,14 +50,13 @@ public function handle() if ($webhook) { try { - $this->telegramBot->setWebhook($webhook);; + $this->telegramBot->setWebhook($webhook); $this->info('Webhook set succesfully!'); } catch (TelegramException $e) { $this->error("Couldn't set webhook"); $this->error($e->getMessage()); return; } - } $this->info('All done!'); diff --git a/src/Laravel/ServiceProvider.php b/src/Laravel/ServiceProvider.php index 2d55760..6e9dbbe 100644 --- a/src/Laravel/ServiceProvider.php +++ b/src/Laravel/ServiceProvider.php @@ -96,10 +96,9 @@ public function register() if ($this->app->runningInConsole()) { $this->commands([ - WebhookCommand::class + WebhookCommand::class, ]); } - } /** From f4dea4c0ade592c34e2f65cc4331669537ee3316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20C=CC=A7ak=C4=B1r?= Date: Sat, 8 Feb 2020 12:18:02 +0300 Subject: [PATCH 33/63] fix argument description --- src/Laravel/Commands/WebhookCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index 9705b5c..17e38f2 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -10,8 +10,8 @@ class WebhookCommand extends Command { - protected $signature = 'telegram:webhook {url?} - {--delete : Force the operation to run when in production}'; + protected $signature = 'telegram:webhook {webhook?} + {--delete : Delete webhook}'; protected $description = 'Set or delete webhook for Telegram bot'; @@ -27,12 +27,12 @@ public function __construct(PhpTelegramBotContract $telegramBot) public function handle() { - $webhook = $this->argument('url'); + $webhook = $this->argument('webhook'); $delete = $this->option('delete'); if (! ($webhook || $delete)) { $this->error('Not enough arguments!'); - $this->error('php artisan telegram:webhook {url?} {--delete}'); + $this->error('php artisan telegram:webhook {webhook?} {--delete}'); return; } From 4d43abd6de0c9df8493bdd14d34ccf0b7c8d654e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20C=CC=A7ak=C4=B1r?= Date: Sat, 8 Feb 2020 12:19:13 +0300 Subject: [PATCH 34/63] remove phpunit cache --- .phpunit.result.cache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache deleted file mode 100644 index 191b754..0000000 --- a/.phpunit.result.cache +++ /dev/null @@ -1 +0,0 @@ -C:37:"PHPUnit\Runner\DefaultTestResultCache":368:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:5:{s:52:"Tests\Unit\ServiceProviderTest::config_is_injectable";d:0.167;s:54:"Tests\Unit\ServiceProviderTest::database_is_injectable";d:0.009;s:40:"Tests\Unit\ServiceProviderTest::provides";d:0.007;s:54:"Tests\Unit\ServiceProviderTest::testIsAServiceProvider";d:0.009;s:44:"Tests\Unit\ServiceProviderTest::testProvides";d:0.006;}}} \ No newline at end of file From 7a479301847811fde8ae5fcc0f100c5aa5452aa0 Mon Sep 17 00:00:00 2001 From: sergiy-petrov Date: Wed, 12 Feb 2020 16:41:11 +0200 Subject: [PATCH 35/63] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1864b70..b51afc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php php: - 7.2 - 7.3 + - 7.4 sudo: false From 8ee0c97f25d925c7ae98fa346db1ba5e973b3ea8 Mon Sep 17 00:00:00 2001 From: Lucas Fiege Date: Tue, 17 Mar 2020 09:28:12 -0300 Subject: [PATCH 36/63] Add support for Laravel 7 This PR adds support for Laravel 7, since this project only use two single dependencies I don't think it requires major changes --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index bbf55b8..3d69b48 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ ], "require": { "php": "^7.2", - "illuminate/database": "^6.0", - "illuminate/support": "^6.0", + "illuminate/database": "^6.0|^7.0", + "illuminate/support": "^6.0|^7.0", "longman/telegram-bot": "^0.61" }, "require-dev": { From 9fdc83452b0f3c4ed55e4eea47b36232c1be208b Mon Sep 17 00:00:00 2001 From: Sergey Asafov Date: Fri, 1 May 2020 09:29:29 +0300 Subject: [PATCH 37/63] Ability to use custom tables prefix --- src/Laravel/ServiceProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Laravel/ServiceProvider.php b/src/Laravel/ServiceProvider.php index 6e9dbbe..6fb791e 100644 --- a/src/Laravel/ServiceProvider.php +++ b/src/Laravel/ServiceProvider.php @@ -75,7 +75,11 @@ public function register() if ($config['database']['enabled'] === true) { /** @var \Illuminate\Database\Connection $connection */ $connection = $app['db']->connection($config['database']['connection']); - $bot->enableExternalMySql($connection->getPdo()); + /* + Ability to use custom table prefix + */ + $tablePrefix = (!empty($config['database']['prefix']) ? $config['database']['prefix'] : ''; + $bot->enableExternalMySql($connection->getPdo(), $tablePrefix); } // Enable admins if provided From 443000966561d7b3b56d4587518a7a3acb68340a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Fri, 1 May 2020 22:52:03 +0200 Subject: [PATCH 38/63] Fix syntax error and clean up code. --- src/Laravel/ServiceProvider.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Laravel/ServiceProvider.php b/src/Laravel/ServiceProvider.php index 6fb791e..5f46c4d 100644 --- a/src/Laravel/ServiceProvider.php +++ b/src/Laravel/ServiceProvider.php @@ -75,10 +75,8 @@ public function register() if ($config['database']['enabled'] === true) { /** @var \Illuminate\Database\Connection $connection */ $connection = $app['db']->connection($config['database']['connection']); - /* - Ability to use custom table prefix - */ - $tablePrefix = (!empty($config['database']['prefix']) ? $config['database']['prefix'] : ''; + // Ability to use custom table prefix + $tablePrefix = $config['database']['prefix'] ?? ''; $bot->enableExternalMySql($connection->getPdo(), $tablePrefix); } From acb8c26f1393a904b215e26e1881be494dc8a6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 18 May 2020 11:41:07 +0200 Subject: [PATCH 39/63] Add all missing migrations up until 0.62.0 of core --- ..._000000_update_schema_0_53_0_to_0_54_0.php | 32 ++++ ..._000000_update_schema_0_54_1_to_0_55_0.php | 34 +++++ ..._000000_update_schema_0_56_0_to_0_57_0.php | 140 ++++++++++++++++++ ..._000000_update_schema_0_57_0_to_0_58_0.php | 32 ++++ ..._000000_update_schema_0_60_0_to_0_61_0.php | 44 ++++++ ..._000000_update_schema_0_61_1_to_0_62_0.php | 70 +++++++++ 6 files changed, 352 insertions(+) create mode 100644 src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php create mode 100644 src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php create mode 100644 src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php create mode 100644 src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php create mode 100644 src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php create mode 100644 src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php new file mode 100644 index 0000000..86847c2 --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php @@ -0,0 +1,32 @@ +text('game')->nullable()->comment('Message is a game, information about the game.')->after('document'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table('message', static function (Blueprint $table) { + $table->dropColumn('game'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } +} diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php new file mode 100644 index 0000000..9aafcc0 --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php @@ -0,0 +1,34 @@ +text('animation')->nullable()->comment('Message is an animation, information about the animation')->after('document'); + $table->text('passport_data')->nullable()->comment('Telegram Passport data')->after('connected_website'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table('message', static function (Blueprint $table) { + $table->dropColumn('passport_data'); + $table->dropColumn('animation'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } +} diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php new file mode 100644 index 0000000..f5c6133 --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php @@ -0,0 +1,140 @@ +bigInteger('id')->unsigned()->primary()->comment('Unique query identifier'); + $table->bigInteger('user_id')->index('user_id')->comment('User who sent the query'); + $table->char('invoice_payload', 255)->default('')->comment('Bot specified invoice payload'); + $table->char('shipping_address', 255)->default('')->comment('User specified shipping address'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->foreign('user_id', 'shipping_query_ibfk_1')->references('id')->on('user')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + + Schema::create('pre_checkout_query', static function (Blueprint $table) { + $table->bigInteger('id')->unsigned()->primary()->comment('Unique query identifier'); + $table->bigInteger('user_id')->index('user_id')->comment('User who sent the query'); + $table->char('currency', 3)->comment('Three-letter ISO 4217 currency code'); + $table->bigInteger('total_amount')->comment('Total price in the smallest units of the currency'); + $table->char('invoice_payload', 255)->default('')->comment('Bot specified invoice payload'); + $table->char('shipping_option_id', 255)->comment('Identifier of the shipping option chosen by the user'); + $table->text('order_info')->comment('Order info provided by the user'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->foreign('user_id', 'pre_checkout_query_ibfk_1')->references('id')->on('user')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + + Schema::create('poll', static function (Blueprint $table) { + $table->bigInteger('id')->unsigned()->primary()->comment('Unique poll identifier'); + $table->char('question', 255)->comment('Poll question'); + $table->text('options')->comment('List of poll options'); + $table->tinyInteger('is_closed')->default(0)->comment('True, if the poll is closed'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + }); + + Schema::table('callback_query', static function (Blueprint $table) { + $table->char('chat_instance', 255)->default('')->comment('Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent')->after('inline_message_id'); + $table->char('game_short_name', 255)->default('')->comment('Short name of a Game to be returned, serves as the unique identifier for the game')->after('data'); + }); + + Schema::table('chat', static function (Blueprint $table) { + $table->char('first_name', 255)->nullable()->comment('First name of the other party in a private chat')->after('username'); + $table->char('last_name', 255)->nullable()->comment('Last name of the other party in a private chat')->after('first_name'); + }); + + Schema::table('message', static function (Blueprint $table) { + $table->text('forward_signature')->nullable()->default(null)->comment('For messages forwarded from channels, signature of the post author if present')->after('forward_from_message_id'); + $table->text('forward_sender_name')->nullable()->default(null)->comment('Sender\'s name for messages forwarded from users who disallow adding a link to their account in forwarded messages')->after('forward_signature'); + $table->unsignedBigInteger('edit_date')->default(null)->comment('Date the message was last edited in Unix time')->after('reply_to_message'); + $table->text('author_signature')->comment('Signature of the post author for messages in channels')->after('media_group_id'); + $table->text('caption_entities')->comment('For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption')->after('entities'); + $table->text('poll')->comment('Poll object. Message is a native poll, information about the poll')->after('venue'); + $table->text('invoice')->nullable()->comment('Message is an invoice for a payment, information about the invoice')->after('pinned_message'); + $table->text('successful_payment')->nullable()->comment('Message is a service message about a successful payment, information about the payment')->after('invoice'); + }); + + Schema::table('telegram_update', static function (Blueprint $table) { + $table->bigInteger('channel_post_id')->unsigned()->nullable()->comment('New incoming channel post of any kind - text, photo, sticker, etc.'); + $table->bigInteger('edited_channel_post_id')->unsigned()->nullable()->comment('New version of a channel post that is known to the bot and was edited'); + $table->bigInteger('shipping_query_id')->unsigned()->nullable()->comment('New incoming shipping query. Only for invoices with flexible price'); + $table->bigInteger('pre_checkout_query_id')->unsigned()->nullable()->comment('New incoming pre-checkout query. Contains full information about checkout'); + $table->bigInteger('poll_id')->unsigned()->nullable()->comment('New poll state. Bots receive only updates about polls, which are sent or stopped by the bot'); + + $table->index('channel_post_id', 'channel_post_id'); + $table->index('edited_channel_post_id', 'edited_channel_post_id'); + $table->index('shipping_query_id', 'shipping_query_id'); + $table->index('pre_checkout_query_id', 'pre_checkout_query_id'); + $table->index('poll_id', 'poll_id'); + + $table->foreign(['chat_id', 'channel_post_id'], 'telegram_update_ibfk_6')->references(['chat_id', 'id'])->on('message'); + $table->foreign('edited_channel_post_id', 'telegram_update_ibfk_7')->references('id')->on('edited_message'); + $table->foreign('shipping_query_id', 'telegram_update_ibfk_8')->references('id')->on('shipping_query'); + $table->foreign('pre_checkout_query_id', 'telegram_update_ibfk_9')->references('id')->on('pre_checkout_query'); + $table->foreign('poll_id', 'telegram_update_ibfk_10')->references('id')->on('poll'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table('telegram_update', static function (Blueprint $table) { + $table->dropForeign('telegram_update_ibfk_10'); + $table->dropForeign('telegram_update_ibfk_9'); + $table->dropForeign('telegram_update_ibfk_8'); + $table->dropForeign('telegram_update_ibfk_7'); + $table->dropForeign('telegram_update_ibfk_6'); + + $table->dropIndex('poll_id'); + $table->dropIndex('pre_checkout_query_id'); + $table->dropIndex('shipping_query_id'); + $table->dropIndex('edited_channel_post_id'); + $table->dropIndex('channel_post_id'); + + $table->dropColumn('poll_id'); + $table->dropColumn('pre_checkout_query_id'); + $table->dropColumn('shipping_query_id'); + $table->dropColumn('edited_channel_post_id'); + $table->dropColumn('channel_post_id'); + }); + + Schema::table('message', static function (Blueprint $table) { + $table->dropColumn('successful_payment'); + $table->dropColumn('invoice'); + $table->dropColumn('poll'); + $table->dropColumn('caption_entities'); + $table->dropColumn('author_signature'); + $table->dropColumn('edit_date'); + $table->dropColumn('forward_sender_name'); + $table->dropColumn('forward_signature'); + }); + + + Schema::table('chat', static function (Blueprint $table) { + $table->dropColumn('last_name'); + $table->dropColumn('first_name'); + }); + + Schema::table('callback_query', static function (Blueprint $table) { + $table->dropColumn('game_short_name'); + $table->dropColumn('chat_instance'); + }); + + Schema::dropIfExists('poll'); + Schema::dropIfExists('pre_checkout_query'); + Schema::dropIfExists('shipping_query'); + } catch (Exception $e) { + // Migration may be partly done already... + } + } +} diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php new file mode 100644 index 0000000..ab1fd5b --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php @@ -0,0 +1,32 @@ +text('reply_markup')->nullable()->comment('Inline keyboard attached to the message')->after('passport_data'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table('message', static function (Blueprint $table) { + $table->dropColumn('reply_markup'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } +} diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php new file mode 100644 index 0000000..8c01493 --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php @@ -0,0 +1,44 @@ +dropIndex('message_id'); + $table->index('message_id', 'message_id'); + $table->index(['chat_id', 'message_id'], 'chat_message_id'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + + Schema::enableForeignKeyConstraints(); + } + + public function down(): void + { + Schema::disableForeignKeyConstraints(); + + try { + Schema::table('telegram_update', static function (Blueprint $table) { + $table->dropIndex('chat_message_id'); + $table->dropIndex('message_id'); + $table->index('message_id', 'message_id'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + + Schema::enableForeignKeyConstraints(); + } +} diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php new file mode 100644 index 0000000..e307051 --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php @@ -0,0 +1,70 @@ +integer('total_voter_count')->unsigned()->comment('Total number of users that voted in the poll')->after('options'); + $table->tinyInteger('is_anonymous')->default(1)->comment('True, if the poll is anonymous')->after('is_closed'); + $table->char('type', 255)->comment('Poll type, currently can be “regular” or “quiz”')->after('is_anonymous'); + $table->tinyInteger('allows_multiple_answers')->default(0)->comment('True, if the poll allows multiple answers')->after('type'); + $table->integer('correct_option_id')->unsigned()->comment('0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.')->after('allows_multiple_answers'); + }); + + Schema::table('message', static function (Blueprint $table) { + $table->text('dice')->nullable()->comment('Message is a dice with random value from 1 to 6')->after('poll'); + }); + + Schema::create('poll_answer', static function (Blueprint $table) { + $table->bigInteger('poll_id', true, true)->comment('Unique poll identifier'); + $table->bigInteger('user_id')->nullable(false)->comment('The user, who changed the answer to the poll'); + $table->text('option_ids')->nullable(false)->comment('0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.'); + $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->foreign('poll_id', 'poll_answer_ibfk_1')->references('id')->on('poll')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + + Schema::table('telegram_update', static function (Blueprint $table) { + $table->bigInteger('poll_answer_poll_id')->unsigned()->nullable()->comment('A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.')->after('poll_id'); + $table->index('poll_answer_poll_id', 'poll_answer_poll_id'); + $table->foreign('poll_answer_poll_id', 'telegram_update_ibfk_11')->references('poll_id')->on('poll_answer')->onUpdate('CASCADE')->onDelete('CASCADE'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table('telegram_update', static function (Blueprint $table) { + $table->dropForeign('telegram_update_ibfk_11'); + $table->dropIndex('poll_answer_poll_id'); + $table->dropColumn('poll_answer_poll_id'); + }); + + Schema::dropIfExists('poll_answer'); + + Schema::table('message', static function (Blueprint $table) { + $table->dropColumn('dice'); + }); + + Schema::table('poll', static function (Blueprint $table) { + $table->dropColumn('correct_option_id'); + $table->dropColumn('allows_multiple_answers'); + $table->dropColumn('type'); + $table->dropColumn('is_anonymous'); + $table->dropColumn('total_voter_count'); + }); + } catch (Exception $e) { + // Migration may be partly done already... + } + } +} From b406fa9bdd3f5103a3000dfa436f8ca4007600cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 18 May 2020 17:21:36 +0200 Subject: [PATCH 40/63] Take MySQL table prefix into account for all tables and foreign keys. --- src/Laravel/Migration.php | 27 +++++++++ src/config/config.php | 1 + ..._000000_update_schema_0_53_0_to_0_54_0.php | 6 +- ..._000000_update_schema_0_54_1_to_0_55_0.php | 6 +- ..._000000_update_schema_0_56_0_to_0_57_0.php | 55 +++++++++---------- ..._000000_update_schema_0_57_0_to_0_58_0.php | 7 ++- ..._000000_update_schema_0_60_0_to_0_61_0.php | 6 +- ..._000000_update_schema_0_61_1_to_0_62_0.php | 24 ++++---- 8 files changed, 80 insertions(+), 52 deletions(-) create mode 100644 src/Laravel/Migration.php diff --git a/src/Laravel/Migration.php b/src/Laravel/Migration.php new file mode 100644 index 0000000..7e88f61 --- /dev/null +++ b/src/Laravel/Migration.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace PhpTelegramBot\Laravel; + +class Migration extends \Illuminate\Database\Migrations\Migration +{ + /** + * @var string + */ + protected $prefix = ''; + + public function __construct() + { + $this->prefix = (string) config('phptelegrambot.database.prefix', ''); + } +} diff --git a/src/config/config.php b/src/config/config.php index 10ac264..0f6ff98 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -17,6 +17,7 @@ 'database' => [ 'enabled' => false, 'connection' => env('DB_CONNECTION', 'mysql'), + 'prefix' => '', ], 'commands' => [ diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php index 86847c2..8d1cdbf 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php @@ -2,16 +2,16 @@ declare(strict_types=1); -use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use PhpTelegramBot\Laravel\Migration; class UpdateSchema0530To0540 extends Migration { public function up(): void { try { - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('game')->nullable()->comment('Message is a game, information about the game.')->after('document'); }); } catch (Exception $e) { @@ -22,7 +22,7 @@ public function up(): void public function down(): void { try { - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('game'); }); } catch (Exception $e) { diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php index 9aafcc0..ea2f159 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php @@ -2,16 +2,16 @@ declare(strict_types=1); -use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use PhpTelegramBot\Laravel\Migration; class UpdateSchema0541To0550 extends Migration { public function up(): void { try { - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('animation')->nullable()->comment('Message is an animation, information about the animation')->after('document'); $table->text('passport_data')->nullable()->comment('Telegram Passport data')->after('connected_website'); }); @@ -23,7 +23,7 @@ public function up(): void public function down(): void { try { - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('passport_data'); $table->dropColumn('animation'); }); diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php index f5c6133..c41d1f4 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php @@ -2,25 +2,25 @@ declare(strict_types=1); -use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use PhpTelegramBot\Laravel\Migration; class UpdateSchema0560To0570 extends Migration { public function up(): void { try { - Schema::create('shipping_query', static function (Blueprint $table) { + Schema::create($this->prefix . 'shipping_query', function (Blueprint $table) { $table->bigInteger('id')->unsigned()->primary()->comment('Unique query identifier'); $table->bigInteger('user_id')->index('user_id')->comment('User who sent the query'); $table->char('invoice_payload', 255)->default('')->comment('Bot specified invoice payload'); $table->char('shipping_address', 255)->default('')->comment('User specified shipping address'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('user_id', 'shipping_query_ibfk_1')->references('id')->on('user')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('user_id', $this->prefix . 'shipping_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('CASCADE')->onDelete('CASCADE'); }); - Schema::create('pre_checkout_query', static function (Blueprint $table) { + Schema::create($this->prefix . 'pre_checkout_query', function (Blueprint $table) { $table->bigInteger('id')->unsigned()->primary()->comment('Unique query identifier'); $table->bigInteger('user_id')->index('user_id')->comment('User who sent the query'); $table->char('currency', 3)->comment('Three-letter ISO 4217 currency code'); @@ -29,10 +29,10 @@ public function up(): void $table->char('shipping_option_id', 255)->comment('Identifier of the shipping option chosen by the user'); $table->text('order_info')->comment('Order info provided by the user'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('user_id', 'pre_checkout_query_ibfk_1')->references('id')->on('user')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('user_id', $this->prefix . 'pre_checkout_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('CASCADE')->onDelete('CASCADE'); }); - Schema::create('poll', static function (Blueprint $table) { + Schema::create($this->prefix . 'poll', static function (Blueprint $table) { $table->bigInteger('id')->unsigned()->primary()->comment('Unique poll identifier'); $table->char('question', 255)->comment('Poll question'); $table->text('options')->comment('List of poll options'); @@ -40,17 +40,17 @@ public function up(): void $table->dateTime('created_at')->nullable()->comment('Entry date creation'); }); - Schema::table('callback_query', static function (Blueprint $table) { + Schema::table($this->prefix . 'callback_query', static function (Blueprint $table) { $table->char('chat_instance', 255)->default('')->comment('Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent')->after('inline_message_id'); $table->char('game_short_name', 255)->default('')->comment('Short name of a Game to be returned, serves as the unique identifier for the game')->after('data'); }); - Schema::table('chat', static function (Blueprint $table) { + Schema::table($this->prefix . 'chat', static function (Blueprint $table) { $table->char('first_name', 255)->nullable()->comment('First name of the other party in a private chat')->after('username'); $table->char('last_name', 255)->nullable()->comment('Last name of the other party in a private chat')->after('first_name'); }); - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('forward_signature')->nullable()->default(null)->comment('For messages forwarded from channels, signature of the post author if present')->after('forward_from_message_id'); $table->text('forward_sender_name')->nullable()->default(null)->comment('Sender\'s name for messages forwarded from users who disallow adding a link to their account in forwarded messages')->after('forward_signature'); $table->unsignedBigInteger('edit_date')->default(null)->comment('Date the message was last edited in Unix time')->after('reply_to_message'); @@ -61,7 +61,7 @@ public function up(): void $table->text('successful_payment')->nullable()->comment('Message is a service message about a successful payment, information about the payment')->after('invoice'); }); - Schema::table('telegram_update', static function (Blueprint $table) { + Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { $table->bigInteger('channel_post_id')->unsigned()->nullable()->comment('New incoming channel post of any kind - text, photo, sticker, etc.'); $table->bigInteger('edited_channel_post_id')->unsigned()->nullable()->comment('New version of a channel post that is known to the bot and was edited'); $table->bigInteger('shipping_query_id')->unsigned()->nullable()->comment('New incoming shipping query. Only for invoices with flexible price'); @@ -74,11 +74,11 @@ public function up(): void $table->index('pre_checkout_query_id', 'pre_checkout_query_id'); $table->index('poll_id', 'poll_id'); - $table->foreign(['chat_id', 'channel_post_id'], 'telegram_update_ibfk_6')->references(['chat_id', 'id'])->on('message'); - $table->foreign('edited_channel_post_id', 'telegram_update_ibfk_7')->references('id')->on('edited_message'); - $table->foreign('shipping_query_id', 'telegram_update_ibfk_8')->references('id')->on('shipping_query'); - $table->foreign('pre_checkout_query_id', 'telegram_update_ibfk_9')->references('id')->on('pre_checkout_query'); - $table->foreign('poll_id', 'telegram_update_ibfk_10')->references('id')->on('poll'); + $table->foreign(['chat_id', 'channel_post_id'], $this->prefix . 'telegram_update_ibfk_6')->references(['chat_id', 'id'])->on($this->prefix . 'message'); + $table->foreign('edited_channel_post_id', $this->prefix . 'telegram_update_ibfk_7')->references('id')->on($this->prefix . 'edited_message'); + $table->foreign('shipping_query_id', $this->prefix . 'telegram_update_ibfk_8')->references('id')->on($this->prefix . 'shipping_query'); + $table->foreign('pre_checkout_query_id', $this->prefix . 'telegram_update_ibfk_9')->references('id')->on($this->prefix . 'pre_checkout_query'); + $table->foreign('poll_id', $this->prefix . 'telegram_update_ibfk_10')->references('id')->on($this->prefix . 'poll'); }); } catch (Exception $e) { // Migration may be partly done already... @@ -88,12 +88,12 @@ public function up(): void public function down(): void { try { - Schema::table('telegram_update', static function (Blueprint $table) { - $table->dropForeign('telegram_update_ibfk_10'); - $table->dropForeign('telegram_update_ibfk_9'); - $table->dropForeign('telegram_update_ibfk_8'); - $table->dropForeign('telegram_update_ibfk_7'); - $table->dropForeign('telegram_update_ibfk_6'); + Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { + $table->dropForeign($this->prefix . 'telegram_update_ibfk_10'); + $table->dropForeign($this->prefix . 'telegram_update_ibfk_9'); + $table->dropForeign($this->prefix . 'telegram_update_ibfk_8'); + $table->dropForeign($this->prefix . 'telegram_update_ibfk_7'); + $table->dropForeign($this->prefix . 'telegram_update_ibfk_6'); $table->dropIndex('poll_id'); $table->dropIndex('pre_checkout_query_id'); @@ -108,7 +108,7 @@ public function down(): void $table->dropColumn('channel_post_id'); }); - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('successful_payment'); $table->dropColumn('invoice'); $table->dropColumn('poll'); @@ -119,20 +119,19 @@ public function down(): void $table->dropColumn('forward_signature'); }); - - Schema::table('chat', static function (Blueprint $table) { + Schema::table($this->prefix . 'chat', static function (Blueprint $table) { $table->dropColumn('last_name'); $table->dropColumn('first_name'); }); - Schema::table('callback_query', static function (Blueprint $table) { + Schema::table($this->prefix . 'callback_query', static function (Blueprint $table) { $table->dropColumn('game_short_name'); $table->dropColumn('chat_instance'); }); - Schema::dropIfExists('poll'); - Schema::dropIfExists('pre_checkout_query'); - Schema::dropIfExists('shipping_query'); + Schema::dropIfExists($this->prefix . 'poll'); + Schema::dropIfExists($this->prefix . 'pre_checkout_query'); + Schema::dropIfExists($this->prefix . 'shipping_query'); } catch (Exception $e) { // Migration may be partly done already... } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php index ab1fd5b..7a22cc0 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php @@ -2,16 +2,17 @@ declare(strict_types=1); -use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use PhpTelegramBot\Laravel\Migration; class UpdateSchema0570To0580 extends Migration { public function up(): void { try { - Schema::table('message', static function (Blueprint $table) { + Schema::dropIfExists($this->prefix . 'botan_shortener'); + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('reply_markup')->nullable()->comment('Inline keyboard attached to the message')->after('passport_data'); }); } catch (Exception $e) { @@ -22,7 +23,7 @@ public function up(): void public function down(): void { try { - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('reply_markup'); }); } catch (Exception $e) { diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php index 8c01493..e90a874 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php @@ -2,9 +2,9 @@ declare(strict_types=1); -use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use PhpTelegramBot\Laravel\Migration; class UpdateSchema0600To0610 extends Migration { @@ -13,7 +13,7 @@ public function up(): void Schema::disableForeignKeyConstraints(); try { - Schema::table('telegram_update', static function (Blueprint $table) { + Schema::table($this->prefix . 'telegram_update', static function (Blueprint $table) { $table->dropIndex('message_id'); $table->index('message_id', 'message_id'); $table->index(['chat_id', 'message_id'], 'chat_message_id'); @@ -30,7 +30,7 @@ public function down(): void Schema::disableForeignKeyConstraints(); try { - Schema::table('telegram_update', static function (Blueprint $table) { + Schema::table($this->prefix . 'telegram_update', static function (Blueprint $table) { $table->dropIndex('chat_message_id'); $table->dropIndex('message_id'); $table->index('message_id', 'message_id'); diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php index e307051..cc7c889 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php @@ -2,16 +2,16 @@ declare(strict_types=1); -use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use PhpTelegramBot\Laravel\Migration; class UpdateSchema0611To0620 extends Migration { public function up(): void { try { - Schema::table('poll', static function (Blueprint $table) { + Schema::table($this->prefix . 'poll', static function (Blueprint $table) { $table->integer('total_voter_count')->unsigned()->comment('Total number of users that voted in the poll')->after('options'); $table->tinyInteger('is_anonymous')->default(1)->comment('True, if the poll is anonymous')->after('is_closed'); $table->char('type', 255)->comment('Poll type, currently can be “regular” or “quiz”')->after('is_anonymous'); @@ -19,22 +19,22 @@ public function up(): void $table->integer('correct_option_id')->unsigned()->comment('0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.')->after('allows_multiple_answers'); }); - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('dice')->nullable()->comment('Message is a dice with random value from 1 to 6')->after('poll'); }); - Schema::create('poll_answer', static function (Blueprint $table) { + Schema::create($this->prefix . 'poll_answer', function (Blueprint $table) { $table->bigInteger('poll_id', true, true)->comment('Unique poll identifier'); $table->bigInteger('user_id')->nullable(false)->comment('The user, who changed the answer to the poll'); $table->text('option_ids')->nullable(false)->comment('0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('poll_id', 'poll_answer_ibfk_1')->references('id')->on('poll')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('poll_id', $this->prefix . 'poll_answer_ibfk_1')->references('id')->on($this->prefix . 'poll')->onUpdate('CASCADE')->onDelete('CASCADE'); }); - Schema::table('telegram_update', static function (Blueprint $table) { + Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { $table->bigInteger('poll_answer_poll_id')->unsigned()->nullable()->comment('A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.')->after('poll_id'); $table->index('poll_answer_poll_id', 'poll_answer_poll_id'); - $table->foreign('poll_answer_poll_id', 'telegram_update_ibfk_11')->references('poll_id')->on('poll_answer')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('poll_answer_poll_id', $this->prefix . 'telegram_update_ibfk_11')->references('poll_id')->on($this->prefix . 'poll_answer')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } catch (Exception $e) { // Migration may be partly done already... @@ -44,19 +44,19 @@ public function up(): void public function down(): void { try { - Schema::table('telegram_update', static function (Blueprint $table) { - $table->dropForeign('telegram_update_ibfk_11'); + Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { + $table->dropForeign($this->prefix . 'telegram_update_ibfk_11'); $table->dropIndex('poll_answer_poll_id'); $table->dropColumn('poll_answer_poll_id'); }); - Schema::dropIfExists('poll_answer'); + Schema::dropIfExists($this->prefix . 'poll_answer'); - Schema::table('message', static function (Blueprint $table) { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('dice'); }); - Schema::table('poll', static function (Blueprint $table) { + Schema::table($this->prefix . 'poll', static function (Blueprint $table) { $table->dropColumn('correct_option_id'); $table->dropColumn('allows_multiple_answers'); $table->dropColumn('type'); From b6cb4c96d143d6a0ed522e001d7f3391e4731a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 18 May 2020 22:31:02 +0200 Subject: [PATCH 41/63] RESTRICT instead of CASCADE for foreign keys --- .../2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php | 4 ++-- .../2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php index c41d1f4..bae27e6 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php @@ -17,7 +17,7 @@ public function up(): void $table->char('invoice_payload', 255)->default('')->comment('Bot specified invoice payload'); $table->char('shipping_address', 255)->default('')->comment('User specified shipping address'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('user_id', $this->prefix . 'shipping_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('user_id', $this->prefix . 'shipping_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); Schema::create($this->prefix . 'pre_checkout_query', function (Blueprint $table) { @@ -29,7 +29,7 @@ public function up(): void $table->char('shipping_option_id', 255)->comment('Identifier of the shipping option chosen by the user'); $table->text('order_info')->comment('Order info provided by the user'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('user_id', $this->prefix . 'pre_checkout_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('user_id', $this->prefix . 'pre_checkout_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); Schema::create($this->prefix . 'poll', static function (Blueprint $table) { diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php index cc7c889..3baf19c 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php @@ -14,7 +14,7 @@ public function up(): void Schema::table($this->prefix . 'poll', static function (Blueprint $table) { $table->integer('total_voter_count')->unsigned()->comment('Total number of users that voted in the poll')->after('options'); $table->tinyInteger('is_anonymous')->default(1)->comment('True, if the poll is anonymous')->after('is_closed'); - $table->char('type', 255)->comment('Poll type, currently can be “regular” or “quiz”')->after('is_anonymous'); + $table->char('type', 255)->comment('Poll type, currently can be "regular" or "quiz"')->after('is_anonymous'); $table->tinyInteger('allows_multiple_answers')->default(0)->comment('True, if the poll allows multiple answers')->after('type'); $table->integer('correct_option_id')->unsigned()->comment('0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.')->after('allows_multiple_answers'); }); @@ -28,13 +28,13 @@ public function up(): void $table->bigInteger('user_id')->nullable(false)->comment('The user, who changed the answer to the poll'); $table->text('option_ids')->nullable(false)->comment('0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('poll_id', $this->prefix . 'poll_answer_ibfk_1')->references('id')->on($this->prefix . 'poll')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('poll_id', $this->prefix . 'poll_answer_ibfk_1')->references('id')->on($this->prefix . 'poll')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { $table->bigInteger('poll_answer_poll_id')->unsigned()->nullable()->comment('A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.')->after('poll_id'); $table->index('poll_answer_poll_id', 'poll_answer_poll_id'); - $table->foreign('poll_answer_poll_id', $this->prefix . 'telegram_update_ibfk_11')->references('poll_id')->on($this->prefix . 'poll_answer')->onUpdate('CASCADE')->onDelete('CASCADE'); + $table->foreign('poll_answer_poll_id', $this->prefix . 'telegram_update_ibfk_11')->references('poll_id')->on($this->prefix . 'poll_answer')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } catch (Exception $e) { // Migration may be partly done already... From d72f2b15ea45a70e02abb99efafb1570dee1e2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 18 May 2020 23:15:18 +0200 Subject: [PATCH 42/63] Fix phpcs issues --- .travis.yml | 15 ++++++--------- src/Laravel/Commands/WebhookCommand.php | 18 +++++++++++++----- src/Laravel/Migration.php | 8 +++----- src/Laravel/PhpTelegramBot.php | 5 +++-- src/Laravel/PhpTelegramBotContract.php | 5 +++-- src/Laravel/ServiceProvider.php | 11 ++++++----- ...8_000000_update_schema_0_53_0_to_0_54_0.php | 8 ++++---- ...8_000000_update_schema_0_54_1_to_0_55_0.php | 8 ++++---- ...8_000000_update_schema_0_56_0_to_0_57_0.php | 8 ++++---- ...8_000000_update_schema_0_57_0_to_0_58_0.php | 8 ++++---- ...8_000000_update_schema_0_60_0_to_0_61_0.php | 8 ++++---- ...8_000000_update_schema_0_61_1_to_0_62_0.php | 8 ++++---- 12 files changed, 58 insertions(+), 52 deletions(-) diff --git a/.travis.yml b/.travis.yml index b51afc0..a7f164e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ language: php +sudo: false php: - - 7.2 - - 7.3 - - 7.4 - -sudo: false + - 7.2 + - 7.3 + - 7.4 before_install: - composer self-update @@ -17,7 +16,6 @@ script: - ./vendor/bin/phpcs --standard=phpcs.xml -spn --encoding=utf-8 src/ --report-width=150 - ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml - after_script: - wget https://scrutinizer-ci.com/ocular.phar - then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml @@ -25,7 +23,6 @@ after_script: matrix: fast_finish: true - notifications: - on_success: never - on_failure: always + on_success: never + on_failure: always diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index 17e38f2..1f55212 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + declare(strict_types=1); namespace PhpTelegramBot\Laravel\Commands; @@ -25,10 +34,10 @@ public function __construct(PhpTelegramBotContract $telegramBot) $this->telegramBot = $telegramBot; } - public function handle() + public function handle(): void { $webhook = $this->argument('webhook'); - $delete = $this->option('delete'); + $delete = $this->option('delete'); if (! ($webhook || $delete)) { $this->error('Not enough arguments!'); @@ -39,7 +48,7 @@ public function handle() if ($delete) { try { $this->telegramBot->deleteWebhook(); - $this->info('Webhook deleted succesfully!'); + $this->info('Webhook deleted successfully!'); } catch (TelegramException $e) { $this->error("Couldn't delete webhook"); $this->error($e->getMessage()); @@ -47,11 +56,10 @@ public function handle() } } - if ($webhook) { try { $this->telegramBot->setWebhook($webhook); - $this->info('Webhook set succesfully!'); + $this->info('Webhook set successfully!'); } catch (TelegramException $e) { $this->error("Couldn't set webhook"); $this->error($e->getMessage()); diff --git a/src/Laravel/Migration.php b/src/Laravel/Migration.php index 7e88f61..1666a20 100644 --- a/src/Laravel/Migration.php +++ b/src/Laravel/Migration.php @@ -1,7 +1,5 @@ publishes([ @@ -52,7 +53,7 @@ public function boot() * * @return void */ - public function register() + public function register(): void { $this->app->bind(PhpTelegramBotContract::class, static function ($app) { $config = $app['config']->get('phptelegrambot'); @@ -108,7 +109,7 @@ public function register() * * @return array */ - public function provides() + public function provides(): array { return [PhpTelegramBotContract::class]; } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php index 8d1cdbf..9aa5af0 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php @@ -14,8 +14,8 @@ public function up(): void Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('game')->nullable()->comment('Message is a game, information about the game.')->after('document'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } @@ -25,8 +25,8 @@ public function down(): void Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('game'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php index ea2f159..a6c4e0d 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php @@ -15,8 +15,8 @@ public function up(): void $table->text('animation')->nullable()->comment('Message is an animation, information about the animation')->after('document'); $table->text('passport_data')->nullable()->comment('Telegram Passport data')->after('connected_website'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } @@ -27,8 +27,8 @@ public function down(): void $table->dropColumn('passport_data'); $table->dropColumn('animation'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php index bae27e6..d6eb520 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php @@ -80,8 +80,8 @@ public function up(): void $table->foreign('pre_checkout_query_id', $this->prefix . 'telegram_update_ibfk_9')->references('id')->on($this->prefix . 'pre_checkout_query'); $table->foreign('poll_id', $this->prefix . 'telegram_update_ibfk_10')->references('id')->on($this->prefix . 'poll'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } @@ -132,8 +132,8 @@ public function down(): void Schema::dropIfExists($this->prefix . 'poll'); Schema::dropIfExists($this->prefix . 'pre_checkout_query'); Schema::dropIfExists($this->prefix . 'shipping_query'); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php index 7a22cc0..87b5aa6 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php @@ -15,8 +15,8 @@ public function up(): void Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('reply_markup')->nullable()->comment('Inline keyboard attached to the message')->after('passport_data'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } @@ -26,8 +26,8 @@ public function down(): void Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('reply_markup'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php index e90a874..409d1c9 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php @@ -18,8 +18,8 @@ public function up(): void $table->index('message_id', 'message_id'); $table->index(['chat_id', 'message_id'], 'chat_message_id'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } Schema::enableForeignKeyConstraints(); @@ -35,8 +35,8 @@ public function down(): void $table->dropIndex('message_id'); $table->index('message_id', 'message_id'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } Schema::enableForeignKeyConstraints(); diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php index 3baf19c..ad81093 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php @@ -36,8 +36,8 @@ public function up(): void $table->index('poll_answer_poll_id', 'poll_answer_poll_id'); $table->foreign('poll_answer_poll_id', $this->prefix . 'telegram_update_ibfk_11')->references('poll_id')->on($this->prefix . 'poll_answer')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } @@ -63,8 +63,8 @@ public function down(): void $table->dropColumn('is_anonymous'); $table->dropColumn('total_voter_count'); }); - } catch (Exception $e) { - // Migration may be partly done already... + } catch (Throwable $e) { + return; // Migration may be partly done already... } } } From 4476eed3594a71d75cb9c354ddd4ee3ef45dbe31 Mon Sep 17 00:00:00 2001 From: Sergey Asafov Date: Wed, 20 May 2020 13:31:56 +0300 Subject: [PATCH 43/63] Logs and few features (#11) Add log output for failed migrations, introduce missing environment variables. --- src/config/config.php | 6 +++--- .../2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php | 2 ++ .../2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php | 2 ++ .../2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php | 2 ++ .../2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php | 2 ++ .../2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php | 2 ++ .../2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php | 2 ++ 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/config/config.php b/src/config/config.php index 0f6ff98..aba301c 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -17,7 +17,7 @@ 'database' => [ 'enabled' => false, 'connection' => env('DB_CONNECTION', 'mysql'), - 'prefix' => '', + 'prefix' => env('PHP_TELEGRAM_BOT_TABLE_PREFIX', ''), ], 'commands' => [ @@ -42,6 +42,6 @@ 'interval' => 1, ], - 'upload_path' => '', - 'download_path' => '', + 'upload_path' => env('PHP_TELEGRAM_BOT_UPLOAD_PATH', ''), + 'download_path' => env('PHP_TELEGRAM_BOT_DOWNLOAD_PATH', ''), ]; diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php index 9aa5af0..0446a39 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php @@ -15,6 +15,7 @@ public function up(): void $table->text('game')->nullable()->comment('Message is a game, information about the game.')->after('document'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } @@ -26,6 +27,7 @@ public function down(): void $table->dropColumn('game'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php index a6c4e0d..b6a3059 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php @@ -16,6 +16,7 @@ public function up(): void $table->text('passport_data')->nullable()->comment('Telegram Passport data')->after('connected_website'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } @@ -28,6 +29,7 @@ public function down(): void $table->dropColumn('animation'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php index d6eb520..113224c 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php @@ -81,6 +81,7 @@ public function up(): void $table->foreign('poll_id', $this->prefix . 'telegram_update_ibfk_10')->references('id')->on($this->prefix . 'poll'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } @@ -133,6 +134,7 @@ public function down(): void Schema::dropIfExists($this->prefix . 'pre_checkout_query'); Schema::dropIfExists($this->prefix . 'shipping_query'); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php index 87b5aa6..5c05713 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php @@ -16,6 +16,7 @@ public function up(): void $table->text('reply_markup')->nullable()->comment('Inline keyboard attached to the message')->after('passport_data'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } @@ -27,6 +28,7 @@ public function down(): void $table->dropColumn('reply_markup'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php index 409d1c9..cf18e24 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php @@ -19,6 +19,7 @@ public function up(): void $table->index(['chat_id', 'message_id'], 'chat_message_id'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } @@ -36,6 +37,7 @@ public function down(): void $table->index('message_id', 'message_id'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php index ad81093..d799d66 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php @@ -37,6 +37,7 @@ public function up(): void $table->foreign('poll_answer_poll_id', $this->prefix . 'telegram_update_ibfk_11')->references('poll_id')->on($this->prefix . 'poll_answer')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } @@ -64,6 +65,7 @@ public function down(): void $table->dropColumn('total_voter_count'); }); } catch (Throwable $e) { + \Log::error($e->getMessage ()); return; // Migration may be partly done already... } } From beb31904e8f7ba7070f644e9ab684e2ad0c30d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 25 May 2020 13:08:46 +0200 Subject: [PATCH 44/63] Fix up initial migrations to use proper table dropping and remove obsolete method parameters. --- ...18_193554_create_botan_shortener_table.php | 9 ++-- ..._18_193554_create_callback_query_table.php | 7 +-- .../2018_04_18_193554_create_chat_table.php | 7 +-- ...3554_create_chosen_inline_result_table.php | 9 ++-- ...04_18_193554_create_conversation_table.php | 9 ++-- ..._18_193554_create_edited_message_table.php | 16 +++--- ...04_18_193554_create_inline_query_table.php | 9 ++-- ...2018_04_18_193554_create_message_table.php | 49 +++++++++---------- ...18_193554_create_request_limiter_table.php | 7 +-- ...18_193554_create_telegram_update_table.php | 7 +-- ...18_04_18_193554_create_user_chat_table.php | 7 +-- .../2018_04_18_193554_create_user_table.php | 7 +-- ..._foreign_keys_to_botan_shortener_table.php | 5 +- ...d_foreign_keys_to_callback_query_table.php | 5 +- ...ign_keys_to_chosen_inline_result_table.php | 5 +- ...add_foreign_keys_to_conversation_table.php | 5 +- ...d_foreign_keys_to_edited_message_table.php | 5 +- ...add_foreign_keys_to_inline_query_table.php | 5 +- ...3555_add_foreign_keys_to_message_table.php | 5 +- ..._foreign_keys_to_telegram_update_table.php | 10 ++-- ...55_add_foreign_keys_to_user_chat_table.php | 5 +- 21 files changed, 101 insertions(+), 92 deletions(-) diff --git a/src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php b/src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php index 226d2d6..a397212 100644 --- a/src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php +++ b/src/database/migrations/2018_04_18_193554_create_botan_shortener_table.php @@ -4,22 +4,23 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateBotanShortenerTable extends Migration { - public function up() + public function up(): void { Schema::create('botan_shortener', static function (Blueprint $table) { $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); - $table->text('url', 65535)->comment('Original URL'); + $table->text('url')->comment('Original URL'); $table->char('short_url')->default('')->comment('Shortened URL'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); }); } - public function down() + public function down(): void { - Schema::drop('botan_shortener'); + Schema::dropIfExists('botan_shortener'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_callback_query_table.php b/src/database/migrations/2018_04_18_193554_create_callback_query_table.php index 7f4894b..09ef7a8 100644 --- a/src/database/migrations/2018_04_18_193554_create_callback_query_table.php +++ b/src/database/migrations/2018_04_18_193554_create_callback_query_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateCallbackQueryTable extends Migration { - public function up() + public function up(): void { Schema::create('callback_query', static function (Blueprint $table) { $table->bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query'); @@ -21,8 +22,8 @@ public function up() }); } - public function down() + public function down(): void { - Schema::drop('callback_query'); + Schema::dropIfExists('callback_query'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_chat_table.php b/src/database/migrations/2018_04_18_193554_create_chat_table.php index babd1af..cba9bf2 100644 --- a/src/database/migrations/2018_04_18_193554_create_chat_table.php +++ b/src/database/migrations/2018_04_18_193554_create_chat_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateChatTable extends Migration { - public function up() + public function up(): void { Schema::create('chat', static function (Blueprint $table) { $table->bigInteger('id')->primary()->comment('Unique user or chat identifier'); @@ -20,8 +21,8 @@ public function up() }); } - public function down() + public function down(): void { - Schema::drop('chat'); + Schema::dropIfExists('chat'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php b/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php index ec678b8..194b33b 100644 --- a/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php +++ b/src/database/migrations/2018_04_18_193554_create_chosen_inline_result_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateChosenInlineResultTable extends Migration { - public function up() + public function up(): void { Schema::create('chosen_inline_result', static function (Blueprint $table) { $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); @@ -15,13 +16,13 @@ public function up() $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->char('location')->nullable()->comment('Location object, user\'s location'); $table->char('inline_message_id')->nullable()->comment('Identifier of the sent inline message'); - $table->text('query', 65535)->comment('The query that was used to obtain the result'); + $table->text('query')->comment('The query that was used to obtain the result'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); }); } - public function down() + public function down(): void { - Schema::drop('chosen_inline_result'); + Schema::dropIfExists('chosen_inline_result'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_conversation_table.php b/src/database/migrations/2018_04_18_193554_create_conversation_table.php index 20e9e9a..c5b5373 100644 --- a/src/database/migrations/2018_04_18_193554_create_conversation_table.php +++ b/src/database/migrations/2018_04_18_193554_create_conversation_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateConversationTable extends Migration { - public function up() + public function up(): void { Schema::create('conversation', static function (Blueprint $table) { $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); @@ -15,13 +16,13 @@ public function up() $table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique user or chat identifier'); $table->enum('status', ['active', 'cancelled', 'stopped'])->default('active')->index('status')->comment('Conversation state'); $table->string('command', 160)->nullable()->default('')->comment('Default command to execute'); - $table->text('notes', 65535)->nullable()->comment('Data stored from command'); + $table->text('notes')->nullable()->comment('Data stored from command'); $table->timestamps(); }); } - public function down() + public function down(): void { - Schema::drop('conversation'); + Schema::dropIfExists('conversation'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_edited_message_table.php b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php index c571352..05ff7f1 100644 --- a/src/database/migrations/2018_04_18_193554_create_edited_message_table.php +++ b/src/database/migrations/2018_04_18_193554_create_edited_message_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateEditedMessageTable extends Migration { - public function up() + public function up(): void { Schema::create('edited_message', static function (Blueprint $table) { $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); @@ -15,18 +16,15 @@ public function up() $table->bigInteger('message_id')->unsigned()->nullable()->index('message_id')->comment('Unique message identifier'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->dateTime('edit_date')->nullable()->comment('Date the message was edited in timestamp format'); - $table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8'); - $table->text( - 'entities', - 65535 - )->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); - $table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); + $table->text('text')->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8'); + $table->text('entities')->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); + $table->text('caption')->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); $table->index(['chat_id', 'message_id'], 'chat_id_2'); }); } - public function down() + public function down(): void { - Schema::drop('edited_message'); + Schema::dropIfExists('edited_message'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_inline_query_table.php b/src/database/migrations/2018_04_18_193554_create_inline_query_table.php index a188c96..efc00c2 100644 --- a/src/database/migrations/2018_04_18_193554_create_inline_query_table.php +++ b/src/database/migrations/2018_04_18_193554_create_inline_query_table.php @@ -4,23 +4,24 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateInlineQueryTable extends Migration { - public function up() + public function up(): void { Schema::create('inline_query', static function (Blueprint $table) { $table->bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query'); $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); $table->char('location')->nullable()->comment('Location of the user'); - $table->text('query', 65535)->comment('Text of the query'); + $table->text('query')->comment('Text of the query'); $table->char('offset')->nullable()->comment('Offset of the result'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); }); } - public function down() + public function down(): void { - Schema::drop('inline_query'); + Schema::dropIfExists('inline_query'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_message_table.php b/src/database/migrations/2018_04_18_193554_create_message_table.php index e9ded18..22d8b82 100644 --- a/src/database/migrations/2018_04_18_193554_create_message_table.php +++ b/src/database/migrations/2018_04_18_193554_create_message_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateMessageTable extends Migration { - public function up() + public function up(): void { Schema::create('message', static function (Blueprint $table) { $table->bigInteger('chat_id')->comment('Unique chat identifier'); @@ -20,45 +21,39 @@ public function up() $table->dateTime('forward_date')->nullable()->comment('date the original message was sent in timestamp format'); $table->bigInteger('reply_to_chat')->nullable()->index('reply_to_chat')->comment('Unique chat identifier'); $table->bigInteger('reply_to_message')->unsigned()->nullable()->index('reply_to_message')->comment('Message that this message is reply to'); - $table->text('media_group_id', 65535)->nullable()->comment('The unique identifier of a media message group this message belongs to'); - $table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4'); - $table->text( - 'entities', - 65535 - )->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); - $table->text('audio', 65535)->nullable()->comment('Audio object. Message is an audio file, information about the file'); - $table->text('document', 65535)->nullable()->comment('Document object. Message is a general file, information about the file'); - $table->text('photo', 65535)->nullable()->comment('Array of PhotoSize objects. Message is a photo, available sizes of the photo'); - $table->text('sticker', 65535)->nullable()->comment('Sticker object. Message is a sticker, information about the sticker'); - $table->text('video', 65535)->nullable()->comment('Video object. Message is a video, information about the video'); - $table->text('voice', 65535)->nullable()->comment('Voice Object. Message is a Voice, information about the Voice'); - $table->text('video_note', 65535)->nullable()->comment('VoiceNote Object. Message is a Video Note, information about the Video Note'); - $table->text('contact', 65535)->nullable()->comment('Contact object. Message is a shared contact, information about the contact'); - $table->text('location', 65535)->nullable()->comment('Location object. Message is a shared location, information about the location'); - $table->text('venue', 65535)->nullable()->comment('Venue object. Message is a Venue, information about the Venue'); - $table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); - $table->text( - 'new_chat_members', - 65535 - )->nullable()->comment('List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)'); + $table->text('media_group_id')->nullable()->comment('The unique identifier of a media message group this message belongs to'); + $table->text('text')->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4'); + $table->text('entities')->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text'); + $table->text('audio')->nullable()->comment('Audio object. Message is an audio file, information about the file'); + $table->text('document')->nullable()->comment('Document object. Message is a general file, information about the file'); + $table->text('photo')->nullable()->comment('Array of PhotoSize objects. Message is a photo, available sizes of the photo'); + $table->text('sticker')->nullable()->comment('Sticker object. Message is a sticker, information about the sticker'); + $table->text('video')->nullable()->comment('Video object. Message is a video, information about the video'); + $table->text('voice')->nullable()->comment('Voice Object. Message is a Voice, information about the Voice'); + $table->text('video_note')->nullable()->comment('VoiceNote Object. Message is a Video Note, information about the Video Note'); + $table->text('contact')->nullable()->comment('Contact object. Message is a shared contact, information about the contact'); + $table->text('location')->nullable()->comment('Location object. Message is a shared location, information about the location'); + $table->text('venue')->nullable()->comment('Venue object. Message is a Venue, information about the Venue'); + $table->text('caption')->nullable()->comment('For message with caption, the actual UTF-8 text of the caption'); + $table->text('new_chat_members')->nullable()->comment('List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)'); $table->bigInteger('left_chat_member')->nullable()->index('left_chat_member')->comment('Unique user identifier, a member was removed from the group, information about them (this member may be the bot itself)'); $table->char('new_chat_title')->nullable()->comment('A chat title was changed to this value'); - $table->text('new_chat_photo', 65535)->nullable()->comment('Array of PhotoSize objects. A chat photo was change to this value'); + $table->text('new_chat_photo')->nullable()->comment('Array of PhotoSize objects. A chat photo was change to this value'); $table->boolean('delete_chat_photo')->nullable()->default(0)->comment('Informs that the chat photo was deleted'); $table->boolean('group_chat_created')->nullable()->default(0)->comment('Informs that the group has been created'); $table->boolean('supergroup_chat_created')->nullable()->default(0)->comment('Informs that the supergroup has been created'); $table->boolean('channel_chat_created')->nullable()->default(0)->comment('Informs that the channel chat has been created'); $table->bigInteger('migrate_to_chat_id')->nullable()->index('migrate_to_chat_id')->comment('Migrate to chat identifier. The group has been migrated to a supergroup with the specified identifier'); $table->bigInteger('migrate_from_chat_id')->nullable()->index('migrate_from_chat_id')->comment('Migrate from chat identifier. The supergroup has been migrated from a group with the specified identifier'); - $table->text('pinned_message', 65535)->nullable()->comment('Message object. Specified message was pinned'); - $table->text('connected_website', 65535)->nullable()->comment('The domain name of the website on which the user has logged in.'); + $table->text('pinned_message')->nullable()->comment('Message object. Specified message was pinned'); + $table->text('connected_website')->nullable()->comment('The domain name of the website on which the user has logged in.'); $table->primary(['chat_id', 'id']); $table->index(['reply_to_chat', 'reply_to_message'], 'reply_to_chat_2'); }); } - public function down() + public function down(): void { - Schema::drop('message'); + Schema::dropIfExists('message'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php b/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php index d5e7cb7..f048b52 100644 --- a/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php +++ b/src/database/migrations/2018_04_18_193554_create_request_limiter_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateRequestLimiterTable extends Migration { - public function up() + public function up(): void { Schema::create('request_limiter', static function (Blueprint $table) { $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); @@ -18,8 +19,8 @@ public function up() }); } - public function down() + public function down(): void { - Schema::drop('request_limiter'); + Schema::dropIfExists('request_limiter'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php b/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php index 39b552e..59b8e05 100644 --- a/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php +++ b/src/database/migrations/2018_04_18_193554_create_telegram_update_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateTelegramUpdateTable extends Migration { - public function up() + public function up(): void { Schema::create('telegram_update', static function (Blueprint $table) { $table->bigInteger('id')->unsigned()->primary()->comment('Update\'s unique identifier'); @@ -21,8 +22,8 @@ public function up() }); } - public function down() + public function down(): void { - Schema::drop('telegram_update'); + Schema::dropIfExists('telegram_update'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_user_chat_table.php b/src/database/migrations/2018_04_18_193554_create_user_chat_table.php index 3e4f7b7..a604e60 100644 --- a/src/database/migrations/2018_04_18_193554_create_user_chat_table.php +++ b/src/database/migrations/2018_04_18_193554_create_user_chat_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateUserChatTable extends Migration { - public function up() + public function up(): void { Schema::create('user_chat', static function (Blueprint $table) { $table->bigInteger('user_id')->comment('Unique user identifier'); @@ -16,8 +17,8 @@ public function up() }); } - public function down() + public function down(): void { - Schema::drop('user_chat'); + Schema::dropIfExists('user_chat'); } } diff --git a/src/database/migrations/2018_04_18_193554_create_user_table.php b/src/database/migrations/2018_04_18_193554_create_user_table.php index c70c12b..a2d4d9e 100644 --- a/src/database/migrations/2018_04_18_193554_create_user_table.php +++ b/src/database/migrations/2018_04_18_193554_create_user_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateUserTable extends Migration { - public function up() + public function up(): void { Schema::create('user', static function (Blueprint $table) { $table->bigInteger('id')->primary()->comment('Unique user identifier'); @@ -20,8 +21,8 @@ public function up() }); } - public function down() + public function down(): void { - Schema::drop('user'); + Schema::dropIfExists('user'); } } diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php index 4e35fcf..1dc1d61 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_botan_shortener_table.php @@ -4,17 +4,18 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToBotanShortenerTable extends Migration { - public function up() + public function up(): void { Schema::table('botan_shortener', static function (Blueprint $table) { $table->foreign('user_id', 'botan_shortener_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - public function down() + public function down(): void { Schema::table('botan_shortener', static function (Blueprint $table) { $table->dropForeign('botan_shortener_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php index be6101a..0e8aee4 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_callback_query_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToCallbackQueryTable extends Migration { - public function up() + public function up(): void { Schema::table('callback_query', static function (Blueprint $table) { $table->foreign('user_id', 'callback_query_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); @@ -15,7 +16,7 @@ public function up() }); } - public function down() + public function down(): void { Schema::table('callback_query', static function (Blueprint $table) { $table->dropForeign('callback_query_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php index a796b49..bfe0690 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_chosen_inline_result_table.php @@ -4,17 +4,18 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToChosenInlineResultTable extends Migration { - public function up() + public function up(): void { Schema::table('chosen_inline_result', static function (Blueprint $table) { $table->foreign('user_id', 'chosen_inline_result_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - public function down() + public function down(): void { Schema::table('chosen_inline_result', static function (Blueprint $table) { $table->dropForeign('chosen_inline_result_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php index 5405cf7..521a5fa 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_conversation_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToConversationTable extends Migration { - public function up() + public function up(): void { Schema::table('conversation', static function (Blueprint $table) { $table->foreign('user_id', 'conversation_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); @@ -15,7 +16,7 @@ public function up() }); } - public function down() + public function down(): void { Schema::table('conversation', static function (Blueprint $table) { $table->dropForeign('conversation_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php index f5e0568..625dcb7 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_edited_message_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToEditedMessageTable extends Migration { - public function up() + public function up(): void { Schema::table('edited_message', static function (Blueprint $table) { $table->foreign('chat_id', 'edited_message_ibfk_1')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); @@ -16,7 +17,7 @@ public function up() }); } - public function down() + public function down(): void { Schema::table('edited_message', static function (Blueprint $table) { $table->dropForeign('edited_message_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php index 3872300..25a712e 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_inline_query_table.php @@ -4,17 +4,18 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToInlineQueryTable extends Migration { - public function up() + public function up(): void { Schema::table('inline_query', static function (Blueprint $table) { $table->foreign('user_id', 'inline_query_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - public function down() + public function down(): void { Schema::table('inline_query', static function (Blueprint $table) { $table->dropForeign('inline_query_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php index 92e5cd0..eb66df2 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_message_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToMessageTable extends Migration { - public function up() + public function up(): void { Schema::table('message', static function (Blueprint $table) { $table->foreign('user_id', 'message_ibfk_1')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); @@ -20,7 +21,7 @@ public function up() }); } - public function down() + public function down(): void { Schema::table('message', static function (Blueprint $table) { $table->dropForeign('message_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php index fdf3d27..503e108 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php @@ -4,24 +4,22 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToTelegramUpdateTable extends Migration { - public function up() + public function up(): void { Schema::table('telegram_update', static function (Blueprint $table) { $table->foreign('chat_id', 'telegram_update_ibfk_1')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('inline_query_id', 'telegram_update_ibfk_2')->references('id')->on('inline_query')->onUpdate('RESTRICT')->onDelete('RESTRICT'); - $table->foreign( - 'chosen_inline_result_id', - 'telegram_update_ibfk_3' - )->references('id')->on('chosen_inline_result')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('chosen_inline_result_id', 'telegram_update_ibfk_3')->references('id')->on('chosen_inline_result')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('callback_query_id', 'telegram_update_ibfk_4')->references('id')->on('callback_query')->onUpdate('RESTRICT')->onDelete('RESTRICT'); $table->foreign('edited_message_id', 'telegram_update_ibfk_5')->references('id')->on('edited_message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } - public function down() + public function down(): void { Schema::table('telegram_update', static function (Blueprint $table) { $table->dropForeign('telegram_update_ibfk_1'); diff --git a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php index 5e0fa1d..dea8f62 100644 --- a/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php +++ b/src/database/migrations/2018_04_18_193555_add_foreign_keys_to_user_chat_table.php @@ -4,10 +4,11 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class AddForeignKeysToUserChatTable extends Migration { - public function up() + public function up(): void { Schema::table('user_chat', static function (Blueprint $table) { $table->foreign('user_id', 'user_chat_ibfk_1')->references('id')->on('user')->onUpdate('CASCADE')->onDelete('CASCADE'); @@ -15,7 +16,7 @@ public function up() }); } - public function down() + public function down(): void { Schema::table('user_chat', static function (Blueprint $table) { $table->dropForeign('user_chat_ibfk_1'); From 7a11bcec3160572069e3c2c59ac09014dd897811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Mon, 25 May 2020 13:16:00 +0200 Subject: [PATCH 45/63] Add migration step to add table prefixes and remove prefix from foreign key names. --- ...2020_05_18_000000_add_prefix_to_tables.php | 58 +++++++++++++++++++ ..._000000_update_schema_0_53_0_to_0_54_0.php | 5 +- ..._000000_update_schema_0_54_1_to_0_55_0.php | 5 +- ..._000000_update_schema_0_56_0_to_0_57_0.php | 31 +++++----- ..._000000_update_schema_0_57_0_to_0_58_0.php | 5 +- ..._000000_update_schema_0_60_0_to_0_61_0.php | 5 +- ..._000000_update_schema_0_61_1_to_0_62_0.php | 13 +++-- 7 files changed, 93 insertions(+), 29 deletions(-) create mode 100644 src/database/migrations/2020_05_18_000000_add_prefix_to_tables.php diff --git a/src/database/migrations/2020_05_18_000000_add_prefix_to_tables.php b/src/database/migrations/2020_05_18_000000_add_prefix_to_tables.php new file mode 100644 index 0000000..a620bfa --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_add_prefix_to_tables.php @@ -0,0 +1,58 @@ +tables as $table) { + try { + if (Schema::hasTable($this->prefix . $table)) { + Log::warning("Prefixed table '{$this->prefix}{$table}' already exists. Verify your migration status."); + continue; // Migration may be partly done already... + } + + Schema::rename($table, $this->prefix . $table); + } catch (Throwable $e) { + Log::error($e->getMessage()); + } + } + } + + public function down(): void + { + foreach ($this->tables as $table) { + try { + if (Schema::hasTable($table)) { + Log::warning("Un-prefixed table '{$table}' already exists. Verify your migration status."); + continue; // Migration may be partly done already... + } + + Schema::rename($this->prefix . $table, $table); + } catch (Throwable $e) { + Log::error($e->getMessage()); + } + } + } +} diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php index 0446a39..f7a7c90 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_53_0_to_0_54_0.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; use PhpTelegramBot\Laravel\Migration; @@ -15,7 +16,7 @@ public function up(): void $table->text('game')->nullable()->comment('Message is a game, information about the game.')->after('document'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } @@ -27,7 +28,7 @@ public function down(): void $table->dropColumn('game'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php index b6a3059..b5e736e 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_54_1_to_0_55_0.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; use PhpTelegramBot\Laravel\Migration; @@ -16,7 +17,7 @@ public function up(): void $table->text('passport_data')->nullable()->comment('Telegram Passport data')->after('connected_website'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } @@ -29,7 +30,7 @@ public function down(): void $table->dropColumn('animation'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php index 113224c..066a040 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; use PhpTelegramBot\Laravel\Migration; @@ -17,7 +18,7 @@ public function up(): void $table->char('invoice_payload', 255)->default('')->comment('Bot specified invoice payload'); $table->char('shipping_address', 255)->default('')->comment('User specified shipping address'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('user_id', $this->prefix . 'shipping_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('user_id', 'shipping_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); Schema::create($this->prefix . 'pre_checkout_query', function (Blueprint $table) { @@ -29,7 +30,7 @@ public function up(): void $table->char('shipping_option_id', 255)->comment('Identifier of the shipping option chosen by the user'); $table->text('order_info')->comment('Order info provided by the user'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('user_id', $this->prefix . 'pre_checkout_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('user_id', 'pre_checkout_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); Schema::create($this->prefix . 'poll', static function (Blueprint $table) { @@ -74,14 +75,14 @@ public function up(): void $table->index('pre_checkout_query_id', 'pre_checkout_query_id'); $table->index('poll_id', 'poll_id'); - $table->foreign(['chat_id', 'channel_post_id'], $this->prefix . 'telegram_update_ibfk_6')->references(['chat_id', 'id'])->on($this->prefix . 'message'); - $table->foreign('edited_channel_post_id', $this->prefix . 'telegram_update_ibfk_7')->references('id')->on($this->prefix . 'edited_message'); - $table->foreign('shipping_query_id', $this->prefix . 'telegram_update_ibfk_8')->references('id')->on($this->prefix . 'shipping_query'); - $table->foreign('pre_checkout_query_id', $this->prefix . 'telegram_update_ibfk_9')->references('id')->on($this->prefix . 'pre_checkout_query'); - $table->foreign('poll_id', $this->prefix . 'telegram_update_ibfk_10')->references('id')->on($this->prefix . 'poll'); + $table->foreign(['chat_id', 'channel_post_id'], 'telegram_update_ibfk_6')->references(['chat_id', 'id'])->on($this->prefix . 'message'); + $table->foreign('edited_channel_post_id', 'telegram_update_ibfk_7')->references('id')->on($this->prefix . 'edited_message'); + $table->foreign('shipping_query_id', 'telegram_update_ibfk_8')->references('id')->on($this->prefix . 'shipping_query'); + $table->foreign('pre_checkout_query_id', 'telegram_update_ibfk_9')->references('id')->on($this->prefix . 'pre_checkout_query'); + $table->foreign('poll_id', 'telegram_update_ibfk_10')->references('id')->on($this->prefix . 'poll'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } @@ -89,12 +90,12 @@ public function up(): void public function down(): void { try { - Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { - $table->dropForeign($this->prefix . 'telegram_update_ibfk_10'); - $table->dropForeign($this->prefix . 'telegram_update_ibfk_9'); - $table->dropForeign($this->prefix . 'telegram_update_ibfk_8'); - $table->dropForeign($this->prefix . 'telegram_update_ibfk_7'); - $table->dropForeign($this->prefix . 'telegram_update_ibfk_6'); + Schema::table($this->prefix . 'telegram_update', static function (Blueprint $table) { + $table->dropForeign('telegram_update_ibfk_10'); + $table->dropForeign('telegram_update_ibfk_9'); + $table->dropForeign('telegram_update_ibfk_8'); + $table->dropForeign('telegram_update_ibfk_7'); + $table->dropForeign('telegram_update_ibfk_6'); $table->dropIndex('poll_id'); $table->dropIndex('pre_checkout_query_id'); @@ -134,7 +135,7 @@ public function down(): void Schema::dropIfExists($this->prefix . 'pre_checkout_query'); Schema::dropIfExists($this->prefix . 'shipping_query'); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php index 5c05713..7644687 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; use PhpTelegramBot\Laravel\Migration; @@ -16,7 +17,7 @@ public function up(): void $table->text('reply_markup')->nullable()->comment('Inline keyboard attached to the message')->after('passport_data'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } @@ -28,7 +29,7 @@ public function down(): void $table->dropColumn('reply_markup'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php index cf18e24..5c7e6b5 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_60_0_to_0_61_0.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; use PhpTelegramBot\Laravel\Migration; @@ -19,7 +20,7 @@ public function up(): void $table->index(['chat_id', 'message_id'], 'chat_message_id'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } @@ -37,7 +38,7 @@ public function down(): void $table->index('message_id', 'message_id'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php index d799d66..472d48f 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; use PhpTelegramBot\Laravel\Migration; @@ -28,16 +29,16 @@ public function up(): void $table->bigInteger('user_id')->nullable(false)->comment('The user, who changed the answer to the poll'); $table->text('option_ids')->nullable(false)->comment('0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.'); $table->dateTime('created_at')->nullable()->comment('Entry date creation'); - $table->foreign('poll_id', $this->prefix . 'poll_answer_ibfk_1')->references('id')->on($this->prefix . 'poll')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('poll_id', 'poll_answer_ibfk_1')->references('id')->on($this->prefix . 'poll')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { $table->bigInteger('poll_answer_poll_id')->unsigned()->nullable()->comment('A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.')->after('poll_id'); $table->index('poll_answer_poll_id', 'poll_answer_poll_id'); - $table->foreign('poll_answer_poll_id', $this->prefix . 'telegram_update_ibfk_11')->references('poll_id')->on($this->prefix . 'poll_answer')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('poll_answer_poll_id', 'telegram_update_ibfk_11')->references('poll_id')->on($this->prefix . 'poll_answer')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } @@ -45,8 +46,8 @@ public function up(): void public function down(): void { try { - Schema::table($this->prefix . 'telegram_update', function (Blueprint $table) { - $table->dropForeign($this->prefix . 'telegram_update_ibfk_11'); + Schema::table($this->prefix . 'telegram_update', static function (Blueprint $table) { + $table->dropForeign('telegram_update_ibfk_11'); $table->dropIndex('poll_answer_poll_id'); $table->dropColumn('poll_answer_poll_id'); }); @@ -65,7 +66,7 @@ public function down(): void $table->dropColumn('total_voter_count'); }); } catch (Throwable $e) { - \Log::error($e->getMessage ()); + Log::error($e->getMessage()); return; // Migration may be partly done already... } } From 9f9b5b93f9844a12fc90851c77aff980078ee73c Mon Sep 17 00:00:00 2001 From: Pooria Morovati Date: Mon, 26 Oct 2020 18:14:39 +0330 Subject: [PATCH 46/63] add EXAMPLE.md --- EXAMPLE.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 EXAMPLE.md diff --git a/EXAMPLE.md b/EXAMPLE.md new file mode 100644 index 0000000..3b0e6b8 --- /dev/null +++ b/EXAMPLE.md @@ -0,0 +1,82 @@ +## Example ## + + +1- After adding the package setting everything up, create a controller, for example `TelegramController.php` in you `app/Http/Controllers` directory and put this in it: + +``` +setWebhook(url(config('phptelegrambot.bot.api_key') . '/hook')); + } + + public function hook(PhpTelegramBotContract $telegram_bot) { + $telegram_bot->handle(); + } +} +``` + +2- Now you need to write routes for these actions. so open your `web.php` and write: +``` +$router->group(['prefix' => '[YOUR BOT API KEY]', function() use ($router) { + $router->get('set', 'TelegramController@set'); + $router->post('hook', 'TelegramController@hook'); +}); +``` +replace [YOUR BOT API KEY] with the API key that BotFather has given you. This is to make secure the `hook` url to ensure the incoming requests are from no one but Telegram. + +3- Go to `https://yoursite.com/[YOUR BOT API KEY]/set` +You should see the success message. + +4- Create a directory for your commands. It can be anywhere, for example `app/Telegram/Commands/[CommandNameCommand].php` would be nice. + +This is an example `StartCommand.php`: +``` +getMessage(); + + $chat_id = $message->getChat()->getId(); + $text = 'Hi! Welcome to my bot!'; + + $data = [ + 'chat_id' => $chat_id, + 'text' => $text, + ]; + + return Request::sendMessage($data); + } +} +``` +5- The last thing you need to do is to add your custom commands directory to the bot's config. so open `config/phptelegrambot.php` and add the commands directory to the array: + +``` +... +'commands' => [ + 'before' => true, + 'paths' => [ + base_path('/app/Telegram/Commands') + ], + 'configs' => [ + // Custom commands configs + ], +], +... +``` + + +That's it. From 7b5ff31a1aa49cf5950e7a94141b9886882f43fe Mon Sep 17 00:00:00 2001 From: Pooria Date: Wed, 28 Oct 2020 17:51:52 +0330 Subject: [PATCH 47/63] Fixed typo --- EXAMPLE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index 3b0e6b8..fd5af77 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -1,7 +1,7 @@ ## Example ## -1- After adding the package setting everything up, create a controller, for example `TelegramController.php` in you `app/Http/Controllers` directory and put this in it: +1- After adding the package and setting everything up, create a controller, for example `TelegramController.php` in your `app/Http/Controllers` directory and put this in it: ``` Date: Wed, 28 Oct 2020 17:56:31 +0330 Subject: [PATCH 48/63] Improved --- EXAMPLE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index 3b0e6b8..9e6d606 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -22,12 +22,12 @@ class TelegramController extends Controller { 2- Now you need to write routes for these actions. so open your `web.php` and write: ``` -$router->group(['prefix' => '[YOUR BOT API KEY]', function() use ($router) { +$router->group(['prefix' => config('phptelegrambot.bot.api_key')], function() use ($router) { $router->get('set', 'TelegramController@set'); $router->post('hook', 'TelegramController@hook'); }); ``` -replace [YOUR BOT API KEY] with the API key that BotFather has given you. This is to make secure the `hook` url to ensure the incoming requests are from no one but Telegram. +We prefix all routes with the long API key that BotFather has given us to make the `hook` url secure and to ensure the incoming requests are from no one but Telegram. 3- Go to `https://yoursite.com/[YOUR BOT API KEY]/set` You should see the success message. From 8f7a64e0c87e5a78fe49810c5ea89ab77cac8a6c Mon Sep 17 00:00:00 2001 From: Pooria Morovati Date: Mon, 26 Oct 2020 18:14:39 +0330 Subject: [PATCH 49/63] add EXAMPLE.md --- EXAMPLE.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 EXAMPLE.md diff --git a/EXAMPLE.md b/EXAMPLE.md new file mode 100644 index 0000000..3b0e6b8 --- /dev/null +++ b/EXAMPLE.md @@ -0,0 +1,82 @@ +## Example ## + + +1- After adding the package setting everything up, create a controller, for example `TelegramController.php` in you `app/Http/Controllers` directory and put this in it: + +``` +setWebhook(url(config('phptelegrambot.bot.api_key') . '/hook')); + } + + public function hook(PhpTelegramBotContract $telegram_bot) { + $telegram_bot->handle(); + } +} +``` + +2- Now you need to write routes for these actions. so open your `web.php` and write: +``` +$router->group(['prefix' => '[YOUR BOT API KEY]', function() use ($router) { + $router->get('set', 'TelegramController@set'); + $router->post('hook', 'TelegramController@hook'); +}); +``` +replace [YOUR BOT API KEY] with the API key that BotFather has given you. This is to make secure the `hook` url to ensure the incoming requests are from no one but Telegram. + +3- Go to `https://yoursite.com/[YOUR BOT API KEY]/set` +You should see the success message. + +4- Create a directory for your commands. It can be anywhere, for example `app/Telegram/Commands/[CommandNameCommand].php` would be nice. + +This is an example `StartCommand.php`: +``` +getMessage(); + + $chat_id = $message->getChat()->getId(); + $text = 'Hi! Welcome to my bot!'; + + $data = [ + 'chat_id' => $chat_id, + 'text' => $text, + ]; + + return Request::sendMessage($data); + } +} +``` +5- The last thing you need to do is to add your custom commands directory to the bot's config. so open `config/phptelegrambot.php` and add the commands directory to the array: + +``` +... +'commands' => [ + 'before' => true, + 'paths' => [ + base_path('/app/Telegram/Commands') + ], + 'configs' => [ + // Custom commands configs + ], +], +... +``` + + +That's it. From 67c9c5fd4adeda06dd0b0716637b79d95b46f641 Mon Sep 17 00:00:00 2001 From: Pooria Date: Wed, 28 Oct 2020 17:51:52 +0330 Subject: [PATCH 50/63] Fixed typo --- EXAMPLE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index 3b0e6b8..fd5af77 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -1,7 +1,7 @@ ## Example ## -1- After adding the package setting everything up, create a controller, for example `TelegramController.php` in you `app/Http/Controllers` directory and put this in it: +1- After adding the package and setting everything up, create a controller, for example `TelegramController.php` in your `app/Http/Controllers` directory and put this in it: ``` Date: Wed, 28 Oct 2020 17:56:31 +0330 Subject: [PATCH 51/63] Improved --- EXAMPLE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EXAMPLE.md b/EXAMPLE.md index fd5af77..1f79bc0 100644 --- a/EXAMPLE.md +++ b/EXAMPLE.md @@ -22,12 +22,12 @@ class TelegramController extends Controller { 2- Now you need to write routes for these actions. so open your `web.php` and write: ``` -$router->group(['prefix' => '[YOUR BOT API KEY]', function() use ($router) { +$router->group(['prefix' => config('phptelegrambot.bot.api_key')], function() use ($router) { $router->get('set', 'TelegramController@set'); $router->post('hook', 'TelegramController@hook'); }); ``` -replace [YOUR BOT API KEY] with the API key that BotFather has given you. This is to make secure the `hook` url to ensure the incoming requests are from no one but Telegram. +We prefix all routes with the long API key that BotFather has given us to make the `hook` url secure and to ensure the incoming requests are from no one but Telegram. 3- Go to `https://yoursite.com/[YOUR BOT API KEY]/set` You should see the success message. From 302620bbb19836e9bd8bba79b85c3e6d8039ae13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Tue, 5 Jan 2021 01:00:47 +0100 Subject: [PATCH 52/63] Add migrations up to core version 0.70.0 --- src/Laravel/Migration.php | 32 +++++++++ ..._000000_update_schema_0_56_0_to_0_57_0.php | 20 +++--- ..._000000_update_schema_0_57_0_to_0_58_0.php | 9 +++ ..._000000_update_schema_0_61_1_to_0_62_0.php | 17 ++--- .../2020_05_18_000000_update_schema_fixes.php | 59 ++++++++++++++++ ...18_010919_convert_datetime_to_timetamp.php | 28 ++++++++ ..._000000_update_schema_0_62_0_to_0_63_0.php | 68 +++++++++++++++++++ ..._000000_update_schema_0_64_0_to_0_70_0.php | 41 +++++++++++ 8 files changed, 256 insertions(+), 18 deletions(-) create mode 100644 src/database/migrations/2020_05_18_000000_update_schema_fixes.php create mode 100644 src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php create mode 100644 src/database/migrations/2021_01_04_000000_update_schema_0_62_0_to_0_63_0.php create mode 100644 src/database/migrations/2021_01_04_000000_update_schema_0_64_0_to_0_70_0.php diff --git a/src/Laravel/Migration.php b/src/Laravel/Migration.php index 1666a20..363a230 100644 --- a/src/Laravel/Migration.php +++ b/src/Laravel/Migration.php @@ -13,6 +13,8 @@ namespace PhpTelegramBot\Laravel; +use Illuminate\Support\Facades\DB; + class Migration extends \Illuminate\Database\Migrations\Migration { /** @var string */ @@ -22,4 +24,34 @@ public function __construct() { $this->prefix = (string) config('phptelegrambot.database.prefix', ''); } + + /** + * Change column type for passed table field(s). + * + * @param array $table_columns + * @param string $new_type + */ + public function changeColumnTypes(array $table_columns, string $new_type): void + { + $database = DB::connection()->getDatabaseName(); + $prefix = DB::connection()->getTablePrefix() . $this->prefix; + + foreach ($table_columns as $table => $columns) { + foreach ($columns as $column) { + // Preserve column comment and nullable state. + $props = DB::selectOne(' + SELECT `COLUMN_COMMENT`, `IS_NULLABLE` + FROM `information_schema`.`COLUMNS` + WHERE `TABLE_SCHEMA` = ? + AND `TABLE_NAME` = ? + AND `COLUMN_NAME` = ? + LIMIT 1 + ', [$database, $prefix . $table, $column]); + + $comment = $props->COLUMN_COMMENT; + $nullable = $props->IS_NULLABLE === 'YES' ? 'NULL' : 'NOT NULL'; + DB::statement("ALTER TABLE `{$prefix}{$table}` CHANGE `{$column}` `{$column}` {$new_type} {$nullable} COMMENT '{$comment}'"); + } + } + } } diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php index 066a040..90a1eca 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_56_0_to_0_57_0.php @@ -17,7 +17,7 @@ public function up(): void $table->bigInteger('user_id')->index('user_id')->comment('User who sent the query'); $table->char('invoice_payload', 255)->default('')->comment('Bot specified invoice payload'); $table->char('shipping_address', 255)->default('')->comment('User specified shipping address'); - $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->timestamp('created_at')->nullable()->comment('Entry date creation'); $table->foreign('user_id', 'shipping_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); @@ -27,9 +27,9 @@ public function up(): void $table->char('currency', 3)->comment('Three-letter ISO 4217 currency code'); $table->bigInteger('total_amount')->comment('Total price in the smallest units of the currency'); $table->char('invoice_payload', 255)->default('')->comment('Bot specified invoice payload'); - $table->char('shipping_option_id', 255)->comment('Identifier of the shipping option chosen by the user'); - $table->text('order_info')->comment('Order info provided by the user'); - $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->char('shipping_option_id', 255)->nullable()->comment('Identifier of the shipping option chosen by the user'); + $table->text('order_info')->nullable()->comment('Order info provided by the user'); + $table->timestamp('created_at')->nullable()->comment('Entry date creation'); $table->foreign('user_id', 'pre_checkout_query_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); @@ -37,8 +37,8 @@ public function up(): void $table->bigInteger('id')->unsigned()->primary()->comment('Unique poll identifier'); $table->char('question', 255)->comment('Poll question'); $table->text('options')->comment('List of poll options'); - $table->tinyInteger('is_closed')->default(0)->comment('True, if the poll is closed'); - $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->boolean('is_closed')->default(0)->comment('True, if the poll is closed'); + $table->timestamp('created_at')->nullable()->comment('Entry date creation'); }); Schema::table($this->prefix . 'callback_query', static function (Blueprint $table) { @@ -54,10 +54,10 @@ public function up(): void Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->text('forward_signature')->nullable()->default(null)->comment('For messages forwarded from channels, signature of the post author if present')->after('forward_from_message_id'); $table->text('forward_sender_name')->nullable()->default(null)->comment('Sender\'s name for messages forwarded from users who disallow adding a link to their account in forwarded messages')->after('forward_signature'); - $table->unsignedBigInteger('edit_date')->default(null)->comment('Date the message was last edited in Unix time')->after('reply_to_message'); - $table->text('author_signature')->comment('Signature of the post author for messages in channels')->after('media_group_id'); - $table->text('caption_entities')->comment('For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption')->after('entities'); - $table->text('poll')->comment('Poll object. Message is a native poll, information about the poll')->after('venue'); + $table->unsignedBigInteger('edit_date')->nullable()->comment('Date the message was last edited in Unix time')->after('reply_to_message'); + $table->text('author_signature')->nullable()->comment('Signature of the post author for messages in channels')->after('media_group_id'); + $table->text('caption_entities')->nullable()->comment('For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption')->after('entities'); + $table->text('poll')->nullable()->comment('Poll object. Message is a native poll, information about the poll')->after('venue'); $table->text('invoice')->nullable()->comment('Message is an invoice for a payment, information about the invoice')->after('pinned_message'); $table->text('successful_payment')->nullable()->comment('Message is a service message about a successful payment, information about the payment')->after('invoice'); }); diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php index 7644687..57c23ed 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_57_0_to_0_58_0.php @@ -25,6 +25,15 @@ public function up(): void public function down(): void { try { + Schema::create('botan_shortener', function (Blueprint $table) { + $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry'); + $table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier'); + $table->text('url')->comment('Original URL'); + $table->char('short_url')->default('')->comment('Shortened URL'); + $table->timestamp('created_at')->nullable()->comment('Entry date creation'); + $table->foreign('user_id', 'botan_shortener_ibfk_1')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + Schema::table($this->prefix . 'message', static function (Blueprint $table) { $table->dropColumn('reply_markup'); }); diff --git a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php index 472d48f..65c4f8f 100644 --- a/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php +++ b/src/database/migrations/2020_05_18_000000_update_schema_0_61_1_to_0_62_0.php @@ -13,11 +13,11 @@ public function up(): void { try { Schema::table($this->prefix . 'poll', static function (Blueprint $table) { - $table->integer('total_voter_count')->unsigned()->comment('Total number of users that voted in the poll')->after('options'); - $table->tinyInteger('is_anonymous')->default(1)->comment('True, if the poll is anonymous')->after('is_closed'); + $table->integer('total_voter_count')->unsigned()->nullable()->comment('Total number of users that voted in the poll')->after('options'); + $table->boolean('is_anonymous')->default(1)->comment('True, if the poll is anonymous')->after('is_closed'); $table->char('type', 255)->comment('Poll type, currently can be "regular" or "quiz"')->after('is_anonymous'); - $table->tinyInteger('allows_multiple_answers')->default(0)->comment('True, if the poll allows multiple answers')->after('type'); - $table->integer('correct_option_id')->unsigned()->comment('0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.')->after('allows_multiple_answers'); + $table->boolean('allows_multiple_answers')->default(0)->comment('True, if the poll allows multiple answers')->after('type'); + $table->integer('correct_option_id')->unsigned()->nullable()->comment('0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.')->after('allows_multiple_answers'); }); Schema::table($this->prefix . 'message', static function (Blueprint $table) { @@ -25,10 +25,11 @@ public function up(): void }); Schema::create($this->prefix . 'poll_answer', function (Blueprint $table) { - $table->bigInteger('poll_id', true, true)->comment('Unique poll identifier'); - $table->bigInteger('user_id')->nullable(false)->comment('The user, who changed the answer to the poll'); - $table->text('option_ids')->nullable(false)->comment('0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.'); - $table->dateTime('created_at')->nullable()->comment('Entry date creation'); + $table->bigInteger('poll_id')->unsigned()->comment('Unique poll identifier'); + $table->bigInteger('user_id')->comment('The user, who changed the answer to the poll'); + $table->text('option_ids')->comment('0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.'); + $table->timestamp('created_at')->nullable()->comment('Entry date creation'); + $table->primary(['poll_id', 'user_id']); $table->foreign('poll_id', 'poll_answer_ibfk_1')->references('id')->on($this->prefix . 'poll')->onUpdate('RESTRICT')->onDelete('RESTRICT'); }); diff --git a/src/database/migrations/2020_05_18_000000_update_schema_fixes.php b/src/database/migrations/2020_05_18_000000_update_schema_fixes.php new file mode 100644 index 0000000..6d0db95 --- /dev/null +++ b/src/database/migrations/2020_05_18_000000_update_schema_fixes.php @@ -0,0 +1,59 @@ +prefix . 'callback_query', function (Blueprint $table) { + $table->dropForeign('callback_query_ibfk_2'); + $table->foreign(['chat_id', 'message_id'], 'callback_query_ibfk_2')->references(['chat_id', 'id'])->on($this->prefix . 'message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + + Schema::table($this->prefix . 'edited_message', function (Blueprint $table) { + $table->dropForeign('edited_message_ibfk_2'); + $table->foreign(['chat_id', 'message_id'], 'edited_message_ibfk_2')->references(['chat_id', 'id'])->on($this->prefix . 'message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + + Schema::table($this->prefix . 'message', function (Blueprint $table) { + $table->dropForeign('message_ibfk_5'); + $table->dropForeign('message_ibfk_6'); + $table->foreign(['reply_to_chat', 'reply_to_message'], 'message_ibfk_5')->references(['chat_id', 'id'])->on($this->prefix . 'message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } catch (Throwable $e) { + Log::error($e->getMessage()); + return; // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table($this->prefix . 'callback_query', function (Blueprint $table) { + $table->dropForeign('callback_query_ibfk_2'); + $table->foreign('chat_id', 'callback_query_ibfk_2')->references('chat_id')->on($this->prefix . 'message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + + Schema::table($this->prefix . 'edited_message', function (Blueprint $table) { + $table->dropForeign('edited_message_ibfk_2'); + $table->foreign('chat_id', 'edited_message_ibfk_2')->references('chat_id')->on($this->prefix . 'message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + + Schema::table($this->prefix . 'message', function (Blueprint $table) { + $table->dropForeign('message_ibfk_5'); + $table->foreign('reply_to_chat', 'message_ibfk_5')->references('chat_id')->on($this->prefix . 'message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + $table->foreign('forward_from', 'message_ibfk_6')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } catch (Throwable $e) { + Log::error($e->getMessage()); + return; // Migration may be partly done already... + } + } +} diff --git a/src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php b/src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php new file mode 100644 index 0000000..86735d4 --- /dev/null +++ b/src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php @@ -0,0 +1,28 @@ + ['created_at'], + 'chosen_inline_result' => ['created_at'], + 'edited_message' => ['edit_date'], + 'inline_query' => ['created_at'], + 'message' => ['date', 'forward_date'], + 'request_limiter' => ['created_at'], + ]; + + public function up(): void + { + $this->changeColumnTypes($this->table_columns, 'TIMESTAMP NULL DEFAULT NULL'); + } + + public function down(): void + { + $this->changeColumnTypes($this->table_columns, 'DATETIME NULL DEFAULT NULL'); + } +} diff --git a/src/database/migrations/2021_01_04_000000_update_schema_0_62_0_to_0_63_0.php b/src/database/migrations/2021_01_04_000000_update_schema_0_62_0_to_0_63_0.php new file mode 100644 index 0000000..ea62fec --- /dev/null +++ b/src/database/migrations/2021_01_04_000000_update_schema_0_62_0_to_0_63_0.php @@ -0,0 +1,68 @@ +prefix . 'poll', static function (Blueprint $table) { + $table->char('explanation', 255)->nullable()->comment('Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters')->after('correct_option_id'); + $table->text('explanation_entities')->nullable()->comment('Special entities like usernames, URLs, bot commands, etc. that appear in the explanation')->after('explanation'); + $table->integer('open_period')->unsigned()->nullable()->comment('Amount of time in seconds the poll will be active after creation')->after('explanation_entities'); + $table->timestamp('close_date')->nullable()->comment('Point in time (Unix timestamp) when the poll will be automatically closed')->after('open_period'); + }); + + Schema::table($this->prefix . 'poll_answer', static function (Blueprint $table) { + $table->dropPrimary(); + $table->primary(['poll_id', 'user_id']); + }); + + Schema::table($this->prefix . 'message', function (Blueprint $table) { + $table->dropForeign('message_ibfk_6'); + $table->dropIndex('message_ibfk_6'); + + $table->bigInteger('via_bot')->nullable()->comment('Optional. Bot through which the message was sent')->after('reply_to_message'); + $table->index('via_bot'); + $table->foreign('via_bot', 'message_ibfk_9')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } catch (Throwable $e) { + Log::error($e->getMessage()); + return; // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table($this->prefix . 'poll', static function (Blueprint $table) { + $table->dropColumn('explanation'); + $table->dropColumn('explanation_entities'); + $table->dropColumn('open_period'); + $table->dropColumn('close_date'); + }); + + Schema::table($this->prefix . 'poll_answer', static function (Blueprint $table) { + $table->dropPrimary(); + $table->primary('poll_id'); + }); + + Schema::table($this->prefix . 'message', function (Blueprint $table) { + $table->dropForeign('message_ibfk_9'); + $table->dropIndex('via_bot'); + $table->dropColumn('via_bot'); + + $table->foreign('forward_from', 'message_ibfk_6')->references('id')->on($this->prefix . 'user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); + }); + } catch (Throwable $e) { + Log::error($e->getMessage()); + return; // Migration may be partly done already... + } + } +} diff --git a/src/database/migrations/2021_01_04_000000_update_schema_0_64_0_to_0_70_0.php b/src/database/migrations/2021_01_04_000000_update_schema_0_64_0_to_0_70_0.php new file mode 100644 index 0000000..3f33283 --- /dev/null +++ b/src/database/migrations/2021_01_04_000000_update_schema_0_64_0_to_0_70_0.php @@ -0,0 +1,41 @@ +changeColumnTypes(['poll' => ['question']], 'text'); + + Schema::table($this->prefix . 'message', static function (Blueprint $table) { + $table->bigInteger('sender_chat_id')->comment('Sender of the message, sent on behalf of a chat')->after('chat_id'); + $table->text('proximity_alert_triggered')->nullable()->comment('Service message. A user in the chat triggered another user\'s proximity alert while sharing Live Location.')->after('passport_data'); + }); + } catch (Throwable $e) { + Log::error($e->getMessage()); + return; // Migration may be partly done already... + } + } + + public function down(): void + { + try { + Schema::table($this->prefix . 'message', static function (Blueprint $table) { + $table->dropColumn('proximity_alert_triggered'); + $table->dropColumn('sender_chat_id'); + }); + + $this->changeColumnTypes(['poll' => ['question']], 'char(255)'); + } catch (Throwable $e) { + Log::error($e->getMessage()); + return; // Migration may be partly done already... + } + } +} From 9b8d4236aaae5b73cf17048c3f4f1a5cba749cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Tue, 5 Jan 2021 03:19:57 +0100 Subject: [PATCH 53/63] Split up webhook command, add "info" flag to show WebhookInfo details --- src/Laravel/Commands/WebhookCommand.php | 82 ++++++++++++++++++------- 1 file changed, 60 insertions(+), 22 deletions(-) diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index 1f55212..ecdb2de 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -15,14 +15,16 @@ use Illuminate\Console\Command; use Longman\TelegramBot\Exception\TelegramException; +use Longman\TelegramBot\Request; use PhpTelegramBot\Laravel\PhpTelegramBotContract; class WebhookCommand extends Command { protected $signature = 'telegram:webhook {webhook?} - {--delete : Delete webhook}'; + {--delete : Delete webhook} + {--info : Get webhook info}'; - protected $description = 'Set or delete webhook for Telegram bot'; + protected $description = 'Set, delete, or get webhook info for Telegram Bot'; /** @var \PhpTelegramBot\Laravel\PhpTelegramBotContract */ protected $telegramBot; @@ -38,35 +40,71 @@ public function handle(): void { $webhook = $this->argument('webhook'); $delete = $this->option('delete'); + $info = $this->option('info'); - if (! ($webhook || $delete)) { + if (! ($webhook || $delete || $info)) { $this->error('Not enough arguments!'); - $this->error('php artisan telegram:webhook {webhook?} {--delete}'); + $this->error('php artisan telegram:webhook {webhook?} {--delete} {--info}'); return; } - if ($delete) { - try { - $this->telegramBot->deleteWebhook(); - $this->info('Webhook deleted successfully!'); - } catch (TelegramException $e) { - $this->error("Couldn't delete webhook"); - $this->error($e->getMessage()); - return; - } + if ($delete && ! $this->deleteWebhook()) { + return; } - if ($webhook) { - try { - $this->telegramBot->setWebhook($webhook); - $this->info('Webhook set successfully!'); - } catch (TelegramException $e) { - $this->error("Couldn't set webhook"); - $this->error($e->getMessage()); - return; - } + if ($webhook && ! $this->setWebhook($webhook)) { + return; + } + + if ($info && ! $this->showWebhookInfo()) { + return; } $this->info('All done!'); } + + private function setWebhook(string $webhook): bool + { + try { + $this->telegramBot->setWebhook($webhook); + $this->info('Webhook set successfully!'); + } catch (TelegramException $e) { + $this->error("Couldn't set webhook"); + $this->error($e->getMessage()); + return false; + } + + return true; + } + + private function deleteWebhook(): bool + { + try { + $this->telegramBot->deleteWebhook(); + $this->info('Webhook deleted successfully!'); + } catch (TelegramException $e) { + $this->error("Couldn't delete webhook"); + $this->error($e->getMessage()); + return false; + } + + return true; + } + + private function showWebhookInfo(): bool + { + try { + $request = Request::getWebhookInfo(); + if (! $request->isOk()) { + throw new TelegramException($request->getDescription()); + } + $this->info(json_encode($request->getResult(), JSON_PRETTY_PRINT)); + } catch (TelegramException $e) { + $this->error("Couldn't get webhook info"); + $this->error($e->getMessage()); + return false; + } + + return true; + } } From 6ce64f3a92a4c61aeae81e3f3c9afd64b1a3c96e Mon Sep 17 00:00:00 2001 From: "MohammadR. Fekri" Date: Thu, 19 Aug 2021 20:56:26 +0430 Subject: [PATCH 54/63] fixed the incompatibility problem with graham-campbell/testbench v5.6 also bumped up the graham-campbell/testbench to 5.6 in composer.json --- composer.json | 2 +- tests/Unit/AbstractTestCase.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3d69b48..570d68a 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "mockery/mockery": "~1.2", "phpunit/phpunit": "~8.0", "longman/php-code-style": "^3.0", - "graham-campbell/testbench": "^5.3" + "graham-campbell/testbench": "^5.6" }, "autoload": { "psr-4": { diff --git a/tests/Unit/AbstractTestCase.php b/tests/Unit/AbstractTestCase.php index 0439111..ac3f9dc 100644 --- a/tests/Unit/AbstractTestCase.php +++ b/tests/Unit/AbstractTestCase.php @@ -12,10 +12,9 @@ abstract class AbstractTestCase extends AbstractPackageTestCase /** * Get the service provider class. * - * @param \Illuminate\Contracts\Foundation\Application $app * @return string */ - protected function getServiceProviderClass($app) + protected function getServiceProviderClass() { return ServiceProvider::class; } From 4c8626f07fab1b1a56245f79ee17444bde86ec2e Mon Sep 17 00:00:00 2001 From: "MohammadR. Fekri" Date: Fri, 20 Aug 2021 00:33:34 +0430 Subject: [PATCH 55/63] Added unit test for WebhookCommand --- phpunit.xml.dist | 2 ++ src/Laravel/Commands/WebhookCommand.php | 1 + tests/Unit/WebhookCommandTest.php | 39 +++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 tests/Unit/WebhookCommandTest.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d719118..a57873b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -25,6 +25,8 @@ + + diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index ecdb2de..f359d74 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -98,6 +98,7 @@ private function showWebhookInfo(): bool if (! $request->isOk()) { throw new TelegramException($request->getDescription()); } + $this->info('Current webhook info:'); $this->info(json_encode($request->getResult(), JSON_PRETTY_PRINT)); } catch (TelegramException $e) { $this->error("Couldn't get webhook info"); diff --git a/tests/Unit/WebhookCommandTest.php b/tests/Unit/WebhookCommandTest.php new file mode 100644 index 0000000..e79361b --- /dev/null +++ b/tests/Unit/WebhookCommandTest.php @@ -0,0 +1,39 @@ +artisan('telegram:webhook https://example.com/test') + ->expectsOutput('Webhook set successfully!') + ->assertExitCode(0); + } + + /** + * @test + */ + public function it_can_show_webhook_info() + { + $this->artisan('telegram:webhook --info') + ->ExpectsOutput('Current webhook info:') + ->assertExitCode(0); + } + + /** + * @test + */ + public function it_can_delete_webhook() + { + $this->artisan('telegram:webhook --delete') + ->ExpectsOutput('Webhook deleted successfully!') + ->assertExitCode(0); + } +} From 0db3473c614f90b173390a7fc84d575082424e8f Mon Sep 17 00:00:00 2001 From: "MohammadR. Fekri" Date: Fri, 20 Aug 2021 15:35:45 +0430 Subject: [PATCH 56/63] Added PHP 8 and Laravel 8.x support also bumped up the longman/telegram-bot and longman/php-code-style versions to latest. --- .travis.yml | 2 +- README.md | 2 +- composer.json | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7f164e..ece28aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: php sudo: false php: - - 7.2 - 7.3 - 7.4 + - 8.0 before_install: - composer self-update diff --git a/README.md b/README.md index 3c41793..7f067d9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Telegram Bot Package for Laravel 6.x +# Telegram Bot Package for Laravel 6.x, 7.x, and 8.x [![Build Status](https://travis-ci.org/php-telegram-bot/laravel.svg?branch=master)](https://travis-ci.org/php-telegram-bot/laravel) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-telegram-bot/laravel/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-telegram-bot/laravel/?b=master) diff --git a/composer.json b/composer.json index 570d68a..80ff249 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "php-telegram-bot/laravel", "type": "library", - "description": "Package to integrate PHP Telegram Bot library in Laravel 6.x", + "description": "Package to integrate PHP Telegram Bot library in Laravel 6.x, 7.x, and 8.x", "keywords": [ "laravel", "telegram", @@ -22,15 +22,16 @@ } ], "require": { - "php": "^7.2", - "illuminate/database": "^6.0|^7.0", - "illuminate/support": "^6.0|^7.0", - "longman/telegram-bot": "^0.61" + "php": "^7.3|^8.0", + "ext-json": "*", + "illuminate/database": "^6.0|^7.0|^8.0", + "illuminate/support": "^6.0|^7.0|^8.0", + "longman/telegram-bot": "^0.74" }, "require-dev": { "mockery/mockery": "~1.2", "phpunit/phpunit": "~8.0", - "longman/php-code-style": "^3.0", + "longman/php-code-style": "^7.0", "graham-campbell/testbench": "^5.6" }, "autoload": { From 4d35ccd0aee898e1c2eede6ff64aaefb60e3b5e4 Mon Sep 17 00:00:00 2001 From: "MohammadR. Fekri" Date: Fri, 20 Aug 2021 15:37:21 +0430 Subject: [PATCH 57/63] Coding style changes to pass longman/php-code-style 7.0 rules --- src/Laravel/Commands/WebhookCommand.php | 4 ++++ src/Laravel/Migration.php | 13 +++++++------ src/Laravel/ServiceProvider.php | 6 +++--- ...20_05_18_010919_convert_datetime_to_timetamp.php | 6 +++--- tests/Bootstrap.php | 2 +- tests/Unit/WebhookCommandTest.php | 1 - 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/Laravel/Commands/WebhookCommand.php b/src/Laravel/Commands/WebhookCommand.php index f359d74..8f19706 100644 --- a/src/Laravel/Commands/WebhookCommand.php +++ b/src/Laravel/Commands/WebhookCommand.php @@ -18,6 +18,10 @@ use Longman\TelegramBot\Request; use PhpTelegramBot\Laravel\PhpTelegramBotContract; +use function json_encode; + +use const JSON_PRETTY_PRINT; + class WebhookCommand extends Command { protected $signature = 'telegram:webhook {webhook?} diff --git a/src/Laravel/Migration.php b/src/Laravel/Migration.php index 363a230..71ec48c 100644 --- a/src/Laravel/Migration.php +++ b/src/Laravel/Migration.php @@ -13,9 +13,10 @@ namespace PhpTelegramBot\Laravel; +use Illuminate\Database\Migrations\Migration as LaravelMigration; use Illuminate\Support\Facades\DB; -class Migration extends \Illuminate\Database\Migrations\Migration +class Migration extends LaravelMigration { /** @var string */ protected $prefix = ''; @@ -28,15 +29,15 @@ public function __construct() /** * Change column type for passed table field(s). * - * @param array $table_columns - * @param string $new_type + * @param array $tableColumns + * @param string $newType */ - public function changeColumnTypes(array $table_columns, string $new_type): void + public function changeColumnTypes(array $tableColumns, string $newType): void { $database = DB::connection()->getDatabaseName(); $prefix = DB::connection()->getTablePrefix() . $this->prefix; - foreach ($table_columns as $table => $columns) { + foreach ($tableColumns as $table => $columns) { foreach ($columns as $column) { // Preserve column comment and nullable state. $props = DB::selectOne(' @@ -50,7 +51,7 @@ public function changeColumnTypes(array $table_columns, string $new_type): void $comment = $props->COLUMN_COMMENT; $nullable = $props->IS_NULLABLE === 'YES' ? 'NULL' : 'NOT NULL'; - DB::statement("ALTER TABLE `{$prefix}{$table}` CHANGE `{$column}` `{$column}` {$new_type} {$nullable} COMMENT '{$comment}'"); + DB::statement("ALTER TABLE `{$prefix}{$table}` CHANGE `{$column}` `{$column}` {$newType} {$nullable} COMMENT '{$comment}'"); } } } diff --git a/src/Laravel/ServiceProvider.php b/src/Laravel/ServiceProvider.php index b4878cb..1d41506 100644 --- a/src/Laravel/ServiceProvider.php +++ b/src/Laravel/ServiceProvider.php @@ -40,7 +40,7 @@ public function boot(): void // Append the default settings $this->mergeConfigFrom( __DIR__ . '/../config/config.php', - 'phptelegrambot' + 'phptelegrambot', ); $this->publishes([ @@ -67,8 +67,8 @@ public function register(): void // Set command related configs if (! empty($config['commands']['configs'])) { - foreach ($config['commands']['configs'] as $command_name => $command_config) { - $bot->setCommandConfig($command_name, $command_config); + foreach ($config['commands']['configs'] as $commandName => $commandConfig) { + $bot->setCommandConfig($commandName, $commandConfig); } } diff --git a/src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php b/src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php index 86735d4..68a2356 100644 --- a/src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php +++ b/src/database/migrations/2020_05_18_010919_convert_datetime_to_timetamp.php @@ -7,7 +7,7 @@ class ConvertDatetimeToTimetamp extends Migration { /** @var array[] Fields that require DATETIME to TIMESTAMP conversion. */ - private $table_columns = [ + private $tableColumns = [ 'callback_query' => ['created_at'], 'chosen_inline_result' => ['created_at'], 'edited_message' => ['edit_date'], @@ -18,11 +18,11 @@ class ConvertDatetimeToTimetamp extends Migration public function up(): void { - $this->changeColumnTypes($this->table_columns, 'TIMESTAMP NULL DEFAULT NULL'); + $this->changeColumnTypes($this->tableColumns, 'TIMESTAMP NULL DEFAULT NULL'); } public function down(): void { - $this->changeColumnTypes($this->table_columns, 'DATETIME NULL DEFAULT NULL'); + $this->changeColumnTypes($this->tableColumns, 'DATETIME NULL DEFAULT NULL'); } } diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 0ea8eb9..f450677 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -27,7 +27,7 @@ */ if (! file_exists($root . '/vendor/autoload.php')) { throw new Exception( - 'Please run "php composer.phar install --dev" in root directory to setup unit test dependencies before running the tests' + 'Please run "php composer.phar install --dev" in root directory to setup unit test dependencies before running the tests', ); } diff --git a/tests/Unit/WebhookCommandTest.php b/tests/Unit/WebhookCommandTest.php index e79361b..2b37018 100644 --- a/tests/Unit/WebhookCommandTest.php +++ b/tests/Unit/WebhookCommandTest.php @@ -6,7 +6,6 @@ class WebhookCommandTest extends AbstractTestCase { - /** * @test */ From 36b98cee6cd744f07443f1203719c0c7259e9baf Mon Sep 17 00:00:00 2001 From: "MohammadR. Fekri" Date: Fri, 20 Aug 2021 16:20:27 +0430 Subject: [PATCH 58/63] fixed the wrong minimum php requirement badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f067d9..5e9f205 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Latest Stable Version](https://img.shields.io/packagist/v/php-telegram-bot/laravel.svg)](https://packagist.org/packages/php-telegram-bot/laravel) [![Total Downloads](https://img.shields.io/packagist/dt/php-telegram-bot/laravel.svg)](https://packagist.org/packages/php-telegram-bot/laravel) [![Downloads Month](https://img.shields.io/packagist/dm/php-telegram-bot/laravel.svg)](https://packagist.org/packages/php-telegram-bot/laravel) -[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D5.5.9-8892BF.svg)](https://php.net/) +[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D7.3-8892BF.svg)](https://php.net/) [![License](https://img.shields.io/packagist/l/php-telegram-bot/laravel.svg)](https://github.com/php-telegram-bot/laravel/LICENSE.md) This package helps easily integrate [PHP Telegram Bot](https://github.com/php-telegram-bot/core) library in Laravel application. From 6d52e821669e1fd95b0cc2161b093b3742596b90 Mon Sep 17 00:00:00 2001 From: "MohammadR. Fekri" Date: Fri, 20 Aug 2021 16:29:41 +0430 Subject: [PATCH 59/63] added myself as a contributer --- CREDITS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CREDITS b/CREDITS index 2422cb5..7df11fc 100644 --- a/CREDITS +++ b/CREDITS @@ -12,3 +12,8 @@ N: Avtandil Kikabidze aka LONGMAN E: akalongman@gmail.com W: http://longman.me D: Project owner, Maintainer + +N: MohammadR. Fekri +E: fekri.m@icloud.com +W: https://fekri.me +D: Contributor From a08368b6a0f4922977a1d0b72099a7c5998ed5e9 Mon Sep 17 00:00:00 2001 From: "MohammadR. Fekri" Date: Fri, 20 Aug 2021 16:33:09 +0430 Subject: [PATCH 60/63] ignored .phpunit.result.cache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 136cd3e..ab0ce12 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ composer.lock # Test Related Files # /phpunit.xml +/.phpunit.result.cache # Composer vendor/ From 0c1cc5bd02918b31a6af5ba665b75df54a07cfb0 Mon Sep 17 00:00:00 2001 From: Anton Sannikov Date: Fri, 10 Sep 2021 23:27:13 +0200 Subject: [PATCH 61/63] Fix test composer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 80ff249..7f01d11 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ }, "require-dev": { "mockery/mockery": "~1.2", - "phpunit/phpunit": "~8.0", + "phpunit/phpunit": "~9.3", "longman/php-code-style": "^7.0", "graham-campbell/testbench": "^5.6" }, From 98c68bac32a057694eef8c3e7480a4a672540b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Tue, 5 Jan 2021 03:41:51 +0100 Subject: [PATCH 62/63] Update scrutinizer config --- .scrutinizer.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 24e3c83..b7067bf 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,8 +1,21 @@ -tools: - external_code_coverage: - timeout: 600 +build: + environment: + php: 7.3.0 + nodes: + analysis: + tests: + override: + - php-scrutinizer-run + +filter: + paths: + - src/ checks: - php: - code_rating: true - duplication: true + php: + code_rating: true + duplication: true + +tools: + external_code_coverage: + timeout: 300 From 0af3c0bd33cffa57838873c17c5402118f013f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Sat, 25 Sep 2021 21:07:19 +0200 Subject: [PATCH 63/63] Some test cleanup, don't hit live Telegram API for webhook tests --- composer.json | 3 +-- tests/Bootstrap.php | 40 ------------------------------ tests/Unit/AbstractTestCase.php | 7 +----- tests/Unit/ServiceProviderTest.php | 16 ++---------- tests/Unit/WebhookCommandTest.php | 22 ++++++++-------- 5 files changed, 15 insertions(+), 73 deletions(-) delete mode 100644 tests/Bootstrap.php diff --git a/composer.json b/composer.json index 7f01d11..b8a9324 100644 --- a/composer.json +++ b/composer.json @@ -29,8 +29,7 @@ "longman/telegram-bot": "^0.74" }, "require-dev": { - "mockery/mockery": "~1.2", - "phpunit/phpunit": "~9.3", + "phpunit/phpunit": "^9.3", "longman/php-code-style": "^7.0", "graham-campbell/testbench": "^5.6" }, diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php deleted file mode 100644 index f450677..0000000 --- a/tests/Bootstrap.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -/* - * Set error reporting to the level to which Mockery code must comply. - */ -error_reporting(-1); - -/* - * Set UTC timezone. - */ -date_default_timezone_set('UTC'); - -$root = realpath(dirname(dirname(__FILE__))); -/** - * Check that --dev composer installation was done - */ -if (! file_exists($root . '/vendor/autoload.php')) { - throw new Exception( - 'Please run "php composer.phar install --dev" in root directory to setup unit test dependencies before running the tests', - ); -} - -// Include the Composer autoloader -$loader = require __DIR__ . '/../vendor/autoload.php'; - -/* - * Unset global variables that are no longer needed. - */ -unset($root, $loader); diff --git a/tests/Unit/AbstractTestCase.php b/tests/Unit/AbstractTestCase.php index ac3f9dc..8c42d5f 100644 --- a/tests/Unit/AbstractTestCase.php +++ b/tests/Unit/AbstractTestCase.php @@ -9,12 +9,7 @@ abstract class AbstractTestCase extends AbstractPackageTestCase { - /** - * Get the service provider class. - * - * @return string - */ - protected function getServiceProviderClass() + protected function getServiceProviderClass(): string { return ServiceProvider::class; } diff --git a/tests/Unit/ServiceProviderTest.php b/tests/Unit/ServiceProviderTest.php index b36c8dd..67cc706 100644 --- a/tests/Unit/ServiceProviderTest.php +++ b/tests/Unit/ServiceProviderTest.php @@ -12,27 +12,15 @@ class ServiceProviderTest extends AbstractTestCase { use ServiceProviderTrait; - /** - * @test - */ + /** @test */ public function config_is_injectable() { $this->assertIsInjectable(Repository::class); } - /** - * @test - */ + /** @test */ public function database_is_injectable() { $this->assertIsInjectable(Database::class); } - - /** - * @test - */ - public function provides() - { - $this->testProvides(); - } } diff --git a/tests/Unit/WebhookCommandTest.php b/tests/Unit/WebhookCommandTest.php index 2b37018..2557025 100644 --- a/tests/Unit/WebhookCommandTest.php +++ b/tests/Unit/WebhookCommandTest.php @@ -6,33 +6,33 @@ class WebhookCommandTest extends AbstractTestCase { - /** - * @test - */ + /** @test */ public function it_can_set_webhook() { + $this->markTestSkipped('Mock instead of live API calls'); + $this->artisan('telegram:webhook https://example.com/test') ->expectsOutput('Webhook set successfully!') ->assertExitCode(0); } - /** - * @test - */ + /** @test */ public function it_can_show_webhook_info() { + $this->markTestSkipped('Mock instead of live API calls'); + $this->artisan('telegram:webhook --info') - ->ExpectsOutput('Current webhook info:') + ->expectsOutput('Current webhook info:') ->assertExitCode(0); } - /** - * @test - */ + /** @test */ public function it_can_delete_webhook() { + $this->markTestSkipped('Mock instead of live API calls'); + $this->artisan('telegram:webhook --delete') - ->ExpectsOutput('Webhook deleted successfully!') + ->expectsOutput('Webhook deleted successfully!') ->assertExitCode(0); } }