From 282d00b81a356a336ce90a8ed964a4d3ce67a086 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Mon, 10 Jun 2019 16:24:22 +0300 Subject: [PATCH] Initial version (#1) --- .env.dist | 3 + .gitignore | 186 + .travis.yml | 16 + LICENSE | 2 +- Makefile | 19 + apigen.neon | 32 + composer.json | 50 + composer.lock | 4251 +++++++++++++++++ extra/autoloader.php | 19 + phpstan.neon | 3 + phpunit.xml.dist | 22 + phpunit.xsd | 251 + src/Bot/Client.php | 345 ++ src/Bot/Model/Constants.php | 85 + src/Bot/Model/Entity/Cost.php | 82 + src/Bot/Model/Entity/Delivery.php | 133 + src/Bot/Model/Entity/Item.php | 81 + src/Bot/Model/Entity/Order.php | 231 + src/Bot/Model/Entity/OrderItem.php | 156 + src/Bot/Model/Entity/Payment.php | 106 + src/Bot/Model/Entity/PaymentStatus.php | 81 + src/Bot/Model/Entity/Product.php | 206 + src/Bot/Model/Entity/Quantity.php | 82 + src/Bot/Model/Entity/Status.php | 81 + src/Bot/Model/Request/BotsRequest.php | 102 + src/Bot/Model/Request/ChannelsRequest.php | 79 + src/Bot/Model/Request/ChatsRequest.php | 79 + src/Bot/Model/Request/CommandEditRequest.php | 109 + src/Bot/Model/Request/CommandsRequest.php | 56 + src/Bot/Model/Request/CommonFields.php | 100 + src/Bot/Model/Request/CustomersRequest.php | 56 + src/Bot/Model/Request/DialogAssignRequest.php | 106 + src/Bot/Model/Request/DialogsRequest.php | 158 + src/Bot/Model/Request/InfoRequest.php | 106 + src/Bot/Model/Request/MembersRequest.php | 156 + src/Bot/Model/Request/MessageEditRequest.php | 81 + src/Bot/Model/Request/MessageSendRequest.php | 239 + src/Bot/Model/Request/MessagesRequest.php | 258 + src/Bot/Model/Request/UsersRequest.php | 102 + src/Bot/Model/Response/.gitkeep | 0 src/Bot/Request.php | 205 + src/Bot/Response.php | 229 + src/Exception/CurlException.php | 30 + src/Exception/InvalidJsonException.php | 30 + src/Exception/LimitException.php | 30 + src/Register.php | 346 ++ src/Serializer.php | 58 + src/Url.php | 126 + tests/Bot/Test/TestCase.php | 54 + tests/Bot/Tests/ClientListTest.php | 178 + tests/Bot/Tests/CommandsTest.php | 95 + tests/Bot/Tests/MessagesTest.php | 54 + tests/bootstrap.php | 15 + 53 files changed, 9759 insertions(+), 1 deletion(-) create mode 100644 .env.dist create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 Makefile create mode 100644 apigen.neon create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 extra/autoloader.php create mode 100644 phpstan.neon create mode 100644 phpunit.xml.dist create mode 100644 phpunit.xsd create mode 100644 src/Bot/Client.php create mode 100644 src/Bot/Model/Constants.php create mode 100644 src/Bot/Model/Entity/Cost.php create mode 100644 src/Bot/Model/Entity/Delivery.php create mode 100644 src/Bot/Model/Entity/Item.php create mode 100644 src/Bot/Model/Entity/Order.php create mode 100644 src/Bot/Model/Entity/OrderItem.php create mode 100644 src/Bot/Model/Entity/Payment.php create mode 100644 src/Bot/Model/Entity/PaymentStatus.php create mode 100644 src/Bot/Model/Entity/Product.php create mode 100644 src/Bot/Model/Entity/Quantity.php create mode 100644 src/Bot/Model/Entity/Status.php create mode 100644 src/Bot/Model/Request/BotsRequest.php create mode 100644 src/Bot/Model/Request/ChannelsRequest.php create mode 100644 src/Bot/Model/Request/ChatsRequest.php create mode 100644 src/Bot/Model/Request/CommandEditRequest.php create mode 100644 src/Bot/Model/Request/CommandsRequest.php create mode 100644 src/Bot/Model/Request/CommonFields.php create mode 100644 src/Bot/Model/Request/CustomersRequest.php create mode 100644 src/Bot/Model/Request/DialogAssignRequest.php create mode 100644 src/Bot/Model/Request/DialogsRequest.php create mode 100644 src/Bot/Model/Request/InfoRequest.php create mode 100644 src/Bot/Model/Request/MembersRequest.php create mode 100644 src/Bot/Model/Request/MessageEditRequest.php create mode 100644 src/Bot/Model/Request/MessageSendRequest.php create mode 100644 src/Bot/Model/Request/MessagesRequest.php create mode 100644 src/Bot/Model/Request/UsersRequest.php create mode 100644 src/Bot/Model/Response/.gitkeep create mode 100644 src/Bot/Request.php create mode 100644 src/Bot/Response.php create mode 100644 src/Exception/CurlException.php create mode 100644 src/Exception/InvalidJsonException.php create mode 100644 src/Exception/LimitException.php create mode 100644 src/Register.php create mode 100644 src/Serializer.php create mode 100644 src/Url.php create mode 100644 tests/Bot/Test/TestCase.php create mode 100644 tests/Bot/Tests/ClientListTest.php create mode 100644 tests/Bot/Tests/CommandsTest.php create mode 100644 tests/Bot/Tests/MessagesTest.php create mode 100644 tests/bootstrap.php diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..163c9a3 --- /dev/null +++ b/.env.dist @@ -0,0 +1,3 @@ +MG_BOT_URL="" +MG_BOT_KEY="" +MG_BOT_DBG="" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a9004ee --- /dev/null +++ b/.gitignore @@ -0,0 +1,186 @@ +# Created by .ignore support plugin (hsz.mobi) +### macOS template +# General +.DS_Store +.AppleDouble +.LSOverride +.env +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/dictionaries +.idea/**/shelf + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ +cmake-build-release/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests +### NetBeans template +nbproject/private/ +nbbuild/ +/dist/ +nbdist/ +.nb-gradle/ +### Eclipse template + +.metadata +bin/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet +### Composer template +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock +### Linux template +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* +### Windows template +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk +/.php_cs.cache diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fe2315f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: php + +cache: + directories: + - $HOME/.composer/cache + +php: + - '7.0' + - '7.1' + - '7.2' + +before_script: + - flags="-o" + - composer install $flags + +script: make test diff --git a/LICENSE b/LICENSE index c31da9c..16ce40d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 retailCRM +Copyright (c) 2018-2019 RetailDriver LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..79babc0 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +SRC_DIR=$(ROOT_DIR)/src +BIN_DIR=$(ROOT_DIR)/bin + +deps: + @echo "==> Installing dependencies" + @curl -L https://getcomposer.org/composer.phar -o $(BIN_DIR)/composer + @COMPOSER_HOME=/tmp php -d memory_limit=-1 $(BIN_DIR)/composer install + +test: + @echo "==> Running tests" + @cd $(ROOT_DIR) + @php -d memory_limit=-1 $(BIN_DIR)/phpunit -c phpunit.xml.dist --log-junit $(ROOT_DIR)/test-report.xml + @echo "==> Testing complete" + +stan: + @echo "==> Running analysis" + @php $(BIN_DIR)/phpstan analyse -l 4 -c $(ROOT_DIR)/phpstan.neon $(SRC_DIR) + @echo "==> Analysis complete" diff --git a/apigen.neon b/apigen.neon new file mode 100644 index 0000000..5c74aed --- /dev/null +++ b/apigen.neon @@ -0,0 +1,32 @@ +extensions: + - php + +source: + - src + +exclude: + - tests/ + - vendor/ + - bin/ + - docs/ + +charset: + - auto + - UTF-8 + - Windows-1251 + +title: retailCRM PHP MG Bot API client +templateTheme: bootstrap +groups: auto + +accessLevels: + - public + - protected + +internal: true +php: false +tree: true +deprecated: true +todo: true +destination: ../mg-bot-api-client-php.pages/ +download: false diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..13565df --- /dev/null +++ b/composer.json @@ -0,0 +1,50 @@ +{ + "name": "retailcrm/mg-bot-api-client-php", + "description": "PHP client for retailCRM MG Bot API", + "type": "library", + "keywords": ["API", "retailCRM", "REST", "bot"], + "homepage": "http://www.retailcrm.ru/", + "license": "MIT", + "authors": [ + { + "name": "retailCRM", + "email": "support@retailcrm.ru" + } + ], + "require": { + "php": ">=7.0", + "ext-curl": "*", + "ext-json": "*", + "jms/serializer": "1.13.*", + "symfony/validator": "^4.2", + "doctrine/annotations": "^1.6", + "doctrine/cache": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "6.5.*", + "phpmd/phpmd": "2.6.*", + "phpstan/phpstan": "0.9.*", + "squizlabs/php_codesniffer": "3.4.*", + "symfony/dotenv": "^4.2", + "friendsofphp/php-cs-fixer": "^2.14" + }, + "support": { + "email": "support@retailcrm.ru" + }, + "autoload": { + "psr-4": { + "RetailCrm\\Mg\\": ["src/", "tests/"], + "RetailCrm\\Common\\": "src/" + }, + "files": ["extra/autoloader.php"] + }, + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "config": { + "bin-dir": "bin", + "process-timeout": 600 + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..3553733 --- /dev/null +++ b/composer.lock @@ -0,0 +1,4251 @@ +{ + "_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#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "e2dc59137064db9a4933e3049f8e0c34", + "packages": [ + { + "name": "doctrine/annotations", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "53120e0eb10355388d6ccbe462f1fea34ddadb24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/53120e0eb10355388d6ccbe462f1fea34ddadb24", + "reference": "53120e0eb10355388d6ccbe462f1fea34ddadb24", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "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": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2019-03-25T19:12:02+00:00" + }, + { + "name": "doctrine/cache", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57", + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57", + "shasum": "" + }, + "require": { + "php": "~7.1" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "doctrine/coding-standard": "^4.0", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.0", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "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": "Caching library offering an object-oriented API for many cache backends", + "homepage": "https://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2018-08-21T18:01:43+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "a2c590166b2133a4633738648b6b064edae0814a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", + "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "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://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2019-03-17T17:37:11+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "jms/metadata", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/metadata.git", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e5854ab1aa643623dc64adde718a8eec32b957a8", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "doctrine/cache": "~1.0", + "symfony/cache": "~3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Metadata\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Class/method/property metadata management in PHP", + "keywords": [ + "annotations", + "metadata", + "xml", + "yaml" + ], + "time": "2018-10-26T12:40:10+00:00" + }, + { + "name": "jms/parser-lib", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/parser-lib.git", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "shasum": "" + }, + "require": { + "phpoption/phpoption": ">=0.9,<2.0-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "description": "A library for easily creating recursive-descent parsers.", + "time": "2012-11-18T18:08:43+00:00" + }, + { + "name": "jms/serializer", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/serializer.git", + "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/00863e1d55b411cc33ad3e1de09a4c8d3aae793c", + "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/instantiator": "^1.0.3", + "jms/metadata": "^1.3", + "jms/parser-lib": "1.*", + "php": "^5.5|^7.0", + "phpcollection/phpcollection": "~0.1", + "phpoption/phpoption": "^1.1" + }, + "conflict": { + "twig/twig": "<1.12" + }, + "require-dev": { + "doctrine/orm": "~2.1", + "doctrine/phpcr-odm": "^1.3|^2.0", + "ext-pdo_sqlite": "*", + "jackalope/jackalope-doctrine-dbal": "^1.1.5", + "phpunit/phpunit": "^4.8|^5.0", + "propel/propel1": "~1.7", + "psr/container": "^1.0", + "symfony/dependency-injection": "^2.7|^3.3|^4.0", + "symfony/expression-language": "^2.6|^3.0", + "symfony/filesystem": "^2.1", + "symfony/form": "~2.1|^3.0", + "symfony/translation": "^2.1|^3.0", + "symfony/validator": "^2.2|^3.0", + "symfony/yaml": "^2.1|^3.0", + "twig/twig": "~1.12|~2.0" + }, + "suggest": { + "doctrine/cache": "Required if you like to use cache functionality.", + "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", + "symfony/yaml": "Required if you'd like to serialize data to YAML format." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.13-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\Serializer": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", + "homepage": "http://jmsyst.com/libs/serializer", + "keywords": [ + "deserialization", + "jaxb", + "json", + "serialization", + "xml" + ], + "time": "2018-07-25T13:58:54+00:00" + }, + { + "name": "phpcollection/phpcollection", + "version": "0.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-collection.git", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "shasum": "" + }, + "require": { + "phpoption/phpoption": "1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-0": { + "PhpCollection": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "General-Purpose Collection Library for PHP", + "keywords": [ + "collection", + "list", + "map", + "sequence", + "set" + ], + "time": "2015-05-17T12:39:23+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-0": { + "PhpOption\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "time": "2015-07-25T16:39:46+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "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": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "82ebae02209c21113908c229e9883c419720738a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "backendtea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-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": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/validator", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "db5457ed88aacc1a040d4961ee52cddad3e5a4aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/db5457ed88aacc1a040d4961ee52cddad3e5a4aa", + "reference": "db5457ed88aacc1a040d4961ee52cddad3e5a4aa", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<3.4", + "symfony/intl": "<4.1", + "symfony/translation": "<4.2", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.8|~2.0", + "symfony/cache": "~3.4|~4.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/http-foundation": "~4.1", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/intl": "~4.1", + "symfony/property-access": "~3.4|~4.0", + "symfony/translation": "~4.2", + "symfony/var-dumper": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/translation": "For translating validation errors.", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "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 Validator Component", + "homepage": "https://symfony.com", + "time": "2019-03-30T15:58:42+00:00" + } + ], + "packages-dev": [ + { + "name": "composer/semver", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2019-03-19T17:25:45+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "d17708133b6c276d6e42ef887a877866b909d892" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", + "reference": "d17708133b6c276d6e42ef887a877866b909d892", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "time": "2019-01-28T20:25:53+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v2.14.2", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "ff401e58261ffc5934a58f795b3f95b355e276cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/ff401e58261ffc5934a58f795b3f95b355e276cb", + "reference": "ff401e58261ffc5934a58f795b3f95b355e276cb", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4", + "composer/xdebug-handler": "^1.2", + "doctrine/annotations": "^1.2", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^5.6 || ^7.0", + "php-cs-fixer/diff": "^1.3", + "symfony/console": "^3.4.17 || ^4.1.6", + "symfony/event-dispatcher": "^3.0 || ^4.0", + "symfony/filesystem": "^3.0 || ^4.0", + "symfony/finder": "^3.0 || ^4.0", + "symfony/options-resolver": "^3.0 || ^4.0", + "symfony/polyfill-php70": "^1.0", + "symfony/polyfill-php72": "^1.4", + "symfony/process": "^3.0 || ^4.0", + "symfony/stopwatch": "^3.0 || ^4.0" + }, + "require-dev": { + "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", + "justinrainbow/json-schema": "^5.0", + "keradus/cli-executor": "^1.2", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.1", + "php-cs-fixer/accessible-object": "^1.0", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", + "phpunitgoodpractices/traits": "^1.5.1", + "symfony/phpunit-bridge": "^4.0" + }, + "suggest": { + "ext-mbstring": "For handling non-UTF8 characters in cache signature.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "classmap": [ + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Assert/AssertTokensTrait.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "time": "2019-02-17T17:44:13+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "1.2", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "shasum": "" + }, + "require": { + "ocramius/package-versions": "^1.2.0", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "time": "2018-06-13T13:22:40+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.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": "2018-06-11T23:09:50+00:00" + }, + { + "name": "nette/bootstrap", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/nette/bootstrap.git", + "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/bootstrap/zipball/e1075af05c211915e03e0c86542f3ba5433df4a3", + "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3", + "shasum": "" + }, + "require": { + "nette/di": "^3.0", + "nette/utils": "^3.0", + "php": ">=7.1" + }, + "require-dev": { + "latte/latte": "^2.2", + "nette/application": "^3.0", + "nette/caching": "^3.0", + "nette/database": "^3.0", + "nette/forms": "^3.0", + "nette/http": "^3.0", + "nette/mail": "^3.0", + "nette/robot-loader": "^3.0", + "nette/safe-stream": "^2.2", + "nette/security": "^3.0", + "nette/tester": "^2.0", + "tracy/tracy": "^2.6" + }, + "suggest": { + "nette/robot-loader": "to use Configurator::createRobotLoader()", + "tracy/tracy": "to use Configurator::enableTracy()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", + "homepage": "https://nette.org", + "keywords": [ + "bootstrapping", + "configurator", + "nette" + ], + "time": "2019-03-26T12:59:07+00:00" + }, + { + "name": "nette/di", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/nette/di.git", + "reference": "19d83539245aaacb59470828919182411061841f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/di/zipball/19d83539245aaacb59470828919182411061841f", + "reference": "19d83539245aaacb59470828919182411061841f", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/neon": "^3.0", + "nette/php-generator": "^3.2.2", + "nette/robot-loader": "^3.2", + "nette/schema": "^1.0", + "nette/utils": "^3.0", + "php": ">=7.1" + }, + "conflict": { + "nette/bootstrap": "<3.0" + }, + "require-dev": { + "nette/tester": "^2.2", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/compatibility.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", + "homepage": "https://nette.org", + "keywords": [ + "compiled", + "di", + "dic", + "factory", + "ioc", + "nette", + "static" + ], + "time": "2019-04-03T19:35:46+00:00" + }, + { + "name": "nette/finder", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/nette/finder.git", + "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/finder/zipball/6be1b83ea68ac558aff189d640abe242e0306fe2", + "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2", + "shasum": "" + }, + "require": { + "nette/utils": "^2.4 || ~3.0.0", + "php": ">=7.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "? Nette Finder: find files and directories with an intuitive API.", + "homepage": "https://nette.org", + "keywords": [ + "filesystem", + "glob", + "iterator", + "nette" + ], + "time": "2019-02-28T18:13:25+00:00" + }, + { + "name": "nette/neon", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/nette/neon.git", + "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/neon/zipball/cbff32059cbdd8720deccf9e9eace6ee516f02eb", + "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "ext-json": "*", + "php": ">=7.0" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "? Nette NEON: encodes and decodes NEON file format.", + "homepage": "http://ne-on.org", + "keywords": [ + "export", + "import", + "neon", + "nette", + "yaml" + ], + "time": "2019-02-05T21:30:40+00:00" + }, + { + "name": "nette/php-generator", + "version": "v3.2.2", + "source": { + "type": "git", + "url": "https://github.com/nette/php-generator.git", + "reference": "acff8b136fad84b860a626d133e791f95781f9f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/php-generator/zipball/acff8b136fad84b860a626d133e791f95781f9f5", + "reference": "acff8b136fad84b860a626d133e791f95781f9f5", + "shasum": "" + }, + "require": { + "nette/utils": "^2.4.2 || ~3.0.0", + "php": ">=7.1" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.3 features.", + "homepage": "https://nette.org", + "keywords": [ + "code", + "nette", + "php", + "scaffolding" + ], + "time": "2019-03-15T03:41:13+00:00" + }, + { + "name": "nette/robot-loader", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/nette/robot-loader.git", + "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", + "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/finder": "^2.5", + "nette/utils": "^3.0", + "php": ">=7.1" + }, + "require-dev": { + "nette/tester": "^2.0", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "? Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", + "homepage": "https://nette.org", + "keywords": [ + "autoload", + "class", + "interface", + "nette", + "trait" + ], + "time": "2019-03-08T21:57:24+00:00" + }, + { + "name": "nette/schema", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", + "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", + "shasum": "" + }, + "require": { + "nette/utils": "^3.0.1", + "php": ">=7.1" + }, + "require-dev": { + "nette/tester": "^2.2", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "time": "2019-04-03T15:53:25+00:00" + }, + { + "name": "nette/utils", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "bd961f49b211997202bda1d0fbc410905be370d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/bd961f49b211997202bda1d0fbc410905be370d4", + "reference": "bd961f49b211997202bda1d0fbc410905be370d4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "nette/tester": "~2.0", + "tracy/tracy": "^2.3" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize() and toAscii()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-xml": "to use Strings::length() etc. when mbstring is not available" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "time": "2019-03-22T01:00:30+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-02-21T12:16:21+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "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", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02T15:55:56+00:00" + }, + { + "name": "pdepend/pdepend", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/pdepend/pdepend.git", + "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/9daf26d0368d4a12bed1cacae1a9f3a6f0adf239", + "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239", + "shasum": "" + }, + "require": { + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3|^4", + "symfony/dependency-injection": "^2.3.0|^3|^4", + "symfony/filesystem": "^2.3.0|^3|^4" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.7", + "squizlabs/php_codesniffer": "^2.0.0" + }, + "bin": [ + "src/bin/pdepend" + ], + "type": "library", + "autoload": { + "psr-4": { + "PDepend\\": "src/main/php/PDepend" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of pdepend to be handled with Composer", + "time": "2017-12-13T13:21:38+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.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": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "symfony/process": "^3.3" + }, + "type": "library", + "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" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "time": "2018-02-15T16:58:55+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": "phpmd/phpmd", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374", + "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374", + "shasum": "" + }, + "require": { + "ext-xml": "*", + "pdepend/pdepend": "^2.5", + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.0", + "squizlabs/php_codesniffer": "^2.0" + }, + "bin": [ + "src/bin/phpmd" + ], + "type": "project", + "autoload": { + "psr-0": { + "PHPMD\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Manuel Pichler", + "email": "github@manuel-pichler.de", + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" + }, + { + "name": "Other contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" + } + ], + "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", + "homepage": "http://phpmd.org/", + "keywords": [ + "mess detection", + "mess detector", + "pdepend", + "phpmd", + "pmd" + ], + "time": "2017-01-20T14:41:10+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "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 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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-08-05T17:53:17+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/02f909f134fe06f0cd4790d8627ee24efbe84d6a", + "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a", + "shasum": "" + }, + "require": { + "php": "~7.0" + }, + "require-dev": { + "consistence/coding-standard": "^2.0.0", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/phpstan": "^0.9", + "phpunit/phpunit": "^6.3", + "slevomat/coding-standard": "^3.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "time": "2018-01-13T18:19:41+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "0.9.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "e59541bcc7cac9b35ca54db6365bf377baf4a488" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e59541bcc7cac9b35ca54db6365bf377baf4a488", + "reference": "e59541bcc7cac9b35ca54db6365bf377baf4a488", + "shasum": "" + }, + "require": { + "jean85/pretty-package-versions": "^1.0.3", + "nette/bootstrap": "^2.4 || ^3.0", + "nette/di": "^2.4.7 || ^3.0", + "nette/robot-loader": "^3.0.1", + "nette/utils": "^2.4.5 || ^3.0", + "nikic/php-parser": "^3.1", + "php": "~7.0", + "phpstan/phpdoc-parser": "^0.2", + "symfony/console": "~3.2 || ~4.0", + "symfony/finder": "~3.2 || ~4.0" + }, + "require-dev": { + "consistence/coding-standard": "2.2.1", + "ext-gd": "*", + "ext-intl": "*", + "ext-mysqli": "*", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/phpstan-php-parser": "^0.9", + "phpstan/phpstan-phpunit": "^0.9.3", + "phpstan/phpstan-strict-rules": "^0.9", + "phpunit/phpunit": "^6.5.4", + "slevomat/coding-standard": "4.0.0" + }, + "bin": [ + "bin/phpstan" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": [ + "src/", + "build/PHPStan" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2018-01-28T13:22:19+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.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 provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-04-06T15:36:58+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": "6.5.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.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": "2019-02-01T05:22:47+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "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": "2018-11-20T15:27:04+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": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.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": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "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": "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-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.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": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.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": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "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": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "2017-03-03T06:23:57+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.4.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5b4333b4010625d29580eb4a41f1e53251be6baa", + "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa", + "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": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2019-03-19T03:22:27+00:00" + }, + { + "name": "symfony/config", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "0e745ead307d5dcd4e163e94a47ec04b1428943f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/0e745ead307d5dcd4e163e94a47ec04b1428943f", + "reference": "0e745ead307d5dcd4e163e94a47ec04b1428943f", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "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 Config Component", + "homepage": "https://symfony.com", + "time": "2019-04-01T14:03:25+00:00" + }, + { + "name": "symfony/console", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "24206aff3efe6962593297e57ef697ebb220e384" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/24206aff3efe6962593297e57ef697ebb220e384", + "reference": "24206aff3efe6962593297e57ef697ebb220e384", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-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": "2019-04-01T07:32:59+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "1806e43ff6bff57398d33b326cd753a12d9f434f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1806e43ff6bff57398d33b326cd753a12d9f434f", + "reference": "1806e43ff6bff57398d33b326cd753a12d9f434f", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/container": "^1.0", + "symfony/contracts": "^1.0" + }, + "conflict": { + "symfony/config": "<4.2", + "symfony/finder": "<3.4", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-contracts-implementation": "1.0" + }, + "require-dev": { + "symfony/config": "~4.2", + "symfony/expression-language": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "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 DependencyInjection Component", + "homepage": "https://symfony.com", + "time": "2019-03-30T15:58:42+00:00" + }, + { + "name": "symfony/dotenv", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/dotenv.git", + "reference": "b541d63b83532be55a020db8ed2e50598385a583" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/b541d63b83532be55a020db8ed2e50598385a583", + "reference": "b541d63b83532be55a020db8ed2e50598385a583", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "symfony/process": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Dotenv\\": "" + }, + "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": "Registers environment variables from a .env file", + "homepage": "https://symfony.com", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2019-04-01T07:32:59+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "ca5af306fbc37f3cf597e91bc9cfa0c7d3f33544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ca5af306fbc37f3cf597e91bc9cfa0c7d3f33544", + "reference": "ca5af306fbc37f3cf597e91bc9cfa0c7d3f33544", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "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.2-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": "2019-03-30T15:58:42+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601", + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "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 Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-02-07T11:40:08+00:00" + }, + { + "name": "symfony/finder", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/267b7002c1b70ea80db0833c3afe05f0fbde580a", + "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-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": "2019-02-23T15:42:05+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3896e5a7d06fd15fa4947694c8dcdd371ff147d1", + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "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 OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2019-02-23T15:17:42+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "bc4858fb611bda58719124ca079baff854149c89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89", + "reference": "bc4858fb611bda58719124ca079baff854149c89", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-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": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/ab50dcf166d5f577978419edd37aa2bb8eabce0c", + "reference": "ab50dcf166d5f577978419edd37aa2bb8eabce0c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "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 backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2019-02-06T07:57:58+00:00" + }, + { + "name": "symfony/process", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "1e6cbb41dadcaf29e0db034d6ad0d039a9df06e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/1e6cbb41dadcaf29e0db034d6ad0d039a9df06e6", + "reference": "1e6cbb41dadcaf29e0db034d6ad0d039a9df06e6", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-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": "2019-03-10T20:07:02+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.2.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "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 Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:31:39+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/1c42705be2b6c1de5904f8afacef5895cab44bf8", + "reference": "1c42705be2b6c1de5904f8afacef5895cab44bf8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-04-04T09:56:43+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "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-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.0", + "ext-curl": "*", + "ext-json": "*" + }, + "platform-dev": [] +} diff --git a/extra/autoloader.php b/extra/autoloader.php new file mode 100644 index 0000000..8fc5a70 --- /dev/null +++ b/extra/autoloader.php @@ -0,0 +1,19 @@ + + + + + + tests/Bot/Tests + + + + + + ./src/Bot + + + diff --git a/phpunit.xsd b/phpunit.xsd new file mode 100644 index 0000000..ec86b23 --- /dev/null +++ b/phpunit.xsd @@ -0,0 +1,251 @@ + + + + + This Schema file defines the rules by which the XML configuration file of PHPUnit 3.7 may be structured. + + + + + + Root Element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The main type specifying the document structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Bot/Client.php b/src/Bot/Client.php new file mode 100644 index 0000000..59b9827 --- /dev/null +++ b/src/Bot/Client.php @@ -0,0 +1,345 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot; + +use RetailCrm\Common\Exception\CurlException; +use RetailCrm\Common\Exception\InvalidJsonException; +use RetailCrm\Common\Url; +use RetailCrm\Common\Serializer; +use RetailCrm\Mg\Bot\Model; +use Exception; +use InvalidArgumentException; + +/** + * PHP version 7.0 + * + * Client class + * + * @package RetailCrm\Mg\Bot + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Client +{ + const VERSION = 'v1'; + + protected $client; + + /** + * Init + * + * @param string $url api url + * @param string $token api key + * @param bool $debug debug flag + */ + public function __construct($url, $token, $debug = false) + { + $url = sprintf("%sapi/bot/%s", Url::normalizeUrl($url), self::VERSION); + $this->client = new Request($url, $token, $debug); + } + + /** + * Returns filtered bots list + * + * @param Model\Request\BotsRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function bots(Model\Request\BotsRequest $request) + { + return $this->client->makeRequest('/bots', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Edit bot info + * + * @param Model\Request\InfoRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws CurlException + * @throws Exception + * + * @return Response + */ + public function info(Model\Request\InfoRequest $request) + { + return $this->client->makeRequest('/my/info', Request::METHOD_PATCH, $request); + } + + /** + * Returns filtered channels list + * + * @param Model\Request\ChannelsRequest $request + * + * @return Response + * @throws \Exception + */ + public function channels(Model\Request\ChannelsRequest $request) + { + return $this->client->makeRequest('/channels', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Returns filtered chats list + * + * @param Model\Request\ChatsRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function chats(Model\Request\ChatsRequest $request) + { + return $this->client->makeRequest('/chats', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Returns filtered commands list + * + * @param Model\Request\CommandsRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function commands(Model\Request\CommandsRequest $request) + { + return $this->client->makeRequest('/my/commands', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Edit commands for exact bot + * + * @param Model\Request\CommandEditRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function commandEdit(Model\Request\CommandEditRequest $request) + { + return $this->client->makeRequest( + sprintf("/my/commands/%s", $request->getName()), + Request::METHOD_PUT, + $request + ); + } + + /** + * Delete command for exact bot + * + * @param string $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function commandDelete(string $request) + { + return $this->client->makeRequest(sprintf("/my/commands/%s", $request), Request::METHOD_DELETE); + } + + /** + * Returns filtered customers list + * + * @param Model\Request\CustomersRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function customers(Model\Request\CustomersRequest $request) + { + return $this->client->makeRequest('/customers', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Returns filtered dialogs list + * + * @param Model\Request\DialogsRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function dialogs(Model\Request\DialogsRequest $request) + { + return $this->client->makeRequest('/dialogs', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Assign dialog to exact user + * + * @param Model\Request\DialogAssignRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function dialogAssign(Model\Request\DialogAssignRequest $request) + { + return $this->client->makeRequest( + sprintf("/dialogs/%d/assign", $request->getDialogId()), + Request::METHOD_PATCH, + $request + ); + } + + /** + * Close exact dialog + * + * @param string $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function dialogClose(string $request) + { + return $this->client->makeRequest(sprintf("/dialogs/%d/close", $request), Request::METHOD_DELETE); + } + + /** + * Returns filtered members list + * + * @param Model\Request\MembersRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function members(Model\Request\MembersRequest $request) + { + return $this->client->makeRequest('/members', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Returns filtered messages list + * + * @param Model\Request\MessagesRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function messages(Model\Request\MessagesRequest $request) + { + return $this->client->makeRequest('/messages', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } + + /** + * Send a message + * + * @param Model\Request\MessageSendRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function messageSend(Model\Request\MessageSendRequest $request) + { + return $this->client->makeRequest('/messages', Request::METHOD_POST, $request); + } + + /** + * Edit a message + * + * @param Model\Request\MessageEditRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function messageEdit(Model\Request\MessageEditRequest $request) + { + return $this->client->makeRequest('/messages/%d', Request::METHOD_PATCH, $request->getId()); + } + + /** + * Delete a message + * + * @param string $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function messageDelete(string $request) + { + return $this->client->makeRequest(sprintf("/messages/%d", $request), Request::METHOD_DELETE); + } + + /** + * Returns filtered users list + * + * @param Model\Request\UsersRequest $request + * + * @throws InvalidArgumentException + * @throws CurlException + * @throws InvalidJsonException + * @throws Exception + * + * @return Response + */ + public function users(Model\Request\UsersRequest $request) + { + return $this->client->makeRequest('/users', Request::METHOD_GET, $request, Serializer::S_ARRAY); + } +} diff --git a/src/Bot/Model/Constants.php b/src/Bot/Model/Constants.php new file mode 100644 index 0000000..7571533 --- /dev/null +++ b/src/Bot/Model/Constants.php @@ -0,0 +1,85 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model; + +/** + * PHP version 7.0 + * + * Constants class + * + * @package RetailCrm\Mg\Bot\Model + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Constants +{ + const CHANNEL_TYPE_TELEGRAM = "telegram"; + const CHANNEL_TYPE_FACEBOOK = "fbmessenger"; + const CHANNEL_TYPE_VIBER = "viber"; + const CHANNEL_TYPE_WHATSAPP = "whatsapp"; + const CHANNEL_TYPE_SKYPE = "skype"; + const CHANNEL_TYPE_VK = "vk"; + const CHANNEL_TYPE_INSTAGRAM = "instagram"; + const CHANNEL_TYPE_CONSULTANT = "consultant"; + const CHANNEL_TYPE_CUSTOM = "custom"; + + const CHAT_MEMBER_STATE_ACTIVE = "active"; + const CHAT_MEMBER_STATE_KICKED = "kicked"; + const CHAT_MEMBER_STATE_LEAVED = "leaved"; + + const CHANNEL_FEATURE_NONE = "none"; + const CHANNEL_FEATURE_RECEIVE = "receive"; + const CHANNEL_FEATURE_SEND = "send"; + const CHANNEL_FEATURE_BOTH = "both"; + + const BOT_ROLE_DISTRIBUTOR = "distributor"; + const BOT_ROLE_RESPONSIBLE = "responsible"; + + const MESSAGE_SCOPE_PUBLIC = "public"; + const MESSAGE_SCOPE_PRIVATE = "private"; + + const MESSAGE_TYPE_TEXT = "text"; + const MESSAGE_TYPE_SYSTEM = "system"; + const MESSAGE_TYPE_COMMAND = "command"; + const MESSAGE_TYPE_ORDER = "order"; + const MESSAGE_TYPE_PRODUCT = "product"; + const MESSAGE_TYPE_FILE = "file"; + const MESSAGE_TYPE_IMAGE = "image"; + + const MESSAGE_ORDER_STATUS_CODE_NEW = "new"; + const MESSAGE_ORDER_STATUS_CODE_APPROVAL = "approval"; + const MESSAGE_ORDER_STATUS_CODE_ASSEMBLING = "assembling"; + const MESSAGE_ORDER_STATUS_CODE_DELIVERY = "delivery"; + const MESSAGE_ORDER_STATUS_CODE_COMPLETE = "complete"; + const MESSAGE_ORDER_STATUS_CODE_CANCEL = "cancel"; + + const WS_EVENT_MESSAGE_NEW = "message_new"; + const WS_EVENT_MESSAGE_UPDATED = "message_updated"; + const WS_EVENT_MESSAGE_DELETED = "message_deleted"; + const WS_EVENT_DIALOG_OPENED = "dialog_opened"; + const WS_EVENT_DIALOG_CLOSED = "dialog_closed"; + const WS_EVENT_DIALOG_ASSIGN = "dialog_assign"; + const WS_EVENT_CHAT_CREATED = "chat_created"; + const WS_EVENT_CHAT_UPDATED = "chat_updated"; + const WS_EVENT_CHAT_UNREAD_UPDATED = "chat_unread_updated"; + const WS_EVENT_USER_ONLINE_UPDATED = "user_online_updated"; + const WS_EVENT_USER_JOINED = "user_joined_chat"; + const WS_EVENT_USER_LEAVE = "user_left_chat"; + const WS_EVENT_USER_UPDATED = "user_updated"; + const WS_EVENT_CUSTOMER_UPDATED = "customer_updated"; + const WS_EVENT_BOT_UPDATED = "bot_updated"; + const WS_EVENT_CHANNEL_UPDATED = "channel_updated"; + const WS_EVENT_SETTINGS_UPDATED = "settings_updated"; +} diff --git a/src/Bot/Model/Entity/Cost.php b/src/Bot/Model/Entity/Cost.php new file mode 100644 index 0000000..2727732 --- /dev/null +++ b/src/Bot/Model/Entity/Cost.php @@ -0,0 +1,82 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Cost class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Cost +{ + /** + * @var float $value + * + * @Type("float") + * @Accessor(getter="getValue",setter="setValue") + * @SkipWhenEmpty() + */ + private $value; + + /** + * @var string $currency + * + * @Type("string") + * @Accessor(getter="getCurrency",setter="setCurrency") + * + * @Assert\Currency + */ + private $currency; + + /** + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * @param float $value + */ + public function setValue(float $value) + { + $this->value = $value; + } + + /** + * @return string + */ + public function getCurrency() + { + return $this->currency; + } + + /** + * @param string $currency + */ + public function setCurrency(string $currency) + { + $this->currency = $currency; + } +} diff --git a/src/Bot/Model/Entity/Delivery.php b/src/Bot/Model/Entity/Delivery.php new file mode 100644 index 0000000..2de1bbc --- /dev/null +++ b/src/Bot/Model/Entity/Delivery.php @@ -0,0 +1,133 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Delivery class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Delivery +{ + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * + * @Assert\NotBlank + */ + private $name; + + /** + * @var Cost $price + * + * @Type("Cost") + * @Accessor(getter="getPrice",setter="setPrice") + * + * @Assert\Currency + */ + private $price; + + /** + * @var string $address + * + * @Type("string") + * @Accessor(getter="getAddress",setter="setAddress") + * @SkipWhenEmpty() + */ + private $address; + + /** + * @var string $comment + * + * @Type("string") + * @Accessor(getter="getComment",setter="setComment") + * @SkipWhenEmpty() + */ + private $comment; + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return Cost + */ + public function getPrice() + { + return $this->price; + } + + /** + * @param Cost $price + */ + public function setPrice(Cost $price) + { + $this->price = $price; + } + + /** + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * @param string $address + */ + public function setAddress(string $address) + { + $this->address = $address; + } + + /** + * @return string + */ + public function getComment() + { + return $this->comment; + } + + /** + * @param string $comment + */ + public function setComment(string $comment) + { + $this->comment = $comment; + } +} diff --git a/src/Bot/Model/Entity/Item.php b/src/Bot/Model/Entity/Item.php new file mode 100644 index 0000000..9e6ad82 --- /dev/null +++ b/src/Bot/Model/Entity/Item.php @@ -0,0 +1,81 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Item class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Item +{ + /** + * @var string $id + * + * @Type("string") + * @Accessor(getter="getId",setter="setId") + * @SkipWhenEmpty() + */ + private $id; + + /** + * @var string $caption + * + * @Type("string") + * @Accessor(getter="getCaption",setter="setCaption") + * @SkipWhenEmpty() + */ + private $caption; + + /** + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * @param string $id + */ + public function setId(string $id) + { + $this->id = $id; + } + + /** + * @return string + */ + public function getCaption() + { + return $this->caption; + } + + /** + * @param string $caption + */ + public function setCaption(string $caption) + { + $this->caption = $caption; + } +} diff --git a/src/Bot/Model/Entity/Order.php b/src/Bot/Model/Entity/Order.php new file mode 100644 index 0000000..ffa27de --- /dev/null +++ b/src/Bot/Model/Entity/Order.php @@ -0,0 +1,231 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Order class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Order +{ + /** + * @var string $number + * + * @Type("string") + * @Accessor(getter="getNumber",setter="setNumber") + * @SkipWhenEmpty() + */ + private $number; + + /** + * @var string $url + * + * @Type("string") + * @Accessor(getter="getUrl",setter="setUrl") + * @SkipWhenEmpty() + */ + private $url; + + /** + * @var string $date + * + * @Type("string") + * @Accessor(getter="getDate",setter="setDate") + * @SkipWhenEmpty() + */ + private $date; + + /** + * @var Cost $cost + * + * @Type("Cost") + * @Accessor(getter="getCost",setter="setCost") + * @SkipWhenEmpty() + */ + private $cost; + + /** + * @var Status $status + * + * @Type("Status") + * @Accessor(getter="getStatus",setter="setStatus") + * @SkipWhenEmpty() + */ + private $status; + + /** + * @var Delivery $delivery + * + * @Type("Delivery") + * @Accessor(getter="getDelivery",setter="setDelivery") + * @SkipWhenEmpty() + */ + private $delivery; + + /** + * @var array $items + * + * @Type("array") + * @Accessor(getter="getItems",setter="setItems") + * @SkipWhenEmpty() + */ + private $items; + + /** + * @var array $payments + * + * @Type("array") + * @Accessor(getter="getPayments",setter="setPayments") + * @SkipWhenEmpty() + */ + private $payments; + + /** + * @return string + */ + public function getNumber() + { + return $this->number; + } + + /** + * @param string $number + */ + public function setNumber(string $number) + { + $this->number = $number; + } + + /** + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * @param string $url + */ + public function setUrl(string $url) + { + $this->url = $url; + } + + /** + * @return string + */ + public function getDate() + { + return $this->date; + } + + /** + * @param string $date + */ + public function setDate(string $date) + { + $this->date = $date; + } + + /** + * @return Cost + */ + public function getCost() + { + return $this->cost; + } + + /** + * @param Cost $cost + */ + public function setCost(Cost $cost) + { + $this->cost = $cost; + } + + /** + * @return Status + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param Status $status + */ + public function setStatus(Status $status) + { + $this->status = $status; + } + + /** + * @return Delivery + */ + public function getDelivery() + { + return $this->delivery; + } + + /** + * @param Delivery $delivery + */ + public function setDelivery(Delivery $delivery) + { + $this->delivery = $delivery; + } + + /** + * @return array + */ + public function getItems() + { + return $this->items; + } + + /** + * @param array $items + */ + public function setItems(array $items) + { + $this->items = $items; + } + + /** + * @return array + */ + public function getPayments() + { + return $this->payments; + } + + /** + * @param array $payments + */ + public function setPayments(array $payments) + { + $this->payments = $payments; + } +} diff --git a/src/Bot/Model/Entity/OrderItem.php b/src/Bot/Model/Entity/OrderItem.php new file mode 100644 index 0000000..dba54ce --- /dev/null +++ b/src/Bot/Model/Entity/OrderItem.php @@ -0,0 +1,156 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * OrderItem class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class OrderItem +{ + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty() + */ + private $name; + + /** + * @var string $url + * + * @Type("string") + * @Accessor(getter="getUrl",setter="setUrl") + * @SkipWhenEmpty() + */ + private $url; + + /** + * @var string $img + * + * @Type("string") + * @Accessor(getter="getImg",setter="setImg") + * @SkipWhenEmpty() + */ + private $img; + + /** + * @var Cost $price + * + * @Type("Cost") + * @Accessor(getter="getPrice",setter="setPrice") + * @SkipWhenEmpty() + */ + private $price; + + /** + * @var Quantity $quantity + * + * @Type("Quantity") + * @Accessor(getter="getQuantity",setter="setQuantity) + * @SkipWhenEmpty() + */ + private $quantity; + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * @param string $url + */ + public function setUrl(string $url) + { + $this->url = $url; + } + + /** + * @return string + */ + public function getImg() + { + return $this->img; + } + + /** + * @param string $img + */ + public function setImg(string $img) + { + $this->img = $img; + } + + /** + * @return Cost + */ + public function getPrice() + { + return $this->price; + } + + /** + * @param Cost $price + */ + public function setPrice(Cost $price) + { + $this->price = $price; + } + + /** + * @return Quantity + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * @param Quantity $quantity + */ + public function setQuantity(Quantity $quantity) + { + $this->quantity = $quantity; + } +} diff --git a/src/Bot/Model/Entity/Payment.php b/src/Bot/Model/Entity/Payment.php new file mode 100644 index 0000000..b5709c9 --- /dev/null +++ b/src/Bot/Model/Entity/Payment.php @@ -0,0 +1,106 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Payment class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Payment +{ + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty() + */ + private $name; + + /** + * @var PaymentStatus $status + * + * @Type("PaymentStatus") + * @Accessor(getter="getStatus",setter="setStatus") + * @SkipWhenEmpty() + */ + private $status; + + /** + * @var Cost $amount + * + * @Type("Cost") + * @Accessor(getter="getAmount",setter="setAmount") + * @SkipWhenEmpty() + */ + private $amount; + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return PaymentStatus + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param PaymentStatus $status + */ + public function setStatus(PaymentStatus $status) + { + $this->status = $status; + } + + /** + * @return Cost + */ + public function getAmount() + { + return $this->amount; + } + + /** + * @param Cost $amount + */ + public function setAmount(Cost $amount) + { + $this->amount = $amount; + } +} diff --git a/src/Bot/Model/Entity/PaymentStatus.php b/src/Bot/Model/Entity/PaymentStatus.php new file mode 100644 index 0000000..7a20f46 --- /dev/null +++ b/src/Bot/Model/Entity/PaymentStatus.php @@ -0,0 +1,81 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * PaymentStatus class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class PaymentStatus +{ + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty() + */ + private $name; + + /** + * @var bool $payed + * + * @Type("bool") + * @Accessor(getter="getPayed",setter="setPayed") + * @SkipWhenEmpty() + */ + private $payed; + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return bool + */ + public function isPayed() + { + return $this->payed; + } + + /** + * @param bool $payed + */ + public function setPayed(bool $payed) + { + $this->payed = $payed; + } +} diff --git a/src/Bot/Model/Entity/Product.php b/src/Bot/Model/Entity/Product.php new file mode 100644 index 0000000..5c9c9f4 --- /dev/null +++ b/src/Bot/Model/Entity/Product.php @@ -0,0 +1,206 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Product class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Product +{ + /** + * @var int $id + * + * @Type("int") + * @Accessor(getter="getId",setter="setId") + * @SkipWhenEmpty() + */ + private $id; + + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty() + */ + private $name; + + /** + * @var string $article + * + * @Type("string") + * @Accessor(getter="getArticle",setter="setArticle") + * @SkipWhenEmpty() + */ + private $article; + + /** + * @var string $url + * + * @Type("string") + * @Accessor(getter="getUrl",setter="setUrl") + * @SkipWhenEmpty() + */ + private $url; + + /** + * @var string $img + * + * @Type("string") + * @Accessor(getter="getImg",setter="setImg") + * @SkipWhenEmpty() + */ + private $img; + + /** + * @var Cost $cost + * + * @Type("Cost") + * @Accessor(getter="getCost",setter="setCost") + * @SkipWhenEmpty() + */ + private $cost; + + /** + * @var Quantity $quantity + * + * @Type("Quantity") + * @Accessor(getter="getQuantity",setter="setQuantity) + * @SkipWhenEmpty() + */ + private $quantity; + + /** + * @return int + */ + public function getId(): int + { + return $this->id; + } + + /** + * @param int $id + */ + public function setId(int $id) + { + $this->id = $id; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return string + */ + public function getArticle() + { + return $this->article; + } + + /** + * @param string $article + */ + public function setArticle(string $article) + { + $this->article = $article; + } + + /** + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * @param string $url + */ + public function setUrl(string $url) + { + $this->url = $url; + } + + /** + * @return string + */ + public function getImg() + { + return $this->img; + } + + /** + * @param string $img + */ + public function setImg(string $img) + { + $this->img = $img; + } + + /** + * @return Cost + */ + public function getCost() + { + return $this->cost; + } + + /** + * @param Cost $cost + */ + public function setCost(Cost $cost) + { + $this->cost = $cost; + } + + /** + * @return Quantity + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * @param Quantity $quantity + */ + public function setQuantity(Quantity $quantity) + { + $this->quantity = $quantity; + } +} diff --git a/src/Bot/Model/Entity/Quantity.php b/src/Bot/Model/Entity/Quantity.php new file mode 100644 index 0000000..d74d4c4 --- /dev/null +++ b/src/Bot/Model/Entity/Quantity.php @@ -0,0 +1,82 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Quantity class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Quantity +{ + /** + * @var float $value + * + * @Type("float") + * @Accessor(getter="getValue",setter="setValue") + * @SkipWhenEmpty() + */ + private $value; + + /** + * @var string $unit + * + * @Type("string") + * @Accessor(getter="getUnit",setter="setUnit") + * + * @Assert\Currency + */ + private $unit; + + /** + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * @param float $value + */ + public function setValue(float $value) + { + $this->value = $value; + } + + /** + * @return string + */ + public function getUnit() + { + return $this->unit; + } + + /** + * @param string $unit + */ + public function setUnit(string $unit) + { + $this->unit = $unit; + } +} diff --git a/src/Bot/Model/Entity/Status.php b/src/Bot/Model/Entity/Status.php new file mode 100644 index 0000000..4564290 --- /dev/null +++ b/src/Bot/Model/Entity/Status.php @@ -0,0 +1,81 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Entity; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * Status class + * + * @package RetailCrm\Mg\Bot\Model\Entity + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Status +{ + /** + * @var string $code + * + * @Type("string") + * @Accessor(getter="getCode",setter="setCode") + * @SkipWhenEmpty() + */ + private $code; + + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty() + */ + private $name; + + /** + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * @param string $code + */ + public function setCode(string $code) + { + $this->code = $code; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } +} diff --git a/src/Bot/Model/Request/BotsRequest.php b/src/Bot/Model/Request/BotsRequest.php new file mode 100644 index 0000000..6625f1a --- /dev/null +++ b/src/Bot/Model/Request/BotsRequest.php @@ -0,0 +1,102 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * BotsRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class BotsRequest +{ + use CommonFields; + + /** + * @Type("int") + * @Accessor(getter="getActive",setter="setActive") + * @SkipWhenEmpty + */ + private $active; + + /** + * @Type("int") + * @Accessor(getter="getSelf",setter="setSelf") + * @SkipWhenEmpty + */ + private $self; + + /** + * @Type("array") + * @Accessor(getter="getRoles",setter="setRoles") + * @SkipWhenEmpty + */ + private $roles; + + /** + * @return int + */ + public function getSelf() + { + return $this->self; + } + + /** + * @param int $self + */ + public function setSelf($self) + { + $this->self = $self; + } + + /** + * @return int + */ + public function getActive() + { + return $this->active; + } + + /** + * @param int $active + */ + public function setActive($active) + { + $this->active = $active; + } + + /** + * @return array + */ + public function getRoles() + { + return $this->roles; + } + + /** + * @param array $roles + */ + public function setRoles($roles) + { + $this->roles = $roles; + } +} diff --git a/src/Bot/Model/Request/ChannelsRequest.php b/src/Bot/Model/Request/ChannelsRequest.php new file mode 100644 index 0000000..738f0a4 --- /dev/null +++ b/src/Bot/Model/Request/ChannelsRequest.php @@ -0,0 +1,79 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * ChannelsRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class ChannelsRequest +{ + use CommonFields; + + /** + * @Type("array") + * @Accessor(getter="getTypes",setter="setTypes") + * @SkipWhenEmpty + */ + private $types; + + /** + * @Type("int") + * @Accessor(getter="getActive",setter="setActive") + * @SkipWhenEmpty + */ + private $active; + + /** + * @return array + */ + public function getTypes() + { + return $this->types; + } + + /** + * @param array $types + */ + public function setTypes($types) + { + $this->types = $types; + } + + /** + * @return int + */ + public function getActive() + { + return $this->active; + } + + /** + * @param int $active + */ + public function setActive($active) + { + $this->active = $active; + } +} diff --git a/src/Bot/Model/Request/ChatsRequest.php b/src/Bot/Model/Request/ChatsRequest.php new file mode 100644 index 0000000..91f1396 --- /dev/null +++ b/src/Bot/Model/Request/ChatsRequest.php @@ -0,0 +1,79 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * ChatsRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class ChatsRequest +{ + use CommonFields; + + /** + * @Type("int") + * @Accessor(getter="getChannelId",setter="setChannelId") + * @SkipWhenEmpty() + */ + private $channelId; + + /** + * @Type("string") + * @Accessor(getter="getChannelType",setter="setChannelType") + * @SkipWhenEmpty() + */ + private $channelType; + + /** + * @return int + */ + public function getChannelId() + { + return $this->channelId; + } + + /** + * @param int $channelId + */ + public function setChannelId($channelId) + { + $this->channelId = $channelId; + } + + /** + * @return string + */ + public function getChannelType() + { + return $this->channelType; + } + + /** + * @param string $channelType + */ + public function setChannelType($channelType) + { + $this->channelType = $channelType; + } +} diff --git a/src/Bot/Model/Request/CommandEditRequest.php b/src/Bot/Model/Request/CommandEditRequest.php new file mode 100644 index 0000000..e95161d --- /dev/null +++ b/src/Bot/Model/Request/CommandEditRequest.php @@ -0,0 +1,109 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; +use Symfony\Component\Validator\Constraints as Assert; + +/** + * PHP version 7.0 + * + * CommandEditRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class CommandEditRequest +{ + /** + * @var int $botId + * + * @Type("int") + * @Accessor(getter="getBotId",setter="setBotId") + * + * @Assert\NotBlank + */ + private $botId; + + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * + * @Assert\NotBlank + */ + private $name; + + /** + * @var string $description + * + * @Type("string") + * @Accessor(getter="getDescription",setter="setDescription") + * @SkipWhenEmpty + */ + private $description; + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @param string $description + */ + public function setDescription(string $description) + { + $this->description = $description; + } + + /** + * @return int + */ + public function getBotId() + { + return $this->botId; + } + + /** + * @param int $botId + */ + public function setBotId(int $botId) + { + $this->botId = $botId; + } +} diff --git a/src/Bot/Model/Request/CommandsRequest.php b/src/Bot/Model/Request/CommandsRequest.php new file mode 100644 index 0000000..0a718e7 --- /dev/null +++ b/src/Bot/Model/Request/CommandsRequest.php @@ -0,0 +1,56 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * CommandsRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class CommandsRequest +{ + use CommonFields; + + /** + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty + */ + private $name; + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + } +} diff --git a/src/Bot/Model/Request/CommonFields.php b/src/Bot/Model/Request/CommonFields.php new file mode 100644 index 0000000..5ade7d0 --- /dev/null +++ b/src/Bot/Model/Request/CommonFields.php @@ -0,0 +1,100 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * CommonFields trait + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +trait CommonFields +{ + /** + * @Type("int") + * @Accessor(getter="getId",setter="setId") + * @SkipWhenEmpty + */ + private $id; + + /** + * @Type("string") + * @Accessor(getter="getSince",setter="setSince") + * @SkipWhenEmpty + */ + private $since; + + /** + * @Type("string") + * @Accessor(getter="getUntil",setter="setUntil") + * @SkipWhenEmpty + */ + private $until; + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * @return string + */ + public function getSince() + { + return $this->since; + } + + /** + * @param string $since + */ + public function setSince($since) + { + $this->since = $since; + } + + /** + * @return string + */ + public function getUntil() + { + return $this->until; + } + + /** + * @param string $until + */ + public function setUntil($until) + { + $this->until = $until; + } +} diff --git a/src/Bot/Model/Request/CustomersRequest.php b/src/Bot/Model/Request/CustomersRequest.php new file mode 100644 index 0000000..d15604d --- /dev/null +++ b/src/Bot/Model/Request/CustomersRequest.php @@ -0,0 +1,56 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * CustomersRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class CustomersRequest +{ + use CommonFields; + + /** + * @Type("string") + * @Accessor(getter="getExternalId",setter="setExternalId") + * @SkipWhenEmpty + */ + private $externalId; + + /** + * @return string + */ + public function getExternalId() + { + return $this->externalId; + } + + /** + * @param string $externalId + */ + public function setExternalId($externalId) + { + $this->externalId = $externalId; + } +} diff --git a/src/Bot/Model/Request/DialogAssignRequest.php b/src/Bot/Model/Request/DialogAssignRequest.php new file mode 100644 index 0000000..3837ee1 --- /dev/null +++ b/src/Bot/Model/Request/DialogAssignRequest.php @@ -0,0 +1,106 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * DialogAssignRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class DialogAssignRequest +{ + /** + * @var int $dialogId + * + * @Type("int") + * @Accessor(getter="getDialogId,setter="setDialogId") + * @SkipWhenEmpty + */ + private $dialogId; + + /** + * @var int $userId + * + * @Type("int") + * @Accessor(getter="getUserId",setter="setUserId") + * @SkipWhenEmpty + */ + private $userId; + + /** + * @var int $botId + * + * @Type("int") + * @Accessor(getter="getBotId",setter="setBotId") + * @SkipWhenEmpty() + */ + private $botId; + + /** + * @return int + */ + public function getDialogId() + { + return $this->dialogId; + } + + /** + * @param int $dialogId + */ + public function setDialogId(int $dialogId) + { + $this->dialogId = $dialogId; + } + + /** + * @return int + */ + public function getUserId() + { + return $this->userId; + } + + /** + * @param int $userId + */ + public function setUserId(int $userId) + { + $this->userId = $userId; + } + + /** + * @return int + */ + public function getBotId() + { + return $this->botId; + } + + /** + * @param int $botId + */ + public function setBotId(int $botId) + { + $this->botId = $botId; + } +} diff --git a/src/Bot/Model/Request/DialogsRequest.php b/src/Bot/Model/Request/DialogsRequest.php new file mode 100644 index 0000000..e2a6a8b --- /dev/null +++ b/src/Bot/Model/Request/DialogsRequest.php @@ -0,0 +1,158 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * DialogsRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class DialogsRequest +{ + use CommonFields; + + /** + * @var int $chatId + * + * @Type("int") + * @Accessor(getter="getChatId",setter="setChatId") + * @SkipWhenEmpty + */ + private $chatId; + + /** + * @var int $userId + * + * @Type("int") + * @Accessor(getter="getUserId",setter="setUserId") + * @SkipWhenEmpty + */ + private $userId; + + /** + * @var int $botId + * + * @Type("int") + * @Accessor(getter="getBotId",setter="setBotId") + * @SkipWhenEmpty() + */ + private $botId; + + /** + * @var int $active + * + * @Type("int") + * @Accessor(getter="getActive",setter="setActive") + * @SkipWhenEmpty + */ + private $active; + + /** + * @var int $assign + * + * @Type("int") + * @Accessor(getter="getAssign",setter="setAssign") + * @SkipWhenEmpty + */ + private $assign; + + /** + * @return int + */ + public function getChatId() + { + return $this->chatId; + } + + /** + * @param int $chatId + */ + public function setChatId(int $chatId) + { + $this->chatId = $chatId; + } + + /** + * @return int + */ + public function getUserId() + { + return $this->userId; + } + + /** + * @param int $userId + */ + public function setUserId(int $userId) + { + $this->userId = $userId; + } + + /** + * @return int + */ + public function getBotId() + { + return $this->botId; + } + + /** + * @param int $botId + */ + public function setBotId(int $botId) + { + $this->botId = $botId; + } + + /** + * @return int + */ + public function getActive() + { + return $this->active; + } + + /** + * @param int $active + */ + public function setActive(int $active) + { + $this->active = $active; + } + + /** + * @return int + */ + public function getAssign() + { + return $this->assign; + } + + /** + * @param int $assign + */ + public function setAssign(int $assign) + { + $this->assign = $assign; + } +} diff --git a/src/Bot/Model/Request/InfoRequest.php b/src/Bot/Model/Request/InfoRequest.php new file mode 100644 index 0000000..d4a5d43 --- /dev/null +++ b/src/Bot/Model/Request/InfoRequest.php @@ -0,0 +1,106 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * InfoRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class InfoRequest +{ + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty() + */ + private $name; + + /** + * @var string $avatarUrl + * + * @Type("string") + * @Accessor(getter="getAvatarUrl",setter="setAvatarUrl") + * @SkipWhenEmpty() + */ + private $avatarUrl; + + /** + * @var array $roles + * + * @Type("array") + * @Accessor(getter="getRoles",setter="setRoles") + * @SkipWhenEmpty() + */ + private $roles; + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return string + */ + public function getAvatarUrl() + { + return $this->avatarUrl; + } + + /** + * @param string $avatarUrl + */ + public function setAvatarUrl(string $avatarUrl) + { + $this->avatarUrl = $avatarUrl; + } + + /** + * @return array + */ + public function getRoles() + { + return $this->roles; + } + + /** + * @param array $roles + */ + public function setRoles(array $roles) + { + $this->roles = $roles; + } +} diff --git a/src/Bot/Model/Request/MembersRequest.php b/src/Bot/Model/Request/MembersRequest.php new file mode 100644 index 0000000..ea4050b --- /dev/null +++ b/src/Bot/Model/Request/MembersRequest.php @@ -0,0 +1,156 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * MembersRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class MembersRequest +{ + /** + * @var int $chatId + * + * @Type("int") + * @Accessor(getter="getChatId",setter="setChatId") + * @SkipWhenEmpty + */ + private $chatId; + + /** + * @var int $userId + * + * @Type("int") + * @Accessor(getter="getUserId",setter="setUserId") + * @SkipWhenEmpty + */ + private $userId; + + /** + * @var string $state + * + * @Type("string") + * @Accessor(getter="getState",setter="setState") + * @SkipWhenEmpty + */ + private $state; + + /** + * @var string $since + * + * @Type("string") + * @Accessor(getter="getSince",setter="setSince") + * @SkipWhenEmpty + */ + private $since; + + /** + * @var string $until + * + * @Type("string") + * @Accessor(getter="getUntil",setter="setUntil") + * @SkipWhenEmpty + */ + private $until; + + /** + * @return int + */ + public function getChatId() + { + return $this->chatId; + } + + /** + * @param int $chatId + */ + public function setChatId(int $chatId) + { + $this->chatId = $chatId; + } + + /** + * @return int + */ + public function getUserId() + { + return $this->userId; + } + + /** + * @param int $userId + */ + public function setUserId(int $userId) + { + $this->userId = $userId; + } + + /** + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * @param string $state + */ + public function setState(string $state) + { + $this->state = $state; + } + + /** + * @return string + */ + public function getSince() + { + return $this->since; + } + + /** + * @param string $since + */ + public function setSince(string $since) + { + $this->since = $since; + } + + /** + * @return string + */ + public function getUntil() + { + return $this->until; + } + + /** + * @param string $until + */ + public function setUntil(string $until) + { + $this->until = $until; + } +} diff --git a/src/Bot/Model/Request/MessageEditRequest.php b/src/Bot/Model/Request/MessageEditRequest.php new file mode 100644 index 0000000..4cf9baa --- /dev/null +++ b/src/Bot/Model/Request/MessageEditRequest.php @@ -0,0 +1,81 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * MessageEditRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class MessageEditRequest +{ + /** + * @var int $id + * + * @Type("int") + * @Accessor(getter="getId",setter="setId") + * @SkipWhenEmpty() + */ + private $id; + + /** + * @var string $content + * + * @Type("string") + * @Accessor(getter="getContent",setter="setContent") + * @SkipWhenEmpty() + */ + private $content; + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param int $id + */ + public function setId(int $id) + { + $this->id = $id; + } + + /** + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * @param string $content + */ + public function setContent(string $content) + { + $this->content = $content; + } +} diff --git a/src/Bot/Model/Request/MessageSendRequest.php b/src/Bot/Model/Request/MessageSendRequest.php new file mode 100644 index 0000000..254134f --- /dev/null +++ b/src/Bot/Model/Request/MessageSendRequest.php @@ -0,0 +1,239 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; +use Symfony\Component\Validator\Constraints as Assert; +use RetailCrm\Mg\Bot\Model\Entity\Order; +use RetailCrm\Mg\Bot\Model\Entity\Product; + +/** + * PHP version 7.0 + * + * MessageSendRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class MessageSendRequest +{ + /** + * @var string $type + * + * @Type("string") + * @Accessor(getter="getType",setter="setType") + * @SkipWhenEmpty() + */ + private $type; + + /** + * @var string $content + * + * @Type("string") + * @Accessor(getter="getContent",setter="setContent") + * + * @Assert\NotBlank + */ + private $content; + + /** + * @var Product $product + * + * @Type("Product") + * @Accessor(getter="getProduct",setter="setProduct") + * @SkipWhenEmpty() + */ + private $product; + + /** + * @var Order $order + * + * @Type("Order") + * @Accessor(getter="getOrder",setter="setOrder") + * @SkipWhenEmpty() + */ + private $order; + + /** + * @var array $items + * + * @Type("array") + * @Accessor(getter="getItems",setter="setItems") + * @SkipWhenEmpty() + */ + private $items; + + /** + * @var string $scope + * + * @Type("string") + * @Accessor(getter="getScope",setter="setScope") + * + * @Assert\NotBlank + */ + private $scope; + + /** + * @var int $chatId + * + * @Type("int") + * @Accessor(getter="getChatId",setter="setChatId") + * + * @Assert\NotBlank + */ + private $chatId; + + + /** + * @var int $quoteMessageId + * + * @Type("int") + * @Accessor(getter="getQuoteMessageId",setter="setQuoteMessageId") + * @SkipWhenEmpty + */ + private $quoteMessageId; + + + /** + * @return int + */ + public function getChatId() + { + return $this->chatId; + } + + /** + * @param int $chatId + */ + public function setChatId(int $chatId) + { + $this->chatId = $chatId; + } + + /** + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * @param string $scope + */ + public function setScope(string $scope) + { + $this->scope = $scope; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param string $type + */ + public function setType(string $type) + { + $this->type = $type; + } + + /** + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * @param string $content + */ + public function setContent(string $content) + { + $this->content = $content; + } + + /** + * @return Product + */ + public function getProduct() + { + return $this->product; + } + + /** + * @param Product $product + */ + public function setProduct(Product $product) + { + $this->product = $product; + } + + /** + * @return Order + */ + public function getOrder() + { + return $this->order; + } + + /** + * @param Order $order + */ + public function setOrder(Order $order) + { + $this->order = $order; + } + + /** + * @return array + */ + public function getItems() + { + return $this->items; + } + + /** + * @param array $items + */ + public function setItems(array $items) + { + $this->items = $items; + } + + /** + * @return int + */ + public function getQuoteMessageId() + { + return $this->quoteMessageId; + } + + /** + * @param int $quoteMessageId + */ + public function setQuoteMessageId(int $quoteMessageId) + { + $this->quoteMessageId = $quoteMessageId; + } +} diff --git a/src/Bot/Model/Request/MessagesRequest.php b/src/Bot/Model/Request/MessagesRequest.php new file mode 100644 index 0000000..a32e243 --- /dev/null +++ b/src/Bot/Model/Request/MessagesRequest.php @@ -0,0 +1,258 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * MessagesRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class MessagesRequest +{ + use CommonFields; + + /** + * @var int $chatId + * + * @Type("int") + * @Accessor(getter="getChatId",setter="setChatId") + * @SkipWhenEmpty + */ + private $chatId; + + /** + * @var int $dialogId + * + * @Type("int") + * @Accessor(getter="getDialogId",setter="setDialogId") + * @SkipWhenEmpty + */ + private $dialogId; + + /** + * @var int $userId + * + * @Type("int") + * @Accessor(getter="getUserId",setter="setUserId") + * @SkipWhenEmpty + */ + private $userId; + + /** + * @var int $customerId + * + * @Type("int") + * @Accessor(getter="getCustomerId",setter="setCustomerId") + * @SkipWhenEmpty() + */ + private $customerId; + + /** + * @var int $botId + * + * @Type("int") + * @Accessor(getter="getBotId",setter="setBotId") + * @SkipWhenEmpty() + */ + private $botId; + + /** + * @var int $channelId + * + * @Type("int") + * @Accessor(getter="getChannelId",setter="setChannelId") + * @SkipWhenEmpty() + */ + private $channelId; + + /** + * @var string $channelType + * + * @Type("string") + * @Accessor(getter="getChannelType",setter="setChannelType") + * @SkipWhenEmpty() + */ + private $channelType; + + /** + * @var string $scope + * + * @Type("string") + * @Accessor(getter="getScope",setter="setScope") + * @SkipWhenEmpty() + */ + private $scope; + + /** + * @var string $type + * + * @Type("string") + * @Accessor(getter="getType",setter="setType") + * @SkipWhenEmpty() + */ + private $type; + + /** + * @return int + */ + public function getChatId() + { + return $this->chatId; + } + + /** + * @param int $chatId + */ + public function setChatId(int $chatId) + { + $this->chatId = $chatId; + } + + /** + * @return int + */ + public function getDialogId() + { + return $this->dialogId; + } + + /** + * @param int $dialogId + */ + public function setDialogId(int $dialogId) + { + $this->dialogId = $dialogId; + } + + /** + * @return int + */ + public function getUserId() + { + return $this->userId; + } + + /** + * @param int $userId + */ + public function setUserId(int $userId) + { + $this->userId = $userId; + } + + /** + * @return int + */ + public function getCustomerId() + { + return $this->customerId; + } + + /** + * @param int $customerId + */ + public function setCustomerId(int $customerId) + { + $this->customerId = $customerId; + } + + /** + * @return int + */ + public function getBotId() + { + return $this->botId; + } + + /** + * @param int $botId + */ + public function setBotId(int $botId) + { + $this->botId = $botId; + } + + /** + * @return int + */ + public function getChannelId() + { + return $this->channelId; + } + + /** + * @param int $channelId + */ + public function setChannelId(int $channelId) + { + $this->channelId = $channelId; + } + + /** + * @return string + */ + public function getChannelType() + { + return $this->channelType; + } + + /** + * @param string $channelType + */ + public function setChannelType(string $channelType) + { + $this->channelType = $channelType; + } + + /** + * @return string + */ + public function getScope() + { + return $this->scope; + } + + /** + * @param string $scope + */ + public function setScope(string $scope) + { + $this->scope = $scope; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @param string $type + */ + public function setType(string $type) + { + $this->type = $type; + } +} diff --git a/src/Bot/Model/Request/UsersRequest.php b/src/Bot/Model/Request/UsersRequest.php new file mode 100644 index 0000000..3bd40fd --- /dev/null +++ b/src/Bot/Model/Request/UsersRequest.php @@ -0,0 +1,102 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Model\Request; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; + +/** + * PHP version 7.0 + * + * UsersRequest class + * + * @package RetailCrm\Mg\Bot\Model\Request + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class UsersRequest +{ + use CommonFields; + + /** + * @Type("string") + * @Accessor(getter="getExternalId",setter="setExternalId") + * @SkipWhenEmpty + */ + private $externalId; + + /** + * @Type("int") + * @Accessor(getter="getActive",setter="setActive") + * @SkipWhenEmpty + */ + private $active; + + /** + * @Type("int") + * @Accessor(getter="getOnline",setter="setOnline") + * @SkipWhenEmpty + */ + private $online; + + /** + * @return string + */ + public function getExternalId() + { + return $this->externalId; + } + + /** + * @param string $externalId + */ + public function setExternalId($externalId) + { + $this->externalId = $externalId; + } + + /** + * @return int + */ + public function getActive() + { + return $this->active; + } + + /** + * @param int $active + */ + public function setActive($active) + { + $this->active = $active; + } + + /** + * @return int + */ + public function getOnline() + { + return $this->online; + } + + /** + * @param int $online + */ + public function setOnline($online) + { + $this->online = $online; + } +} diff --git a/src/Bot/Model/Response/.gitkeep b/src/Bot/Model/Response/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/Bot/Request.php b/src/Bot/Request.php new file mode 100644 index 0000000..ea0b340 --- /dev/null +++ b/src/Bot/Request.php @@ -0,0 +1,205 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot; + +use RetailCrm\Common\Exception\CurlException; +use RetailCrm\Common\Exception\LimitException; +use Exception; +use InvalidArgumentException; +use RetailCrm\Common\Serializer; +use RetailCrm\Common\Url; +use Symfony\Component\Validator\Validation; + +/** + * PHP version 7.0 + * + * Request class + * + * @package RetailCrm\Mg\Bot + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Request +{ + const METHOD_GET = 'GET'; + const METHOD_POST = 'POST'; + const METHOD_PUT = 'PUT'; + const METHOD_PATCH = 'PATCH'; + const METHOD_DELETE = 'DELETE'; + + protected $url; + protected $token; + private $debug; + private $allowedMethods; + private $stdout; + + /** + * Client constructor. + * + * @param string $url api url + * @param string $token api token + * @param bool $debug make request verbose + * @param bool|resource $stdout default output for debug + */ + public function __construct($url, $token, $debug, $stdout = STDOUT) + { + if (false === stripos($url, 'https://')) { + throw new InvalidArgumentException('API schema requires HTTPS protocol'); + } + + $this->url = $url; + $this->token = $token; + $this->debug = $debug; + $this->stdout = $stdout; + $this->allowedMethods = [ + self::METHOD_GET, + self::METHOD_POST, + self::METHOD_PUT, + self::METHOD_PATCH, + self::METHOD_DELETE + ]; + } + + /** + * Make HTTP request + * + * @param string $path request url + * @param string $method (default: 'GET') + * @param mixed $request (default: null) + * @param int $serializeTo + * + * @return Response + * @throws \Exception + */ + public function makeRequest($path, $method, $request = null, $serializeTo = Serializer::S_JSON) + { + $this->validateMethod($method); + + if (!is_null($request)) { + $this->validateRequest($request); + } + + $urlBuilder = new Url(); + + $parameters = is_null($request) ? null : Serializer::serialize($request, $serializeTo); + $url = $method == self::METHOD_GET + ? $this->url . $urlBuilder->buildUrl($path, $parameters, Url::RFC_CUSTOM) + : $this->url . $path + ; + + $curlHandler = curl_init(); + curl_setopt($curlHandler, CURLOPT_URL, $url); + curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curlHandler, CURLOPT_FOLLOWLOCATION, 1); + curl_setopt($curlHandler, CURLOPT_FAILONERROR, false); + curl_setopt($curlHandler, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curlHandler, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curlHandler, CURLOPT_TIMEOUT, 60); + curl_setopt($curlHandler, CURLOPT_CONNECTTIMEOUT, 60); + curl_setopt($curlHandler, CURLOPT_VERBOSE, $this->debug); + curl_setopt($curlHandler, CURLOPT_STDERR, $this->stdout); + + curl_setopt($curlHandler, CURLOPT_HTTPHEADER, [ + 'Content-Type: application/json', + sprintf("X-Bot-Token: %s", $this->token) + ]); + + if (in_array($method, [self::METHOD_POST, self::METHOD_PUT, self::METHOD_PATCH, self::METHOD_DELETE])) { + curl_setopt($curlHandler, CURLOPT_CUSTOMREQUEST, $method); + curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $parameters); + } + + $responseBody = curl_exec($curlHandler); + $statusCode = curl_getinfo($curlHandler, CURLINFO_HTTP_CODE); + + $response = Response::parseJSON($responseBody); + $errorMessage = !empty($response['errorMsg']) ? $response['errorMsg'] : ''; + $errorMessage = !empty($response['errors']) ? $this->getErrors($response['errors']) : $errorMessage; + + /** + * responses with 400 & 460 http codes contains extended error data + * therefore they are not handled as exceptions + */ + + if (in_array($statusCode, [403, 404, 500])) { + throw new Exception($errorMessage); + } + + if ($statusCode == 503) { + throw new LimitException($errorMessage); + } + + $errno = curl_errno($curlHandler); + $error = curl_error($curlHandler); + + curl_close($curlHandler); + + if ($errno) { + throw new CurlException($error, $errno); + } + + return new Response($statusCode, $responseBody); + } + + /** + * Validate HTTP method + * + * @param string $method + */ + private function validateMethod($method) + { + if (!in_array($method, $this->allowedMethods, false)) { + throw new InvalidArgumentException( + sprintf( + 'Method "%s" is not valid. Allowed methods are %s', + $method, + implode(', ', $this->allowedMethods) + ) + ); + } + } + + /** + * Validate given class + * + * @param string $class + * + * @return void + */ + private function validateRequest($class) + { + $validator = Validation::createValidatorBuilder() + ->enableAnnotationMapping() + ->getValidator(); + + $errors = $validator->validate($class); + + if ($errors->count() > 0) { + $message = (string) $errors; + throw new InvalidArgumentException($message); + } + } + + private function getErrors(array $errors) + { + $errorString = ''; + + foreach ($errors as $error) { + $errorString .= $error . " "; + } + + return $errorString; + } +} diff --git a/src/Bot/Response.php b/src/Bot/Response.php new file mode 100644 index 0000000..daf4088 --- /dev/null +++ b/src/Bot/Response.php @@ -0,0 +1,229 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot; + +use ArrayAccess; +use BadMethodCallException; +use InvalidArgumentException; +use RetailCrm\Common\Exception\InvalidJsonException; + +/** + * PHP version 7.0 + * + * Request class + * + * @package RetailCrm\Mg\Bot + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Response implements ArrayAccess +{ + // HTTP response status code + protected $statusCode; + + // response assoc array + protected $response; + + // response body + protected $raw; + + /** + * ApiResponse constructor. + * + * @param int $statusCode HTTP status code + * @param mixed $responseBody HTTP body + * + * @throws InvalidJsonException + */ + public function __construct($statusCode, $responseBody = null) + { + $this->statusCode = $statusCode; + $this->raw = $responseBody; + $this->response = self::parseJSON($responseBody); + } + + /** + * Return raw HTTP response + * + * @return string|null + */ + public function getRawResponse() + { + return $this->raw; + } + + /** + * Return HTTP response + * + * @return array + */ + public function getResponse() + { + return $this->response; + } + + /** + * Return HTTP response status code + * + * @return int + */ + public function getStatusCode() + { + return $this->statusCode; + } + + /** + * HTTP request was successful + * + * @return bool + */ + public function isSuccessful() + { + return $this->statusCode < 400; + } + + /** + * Allow to access for the property throw class method + * + * @param string $name method name + * @param mixed $arguments method parameters + * + * @throws \InvalidArgumentException + * + * @return mixed + */ + public function __call($name, $arguments) + { + // convert getSomeProperty to someProperty + $propertyName = strtolower(substr($name, 3, 1)) . substr($name, 4); + + if (!isset($this->response[$propertyName])) { + throw new InvalidArgumentException("Method \"$name\" not found"); + } + + return $this->response[$propertyName]; + } + + /** + * Allow to access for the property throw object property + * + * @param string $name property name + * + * @throws \InvalidArgumentException + * + * @return mixed + */ + public function __get($name) + { + if (!isset($this->response[$name])) { + throw new InvalidArgumentException("Property \"$name\" not found"); + } + + return $this->response[$name]; + } + + /** + * Allow to check if the property exists through object property + * + * @param string $name property name + * + * @return bool + */ + public function __isset($name) + { + return isset($this->response[$name]); + } + + /** + * Offset set + * + * @param mixed $offset offset + * @param mixed $value value + * + * @throws BadMethodCallException + * @return void + */ + public function offsetSet($offset, $value) + { + $message = sprintf("This call not allowed. Offset given: %s. Value given: %s", $offset, $value); + throw new BadMethodCallException($message); + } + + /** + * Offset unset + * + * @param mixed $offset offset + * + * @throws BadMethodCallException + * @return void + */ + public function offsetUnset($offset) + { + $message = sprintf("This call not allowed. Offset given: %s", $offset); + throw new BadMethodCallException($message); + } + + /** + * Check offset + * + * @param mixed $offset offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->response[$offset]); + } + + /** + * Get offset + * + * @param mixed $offset offset + * + * @throws \InvalidArgumentException + * + * @return mixed + */ + public function offsetGet($offset) + { + if (!isset($this->response[$offset])) { + throw new InvalidArgumentException("Property \"$offset\" not found"); + } + + return $this->response[$offset]; + } + + /** + * @param string $responseBody + * + * @return array + */ + public static function parseJSON($responseBody): array + { + $result = []; + + if (!empty($responseBody)) { + $response = json_decode($responseBody, true); + + if (!$response && JSON_ERROR_NONE !== ($error = json_last_error())) { + throw new InvalidJsonException("Invalid JSON in the API response body. Error code #$error", $error); + } + + $result = $response; + } + + return $result; + } +} diff --git a/src/Exception/CurlException.php b/src/Exception/CurlException.php new file mode 100644 index 0000000..8412b22 --- /dev/null +++ b/src/Exception/CurlException.php @@ -0,0 +1,30 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Common\Exception; + +use RuntimeException; + +/** + * PHP version 7.0 + * + * Class CurlException + * + * @package RetailCrm\Common\Exception + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class CurlException extends RuntimeException +{ +} diff --git a/src/Exception/InvalidJsonException.php b/src/Exception/InvalidJsonException.php new file mode 100644 index 0000000..dc43f3f --- /dev/null +++ b/src/Exception/InvalidJsonException.php @@ -0,0 +1,30 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Common\Exception; + +use DomainException; + +/** + * PHP version 7.0 + * + * Class InvalidJsonException + * + * @package RetailCrm\Common\Exception + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class InvalidJsonException extends DomainException +{ +} diff --git a/src/Exception/LimitException.php b/src/Exception/LimitException.php new file mode 100644 index 0000000..f79084c --- /dev/null +++ b/src/Exception/LimitException.php @@ -0,0 +1,30 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Common\Exception; + +use DomainException; + +/** + * PHP version 7.0 + * + * Class CurlException + * + * @package RetailCrm\Common\Exception + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class LimitException extends DomainException +{ +} diff --git a/src/Register.php b/src/Register.php new file mode 100644 index 0000000..27d36a1 --- /dev/null +++ b/src/Register.php @@ -0,0 +1,346 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Common; + +use JMS\Serializer\Annotation\Accessor; +use JMS\Serializer\Annotation\SkipWhenEmpty; +use JMS\Serializer\Annotation\Type; +use Symfony\Component\Validator\Constraints as Assert; + +/** + * PHP version 7.0 + * + * RequestHelper class + * + * @package RetailCrm\Common + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Register +{ + /** + * @var string $code + * + * @Type("string") + * @Accessor(getter="getCode",setter="setCode") + * + * @Assert\NotBlank + */ + private $code; + + /** + * @var string $integrationCode + * + * @Type("string") + * @Accessor(getter="getIntegrationCode",setter="setIntegrationCode") + * + * @Assert\NotBlank + */ + private $integrationCode; + + /** + * @var string $active + * @Type("string") + * @Accessor(getter="getActive",setter="setActive") + * @SkipWhenEmpty + */ + private $active; + + /** + * @var string $name + * + * @Type("string") + * @Accessor(getter="getName",setter="setName") + * @SkipWhenEmpty + */ + private $name; + + /** + * @var string $logo + * + * @Type("string") + * @Accessor(getter="getLogo",setter="setLogo") + * @SkipWhenEmpty + * + * @Assert\Url( + * message = "The logo url is not a valid url", + * protocols = {"http", "https"} + * ) + */ + private $logo; + + /** + * @var string $clientId + * + * @Type("string") + * @Accessor(getter="getClientId",setter="setClientId") + * + * @Assert\NotBlank + */ + private $clientId; + + /** + * @var string $baseUrl + * + * @Type("string") + * @Accessor(getter="getBaseUrl",setter="setBaseUrl") + * + * @Assert\NotBlank + * @Assert\Url( + * message = "The baseUrl is not a valid url", + * protocols = {"http", "https"} + * ) + */ + private $baseUrl; + + /** + * @var string $accountUrl + * + * @Type("string") + * @Accessor(getter="getAccountUrl",setter="setAccountUrl") + * + * @Assert\NotBlank + * @Assert\Url( + * message = "The baseUrl is not a valid url", + * protocols = {"http", "https"} + * ) + */ + private $accountUrl; + + /** + * @var array $actions + * + * @Type("array") + * @Accessor(getter="getActions",setter="setActions") + * + * @Assert\NotBlank + */ + private $actions; + + /** + * @var array $availableCountries + * + * @Type("array") + * @Accessor(getter="getAvailableCountries",setter="setAvailableCountries") + * @SkipWhenEmpty + */ + private $availableCountries; + + /** + * @var array $integrations + * + * @Type("array") + * @Accessor(getter="getIntegrations",setter="setIntegrations") + * + * @Assert\NotBlank + */ + private $integrations; + + /** + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * @param string $code + */ + public function setCode(string $code) + { + $this->code = $code; + } + + /** + * @return string + */ + public function getIntegrationCode() + { + return $this->integrationCode; + } + + /** + * @param string $integrationCode + */ + public function setIntegrationCode(string $integrationCode) + { + $this->integrationCode = $integrationCode; + } + + /** + * @return string + */ + public function getActive() + { + return $this->active; + } + + /** + * @param string $active + */ + public function setActive(string $active) + { + $this->active = $active; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @param string $name + */ + public function setName(string $name) + { + $this->name = $name; + } + + /** + * @return string + */ + public function getLogo() + { + return $this->logo; + } + + /** + * @param string $logo + */ + public function setLogo(string $logo) + { + $this->logo = $logo; + } + + /** + * @return string + */ + public function getClientId() + { + return $this->clientId; + } + + /** + * @param string $clientId + */ + public function setClientId(string $clientId) + { + $this->clientId = $clientId; + } + + /** + * @return string + */ + public function getBaseUrl() + { + return $this->baseUrl; + } + + /** + * @param string $baseUrl + */ + public function setBaseUrl(string $baseUrl) + { + $this->baseUrl = $baseUrl; + } + + /** + * @return string + */ + public function getAccountUrl() + { + return $this->accountUrl; + } + + /** + * @param string $accountUrl + */ + public function setAccountUrl(string $accountUrl) + { + $this->accountUrl = $accountUrl; + } + + /** + * @return array + */ + public function getActions() + { + return $this->actions; + } + + /** + * @param array $actions + */ + public function setActions(array $actions) + { + $this->actions = $actions; + } + + /** + * @return array + */ + public function getAvailableCountries() + { + return $this->availableCountries; + } + + /** + * @param array $availableCountries + */ + public function setAvailableCountries(array $availableCountries) + { + $this->availableCountries = $availableCountries; + } + + /** + * @return array + */ + public function getIntegrations() + { + return $this->integrations; + } + + /** + * @param array $integrations + */ + public function setIntegrations(array $integrations) + { + $this->integrations = $integrations; + } + + /** + * Get configuration as JSON + * + * @return array|string + */ + public function getJsonConfiguration() + { + return Serializer::serialize($this); + } + + /** + * Get configuration as array + * + * @return array|string + */ + public function getArrayConfiguration() + { + return Serializer::serialize($this, Serializer::S_ARRAY); + } +} diff --git a/src/Serializer.php b/src/Serializer.php new file mode 100644 index 0000000..85f46fb --- /dev/null +++ b/src/Serializer.php @@ -0,0 +1,58 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Common; + +use JMS\Serializer\SerializerBuilder; + +/** + * PHP version 7.0 + * + * Serializer class + * + * @package RetailCrm\Common + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Serializer +{ + const S_ARRAY = 0; + const S_JSON = 1; + + /** + * Serialize given object to JSON or Array + * + * @param object $request + * @param int $serialize + * + * @return array|string + */ + public static function serialize($request, $serialize = self::S_JSON) + { + $serialized = null; + $serializer = SerializerBuilder::create()->build(); + + switch ($serialize) { + case self::S_ARRAY: + $serialized = $serializer->toArray($request); + break; + case self::S_JSON: + default: + $serialized = $serializer->serialize($request, 'json'); + break; + } + + return $serialized; + } +} diff --git a/src/Url.php b/src/Url.php new file mode 100644 index 0000000..983c30d --- /dev/null +++ b/src/Url.php @@ -0,0 +1,126 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Common; + +/** + * PHP version 7.0 + * + * Url class + * + * @package RetailCrm\Common + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class Url +{ + const RFC_DEFAULT = 1; + const RFC_CUSTOM = 2; + + private $parts = []; + + public function __toString() + { + return $this->build(); + } + + /** + * Check trailing slash into url + * + * @param string $url + * + * @return string + */ + public static function normalizeUrl($url) + { + if ('/' !== $url[strlen($url) - 1]) { + $url .= '/'; + } + + return $url; + } + + /** + * Build request url + * + * @param string $path + * @param array $parameters + * @param int $rfc + * + * @return string + */ + public function buildUrl($path, $parameters, $rfc = self::RFC_DEFAULT) + { + $url = $path; + + switch ($rfc) { + case self::RFC_CUSTOM: + foreach ($parameters as $key => $value) { + if (is_array($value)) { + foreach ($value as $element) { + $this->add($key, $element); + } + } else { + $this->add($key, $value); + } + } + + $url = sprintf("%s?%s", $url, $this->build()); + break; + case self::RFC_DEFAULT: + default: + $queryString = http_build_query($parameters, '', '&'); + $url = sprintf("%s?%s", $path, $queryString); + break; + } + + return $url; + } + + /** + * Add each key valued element of parameters array + * to internal structure before build + * + * @param string $key + * @param mixed $value + * + * @return void + */ + private function add($key, $value) + { + $this->parts[] = array( + 'key' => $key, + 'value' => $value + ); + } + + /** + * Build query string with same keys if needed + * + * @param string $separator + * @param string $equals + * + * @return string + */ + private function build($separator = '&', $equals = '=') + { + $queryString = array(); + + foreach ($this->parts as $part) { + $queryString[] = urlencode($part['key']) . $equals . urlencode($part['value']); + } + + return implode($separator, $queryString); + } +} diff --git a/tests/Bot/Test/TestCase.php b/tests/Bot/Test/TestCase.php new file mode 100644 index 0000000..52a455c --- /dev/null +++ b/tests/Bot/Test/TestCase.php @@ -0,0 +1,54 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://www.retailcrm.ru/docs/Developers/ApiVersion5 + */ + +namespace RetailCrm\Mg\Bot\Test; + +use PHPUnit\Framework\TestCase as BaseCase; +use RetailCrm\Mg\Bot\Client; + +/** + * Class TestCase + * + * @category RetailCrm + * @package Test + * @author RetailCrm + * @license https://opensource.org/licenses/MIT MIT License + * @link http://www.retailcrm.ru/docs/Developers/ApiVersion5 + */ +class TestCase extends BaseCase +{ + /** + * Return bot api client object + * + * @param string $url (default: null) + * @param string $key (default: null) + * @param bool $debug (default: false) + * + * @return \RetailCrm\Mg\Bot\Client + */ + public static function getApiClient( + $url = null, + $key = null, + $debug = false + ) { + $configUrl = getenv('MG_BOT_URL'); + $configKey = getenv('MG_BOT_KEY'); + $configDbg = getenv('MG_BOT_DBG'); + + return new Client( + $url ?: $configUrl, + $key ?: $configKey, + $debug ?: $configDbg + ); + } +} diff --git a/tests/Bot/Tests/ClientListTest.php b/tests/Bot/Tests/ClientListTest.php new file mode 100644 index 0000000..dea988a --- /dev/null +++ b/tests/Bot/Tests/ClientListTest.php @@ -0,0 +1,178 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Tests; + +use RetailCrm\Mg\Bot\Model\Constants; +use RetailCrm\Mg\Bot\Model\Request; +use RetailCrm\Mg\Bot\Test\TestCase; + +/** + * PHP version 7.0 + * + * Class ClientListTest + * + * @package RetailCrm\Mg\Bot\Tests + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class ClientListTest extends TestCase +{ + + /** + * @group("list") + * @throws \Exception + */ + public function testChannels() + { + $client = self::getApiClient(); + + $request = new Request\ChannelsRequest(); + $request->setActive(true); + $request->setTypes([Constants::CHANNEL_TYPE_FACEBOOK, Constants::CHANNEL_TYPE_INSTAGRAM]); + + $response = $client->channels($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testChats() + { + $client = self::getApiClient(); + + $request = new Request\ChatsRequest(); + $request->setChannelType(Constants::CHANNEL_TYPE_FACEBOOK); + + $response = $client->chats($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testMembers() + { + $client = self::getApiClient(); + + $request = new Request\MembersRequest(); + + $response = $client->members($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testMessages() + { + $client = self::getApiClient(); + + $request = new Request\MessagesRequest(); + $request->setChannelType(Constants::CHANNEL_TYPE_INSTAGRAM); + $request->setType(Constants::MESSAGE_TYPE_TEXT); + + $response = $client->messages($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testCommands() + { + $client = self::getApiClient(); + + $request = new Request\CommandsRequest(); + + $response = $client->commands($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testBots() + { + $client = self::getApiClient(); + + $request = new Request\BotsRequest(); + $request->setActive(1); + $request->setRoles([Constants::BOT_ROLE_RESPONSIBLE]); + + $response = $client->bots($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testUsers() + { + $client = self::getApiClient(); + + $request = new Request\UsersRequest(); + $request->setActive(1); + $request->setOnline(0); + + $response = $client->users($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testDialogs() + { + $client = self::getApiClient(); + + $request = new Request\DialogsRequest(); + $request->setActive(1); + $request->setAssign(1); + + $response = $client->dialogs($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("list") + * @throws \Exception + */ + public function testCustomers() + { + $client = self::getApiClient(); + + $request = new Request\CustomersRequest(); + + $response = $client->customers($request); + + self::assertTrue($response->isSuccessful() == true); + } +} diff --git a/tests/Bot/Tests/CommandsTest.php b/tests/Bot/Tests/CommandsTest.php new file mode 100644 index 0000000..db3c6d3 --- /dev/null +++ b/tests/Bot/Tests/CommandsTest.php @@ -0,0 +1,95 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Tests; + +use Exception; +use InvalidArgumentException; +use RetailCrm\Mg\Bot\Model\Request\CommandEditRequest; +use RetailCrm\Mg\Bot\Test\TestCase; + +/** + * PHP version 7.0 + * + * Class ClientTest + * + * @package RetailCrm\Mg\Bot\Tests + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class CommandsTest extends TestCase +{ + /** + * @group("commands") + * @throws \Exception + */ + public function testCommandEditException() + { + self::expectException(InvalidArgumentException::class); + + $client = self::getApiClient(); + + $request = new CommandEditRequest(); + $request->setDescription("qwerty"); + + $client->commandEdit($request); + } + + /** + * @group("commands") + * @throws \Exception + */ + public function testCommandDeleteException() + { + self::expectException(Exception::class); + + $client = self::getApiClient(); + + $request = "qwerty"; + + $client->commandDelete($request); + } + + /** + * @group("commands") + * @throws \Exception + */ + public function testCommandEdit() + { + $client = self::getApiClient(); + + $request = new CommandEditRequest(); + $request->setBotId(1); + $request->setName("show_payment_types"); + $request->setDescription("Get available payment types"); + + $response = $client->commandEdit($request); + + self::assertTrue($response->isSuccessful() == true); + } + + /** + * @group("commands") + * @depends testCommandEdit + * @throws \Exception + */ + public function testCommandDelete() + { + $client = self::getApiClient(); + + $response = $client->commandDelete("show_payment_types"); + + self::assertTrue($response->isSuccessful() == true); + } +} diff --git a/tests/Bot/Tests/MessagesTest.php b/tests/Bot/Tests/MessagesTest.php new file mode 100644 index 0000000..259304f --- /dev/null +++ b/tests/Bot/Tests/MessagesTest.php @@ -0,0 +1,54 @@ + + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ + +namespace RetailCrm\Mg\Bot\Tests; + +use Exception; +use InvalidArgumentException; +use RetailCrm\Common\Exception\CurlException; +use RetailCrm\Common\Exception\InvalidJsonException; +use RetailCrm\Mg\Bot\Model\Constants; +use RetailCrm\Mg\Bot\Model\Request\CommandEditRequest; +use RetailCrm\Mg\Bot\Model\Request\MessageSendRequest; +use RetailCrm\Mg\Bot\Test\TestCase; + +/** + * PHP version 7.0 + * + * Class MessagesTest + * + * @package RetailCrm\Mg\Bot\Tests + * @author retailCRM + * @license https://opensource.org/licenses/MIT MIT License + * @link http://help.retailcrm.pro/docs/Developers + */ +class MessagesTest extends TestCase +{ + /** + * @group("messages") + * @throws \Exception + */ + public function testMessageSend() + { + $client = self::getApiClient(); + + $request = new MessageSendRequest(); + $request->setChatId(0); + $request->setScope(Constants::MESSAGE_SCOPE_PUBLIC); + $request->setContent("Hello"); + + $request = $client->messageSend($request); + + self::assertEquals($request->getStatusCode(), 400); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..d5251eb --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,15 @@ +add('RetailCrm\\Mg\\Bot\\Test', __DIR__); + +use Symfony\Component\Dotenv\Dotenv; + +$dotenv = new Dotenv(); +$dotenv->load(__DIR__ . '/../.env');