diff --git a/composer.json b/composer.json index b27c163..4b8b165 100644 --- a/composer.json +++ b/composer.json @@ -6,11 +6,10 @@ "php": ">=7.1", "ext-soap": "*", "myclabs/php-enum": "^1.6", - "phpro/soap-client": "^0.7.4" + "guzzlehttp/guzzle": "^6.3" }, "require-dev": { - "phpspec/phpspec": "^4.3", - "zendframework/zend-code": "^3.1.0" + "phpspec/phpspec": "^4.3" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index aaac00c..140af09 100644 --- a/composer.lock +++ b/composer.lock @@ -4,38 +4,47 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8a762ab030f77c2261514284b814a4c7", + "content-hash": "e98f0abafa097f8775189e592353b3c5", "packages": [ { - "name": "doctrine/collections", - "version": "v1.5.0", + "name": "guzzlehttp/guzzle", + "version": "6.3.3", "source": { "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "shasum": "" }, "require": { - "php": "^7.1" + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" }, "require-dev": { - "doctrine/coding-standard": "~0.1@dev", - "phpunit/phpunit": "^5.7" + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "6.3-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -44,34 +53,139 @@ ], "authors": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "array", - "collections", - "iterator" + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" ], - "time": "2017-07-22T10:37:32+00:00" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "myclabs/php-enum", @@ -118,75 +232,31 @@ "time": "2018-05-09T08:09:15+00:00" }, { - "name": "phpro/soap-client", - "version": "0.7.4", + "name": "psr/http-message", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/phpro/soap-client.git", - "reference": "40933fe3d0dcf1f240c4156081f76b495483b370" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpro/soap-client/zipball/40933fe3d0dcf1f240c4156081f76b495483b370", - "reference": "40933fe3d0dcf1f240c4156081f76b495483b370", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { - "doctrine/collections": "~1.3", - "ext-soap": "*", - "ext-xml": "*", - "php": "^7.0", - "psr/log": "^1.0", - "symfony/console": "~2.8|~3.0|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/validator": "~2.8|~3.0|~4.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^6.3.2", - "guzzlehttp/promises": "^1.3.1", - "guzzlehttp/psr7": "^1.4.2", - "jakub-onderka/php-parallel-lint": "^1.0", - "ocramius/package-versions": "^1.1.2", - "ocramius/proxy-manager": "^2.0.2", - "php-http/client-common": "^1.6", - "php-http/discovery": "^1.3", - "php-http/guzzle6-adapter": "^1.1.1", - "php-http/httplug": "^1.1", - "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", - "php-http/mock-client": "^1.0", - "php-vcr/php-vcr": "~1.3.2", - "php-vcr/phpunit-testlistener-vcr": "^3.0", - "phpro/grumphp": "~0.11", - "phpspec/phpspec": "~3.2", - "phpspec/prophecy": "~1.7", - "phpunit/phpunit": "~6.0", - "psr/http-message": "^1.0", - "robrichards/wse-php": "^2.0.2", - "robrichards/xmlseclibs": "^3.0", - "squizlabs/php_codesniffer": "~2.7", - "zendframework/zend-code": "^3.1.0" - }, - "suggest": { - "doctrine/common": "For caching SOAP responses", - "monolog/monolog": "For logging SOAP transactions", - "php-http/client-common": "For gaining control over the HTTP layer", - "php-http/client-implementation": "For gaining control over the HTTP layer", - "php-http/discovery": "For gaining control over the HTTP layer", - "php-http/httplug": "For gaining control over the HTTP layer", - "php-http/message": "For gaining control over the HTTP layer", - "php-http/message-factory": "For gaining control over the HTTP layer", - "psr/http-message": "For gaining control over the HTTP layer", - "robrichards/wse-php": "If you want to use the WSA or WSSE middleware" + "php": ">=5.3.0" }, - "bin": [ - "bin/soap-client" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "psr-0": { - "Phpro\\SoapClient\\": "src/" + "psr-4": { + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -195,42 +265,57 @@ ], "authors": [ { - "name": "Toon Verwerft", - "email": "toon.verwerft@phpro.be" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "A general purpose SoapClient library", + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ - "soap" + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" ], - "time": "2018-06-29T10:25:13+00:00" - }, + "time": "2016-08-06T14:39:51+00:00" + } + ], + "packages-dev": [ { - "name": "psr/log", - "version": "1.0.2", + "name": "doctrine/instantiator", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -239,131 +324,110 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", "keywords": [ - "log", - "psr", - "psr-3" + "constructor", + "instantiate" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { - "name": "symfony/console", - "version": "v4.1.1", + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" + "php": ">=5.5" }, "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-implementation": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "phpunit/phpunit": "^4.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ "MIT" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2018-05-31T10:17:53+00:00" + "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": "symfony/event-dispatcher", - "version": "v4.1.1", + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2391ed210a239868e7256eb6921b1bd83f3087b5", - "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { - "php": "^7.1.3" - }, - "conflict": { - "symfony/dependency-injection": "<3.4" + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" }, "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": "" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -371,49 +435,47 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:57+00:00" + "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": "symfony/filesystem", - "version": "v4.1.1", + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", - "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" + "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": "4.1-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -421,106 +483,98 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2018-05-30T07:26:09+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "name": "phpspec/php-diff", + "version": "v1.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "url": "https://github.com/phpspec/php-diff.git", + "reference": "0464787bfa7cd13576c5a1e318709768798bec6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/phpspec/php-diff/zipball/0464787bfa7cd13576c5a1e318709768798bec6a", + "reference": "0464787bfa7cd13576c5a1e318709768798bec6a", "shasum": "" }, - "require": { - "php": ">=5.3.3" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] + "psr-0": { + "Diff": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Chris Boulton", + "homepage": "http://github.com/chrisboulton" } ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2018-04-30T19:57:29+00:00" + "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", + "time": "2016-04-07T12:29:16+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", + "name": "phpspec/phpspec", + "version": "4.3.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" + "url": "https://github.com/phpspec/phpspec.git", + "reference": "4474f1cb4cf9873996fc07fac6533ab9298eb6fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "url": "https://api.github.com/repos/phpspec/phpspec/zipball/4474f1cb4cf9873996fc07fac6533ab9298eb6fd", + "reference": "4474f1cb4cf9873996fc07fac6533ab9298eb6fd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "doctrine/instantiator": "^1.0.5", + "ext-tokenizer": "*", + "php": "^7.0,<7.3", + "phpspec/php-diff": "^1.0.0", + "phpspec/prophecy": "^1.5", + "sebastian/exporter": "^1.0 || ^2.0 || ^3.0", + "symfony/console": "^3.2 || ^4.0", + "symfony/event-dispatcher": "^3.2 || ^4.0", + "symfony/finder": "^3.2 || ^4.0", + "symfony/process": "^3.2 || ^4.0", + "symfony/yaml": "^3.2 || ^4.0" + }, + "require-dev": { + "behat/behat": "^3.3", + "phpunit/phpunit": "^5.7|^6.0", + "symfony/filesystem": "^3.2 || ^4.0" }, "suggest": { - "ext-mbstring": "For best performance" + "phpspec/nyan-formatters": "Adds Nyan formatters" }, + "bin": [ + "bin/phpspec" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "4.3.x-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] + "psr-0": { + "PhpSpec": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -528,75 +582,67 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Marcello Duarte", + "homepage": "http://marcelloduarte.net/" + }, + { + "name": "Ciaran McNulty", + "homepage": "https://ciaranmcnulty.com/" } ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", + "description": "Specification-oriented BDD framework for PHP 5.6+", + "homepage": "http://phpspec.net/", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "BDD", + "SpecBDD", + "TDD", + "spec", + "specification", + "testing", + "tests" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-07-02T17:43:33+00:00" }, { - "name": "symfony/translation", - "version": "v4.1.1", + "name": "phpspec/prophecy", + "version": "1.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854" + "url": "https://github.com/phpspec/prophecy.git", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b6d8164085ee0b6debcd1b7a131fd6f63bb04854", - "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/yaml": "<3.4" + "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": { - "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/console": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/intl": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "psr-0": { + "Prophecy\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -604,312 +650,315 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" } ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2018-06-22T08:59:39+00:00" + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-04-18T13:57:24+00:00" }, { - "name": "symfony/validator", - "version": "v4.1.1", + "name": "sebastian/comparator", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "f2523bfd8dc5ff648aca55c0f2748674ca4661bb" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/f2523bfd8dc5ff648aca55c0f2748674ca4661bb", - "reference": "f2523bfd8dc5ff648aca55c0f2748674ca4661bb", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation": "~3.4|~4.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/yaml": "<3.4" + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" }, "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/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/yaml": "" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Symfony Validator Component", - "homepage": "https://symfony.com", - "time": "2018-06-19T21:38:16+00:00" - } - ], - "packages-dev": [ + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-07-12T15:12:46+00:00" + }, { - "name": "doctrine/instantiator", - "version": "1.1.0", + "name": "sebastian/diff", + "version": "3.0.1", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", + "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "constructor", - "instantiate" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2018-06-10T07:54:39+00:00" }, { - "name": "guzzlehttp/guzzle", - "version": "6.3.3", + "name": "sebastian/exporter", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.3-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "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": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" + "export", + "exporter" ], - "time": "2018-04-22T15:46:56+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { - "name": "guzzlehttp/promises", - "version": "v1.3.1", + "name": "sebastian/recursion-context", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.5.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" + "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": "guzzlehttp/psr7", - "version": "1.4.2", + "name": "symfony/console", + "version": "v4.1.1", "source": { "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "url": "https://github.com/symfony/console.git", + "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f", + "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" }, - "provide": { - "psr/http-message-implementation": "1.0" + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "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-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" + "Symfony\\Component\\Console\\": "" }, - "files": [ - "src/functions_include.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -918,680 +967,217 @@ ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" - }, - { - "name": "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" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "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" + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-05-31T10:17:53+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "name": "symfony/event-dispatcher", + "version": "v4.1.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2391ed210a239868e7256eb6921b1bd83f3087b5", + "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5", "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": "" + "php": "^7.1.3" }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "conflict": { + "symfony/dependency-injection": "<3.4" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/php-diff", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/php-diff.git", - "reference": "0464787bfa7cd13576c5a1e318709768798bec6a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/php-diff/zipball/0464787bfa7cd13576c5a1e318709768798bec6a", - "reference": "0464787bfa7cd13576c5a1e318709768798bec6a", - "shasum": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Diff": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton" - } - ], - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", - "time": "2016-04-07T12:29:16+00:00" - }, - { - "name": "phpspec/phpspec", - "version": "4.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/phpspec.git", - "reference": "0671a4c63377cad221d2202177853f070f718884" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/0671a4c63377cad221d2202177853f070f718884", - "reference": "0671a4c63377cad221d2202177853f070f718884", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "ext-tokenizer": "*", - "php": "^7.0,<7.3", - "phpspec/php-diff": "^1.0.0", - "phpspec/prophecy": "^1.5", - "sebastian/exporter": "^1.0 || ^2.0 || ^3.0", - "symfony/console": "^3.2 || ^4.0", - "symfony/event-dispatcher": "^3.2 || ^4.0", - "symfony/finder": "^3.2 || ^4.0", - "symfony/process": "^3.2 || ^4.0", - "symfony/yaml": "^3.2 || ^4.0" - }, - "require-dev": { - "behat/behat": "^3.3", - "phpunit/phpunit": "^5.7|^6.0", - "symfony/filesystem": "^3.2 || ^4.0" - }, - "suggest": { - "phpspec/nyan-formatters": "Adds Nyan formatters" - }, - "bin": [ - "bin/phpspec" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "PhpSpec": "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", - "homepage": "http://marcelloduarte.net/" - }, - { - "name": "Ciaran McNulty", - "homepage": "https://ciaranmcnulty.com/" - } - ], - "description": "Specification-oriented BDD framework for PHP 5.6+", - "homepage": "http://phpspec.net/", - "keywords": [ - "BDD", - "SpecBDD", - "TDD", - "spec", - "specification", - "testing", - "tests" - ], - "time": "2017-12-22T11:50:28+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.7.6", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2018-04-18T13:57:24+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "591a30922f54656695e59b1f39501aec513403da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/591a30922f54656695e59b1f39501aec513403da", - "reference": "591a30922f54656695e59b1f39501aec513403da", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-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-06-14T15:05:28+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "366541b989927187c4ca70490a35615d3fef2dce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", - "reference": "366541b989927187c4ca70490a35615d3fef2dce", - "shasum": "" - }, - "require": { - "php": "^7.1" + "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" }, - "require-dev": { - "phpunit/phpunit": "^7.0", - "symfony/process": "^2 || ^3.3 || ^4" + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "time": "2018-06-10T07:54:39+00:00" + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2018-04-06T07:35:57+00:00" }, { - "name": "sebastian/exporter", - "version": "3.1.0", + "name": "symfony/finder", + "version": "v4.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "url": "https://github.com/symfony/finder.git", + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.1-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "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": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "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" + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-06-19T21:38:16+00:00" }, { - "name": "sebastian/recursion-context", - "version": "3.0.0", + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", "shasum": "" }, "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.8-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30T19:57:29+00:00" }, { - "name": "symfony/finder", - "version": "v4.1.1", + "name": "symfony/polyfill-mbstring", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "3296adf6a6454a050679cde90f95350ad604b171" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "1.8-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1600,17 +1186,24 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", - "time": "2018-06-19T21:38:16+00:00" + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" }, { "name": "symfony/process", @@ -1769,113 +1362,6 @@ "validate" ], "time": "2018-01-29T19:49:41+00:00" - }, - { - "name": "zendframework/zend-code", - "version": "3.3.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-code.git", - "reference": "6b1059db5b368db769e4392c6cb6cc139e56640d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-code/zipball/6b1059db5b368db769e4392c6cb6cc139e56640d", - "reference": "6b1059db5b368db769e4392c6cb6cc139e56640d", - "shasum": "" - }, - "require": { - "php": "^7.1", - "zendframework/zend-eventmanager": "^2.6 || ^3.0" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "zendframework/zend-coding-standard": "^1.0.0", - "zendframework/zend-stdlib": "^2.7 || ^3.0" - }, - "suggest": { - "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", - "zendframework/zend-stdlib": "Zend\\Stdlib component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Code\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides facilities to generate arbitrary code using an object oriented interface", - "homepage": "https://github.com/zendframework/zend-code", - "keywords": [ - "code", - "zf2" - ], - "time": "2017-10-20T15:21:32+00:00" - }, - { - "name": "zendframework/zend-eventmanager", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "athletic/athletic": "^0.1", - "container-interop/container-interop": "^1.1.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0" - }, - "suggest": { - "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\EventManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Trigger and listen to events within a PHP application", - "homepage": "https://github.com/zendframework/zend-eventmanager", - "keywords": [ - "event", - "eventmanager", - "events", - "zf2" - ], - "time": "2018-04-25T15:33:34+00:00" } ], "aliases": [], diff --git a/readme.md b/readme.md index d4ce2ea..fff8da4 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,38 @@ # Omniva API +PHP wrapper for courier Omniva integration. + [![SensioLabsInsight](https://insight.sensiolabs.com/projects/8151bcc9-e8d6-4b63-909a-bfe550fee571/mini.png)](https://insight.sensiolabs.com/projects/8151bcc9-e8d6-4b63-909a-bfe550fee571) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nebijokit/omniva/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nebijokit/omniva/?branch=master) ## ToDo -- [x] create model `Service` -- [x] create model `Address` -- [x] implement `Client` labels creation -- [x] implement `Client` download labels - [ ] implement `Client` tracking -- [ ] implement `Client` terminals list +- [x] implement `Client` terminals list + +## Examples + +### Get label + +Returns Label response (`stdClass` object) with encoded PDF & barcode. For Response structure view `getLabel` phpdoc. + +``` +$client = new Client($username, $password); +$client->getLabel($parcel); +``` + + +### Get pickup points list + +This endpoint returns list of pickup points. Pickup point can be Terminal or Post office. +Field _Type_ determines whether field is _Terminal_ (Type: 0) or _Post office_ (Type: 1). + +``` +// username & password is not necessary for pickup points +$client = new Client($username, $password); + +$points = $client->getPickupPoints(); +``` ## Bonus - [ ] add Symfony\Constraint for validation diff --git a/spec/Omniva/AddressSpec.php b/spec/Omniva/AddressSpec.php index 3a3f9dd..b9d1cb0 100644 --- a/spec/Omniva/AddressSpec.php +++ b/spec/Omniva/AddressSpec.php @@ -4,6 +4,7 @@ use PhpSpec\ObjectBehavior; use Omniva\Address; +use Omniva\PickupPoint; class AddressSpec extends ObjectBehavior { @@ -46,14 +47,20 @@ public function it_should_have_country_code() $this->getCountryCode()->shouldReturn($code); } - public function it_should_have_terminal_identifier() + public function it_should_trigger_deprecation_when_setting_terminal() { $identifier = '88822'; + $this->shouldTrigger(E_USER_DEPRECATED)->duringSetTerminal($identifier); + } + + public function it_should_trigger_deprecation_when_getting_terminal() + { + $this->shouldTrigger(E_USER_DEPRECATED)->duringGetTerminal(); + } - $this->hasTerminal()->shouldReturn(false); - $this->setTerminal($identifier)->shouldHaveType(Address::class); - $this->hasTerminal()->shouldReturn(true); - $this->getTerminal()->shouldReturn($identifier); + public function it_should_trigger_deprecation_when_checking_whether_terminal_is_set() + { + $this->shouldTrigger(E_USER_DEPRECATED)->duringHasTerminal(); } public function it_should_have_city() @@ -79,4 +86,10 @@ public function it_should_have_postcode() $this->setPostCode($code)->shouldHaveType(Address::class); $this->getPostCode()->shouldReturn($code); } + + public function it_should_allow_to_set_pickup_point(PickupPoint $point) + { + $this->setPickupPoint($point)->shouldHaveType(Address::class); + $this->getPickupPoint()->shouldReturn($point); + } } diff --git a/spec/Omniva/ClientSpec.php b/spec/Omniva/ClientSpec.php new file mode 100644 index 0000000..2e95b76 --- /dev/null +++ b/spec/Omniva/ClientSpec.php @@ -0,0 +1,25 @@ +beConstructedWith('username', 'password'); + } + + function it_is_initializable() + { + $this->shouldHaveType(Client::class); + } + + public function it_should_return_http_client() + { + $this->getHttpClient()->shouldHaveType(HttpClient::class); + } +} diff --git a/spec/Omniva/PickupPointSpec.php b/spec/Omniva/PickupPointSpec.php new file mode 100644 index 0000000..fa959b1 --- /dev/null +++ b/spec/Omniva/PickupPointSpec.php @@ -0,0 +1,60 @@ +beConstructedWith(00000); + } + + public function it_is_initializable() + { + $this->shouldHaveType(PickupPoint::class); + } + + public function it_should_allow_to_set_type() + { + $this->getType()->shouldReturn(null); + $this->setType(PickupPoint::TYPE_TERMINAL)->shouldHaveType(PickupPoint::class); + + $this->getType()->shouldReturn(PickupPoint::TYPE_TERMINAL); + } + + public function it_should_have_type_post_office() + { + $this->setType(PickupPoint::TYPE_POST_OFFICE); + + $this->isPostOffice()->shouldReturn(true); + } + + public function it_should_have_type_terminal() + { + $this->setType(PickupPoint::TYPE_TERMINAL); + + $this->isTerminal()->shouldReturn(true); + } + + public function it_should_throw_exception_when_type_is_empty() + { + $this->getType()->shouldReturn(null); + + $this->shouldThrow('\RuntimeException')->duringIsPostOffice(); + } + + public function it_should_not_allow_to_set_invalid_type() + { + $this->shouldThrow('\InvalidArgumentException')->duringSetType(2); + } + + public function it_should_allow_to_set_identifier() + { + $id = '88888'; + $this->setIdentifier($id)->shouldHaveType(PickupPoint::class); + $this->getIdentifier()->shouldReturn($id); + } +} diff --git a/src/Address.php b/src/Address.php index 63bb28e..3e788ee 100644 --- a/src/Address.php +++ b/src/Address.php @@ -2,6 +2,8 @@ namespace Omniva; +use Omniva\PickupPoint; + class Address { /** @@ -32,6 +34,8 @@ class Address private $postcode; + private $pickupPoint; + public function setName(string $name): self { $this->name = $name; @@ -83,17 +87,20 @@ public function getCountryCode(): string public function setTerminal(string $terminal): self { + trigger_error('This method will removed 1.0. Use setPickupPoint() instead.', E_USER_DEPRECATED); $this->terminal = $terminal; return $this; } public function hasTerminal(): bool { + trigger_error('This method will removed 1.0. Use hasPickupPoint() instead.', E_USER_DEPRECATED); return is_string($this->terminal); } - public function getTerminal(): string + public function getTerminal(): ?string { + trigger_error('This method will removed 1.0. Use getPickupPoint() instead.', E_USER_DEPRECATED); return $this->terminal; } @@ -129,4 +136,15 @@ public function getPostCode(): string { return $this->postcode; } + + public function setPickupPoint(PickupPoint $point) + { + $this->pickupPoint = $point; + return $this; + } + + public function getPickupPoint(): ?PickupPoint + { + return $this->pickupPoint; + } } diff --git a/src/Client.php b/src/Client.php index 8f8f4f0..94a7b1f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -7,6 +7,9 @@ use SoapVar; use XMLWriter; use stdClass; +use SoapClient; +use GuzzleHttp\Client as HttpClient; +use Omniva\PickupPoint; class Client { @@ -14,22 +17,14 @@ class Client private $password; - private $client; + private $httpClient; + + private $soapClient; public function __construct(string $username, string $password) { $this->username = $username; $this->password = $password; - - $this->client = new \SoapClient( - 'https://edixml.post.ee/epmx/services/messagesService.wsdl', - [ - 'login' => $this->username, - 'password' => $this->password, - 'trace' => true, - 'exceptions' => true - ] - ); } /** @@ -68,8 +63,18 @@ public function createShipment(Parcel $parcel): stdClass $writer->startElement('item'); $receiver = $parcel->getReceiver(); - if ($receiver->hasTerminal()) { - $deliveryServiceCode = Service::TERMINAL(); + + $hasPickupPoint = $receiver->getPickupPoint() instanceof PickupPoint; + $pickupPoint = $receiver->getPickupPoint(); + + if ($hasPickupPoint) { + if ($pickupPoint->isPostOffice()) { + $deliveryServiceCode = Service::POST_OFFICE(); + } else if ($pickupPoint->isTerminal()) { + $deliveryServiceCode = Service::TERMINAL(); + } else { + throw new \RuntimeException('Wrong PickupPoint provided'); + } } else { $deliveryServiceCode = in_array($receiver->getCountryCode(), ['LT', 'LV']) ? Service::COURIER_LT_LV() : Service::COURIER(); } @@ -117,13 +122,15 @@ public function createShipment(Parcel $parcel): stdClass } $writer->startElement('address'); - if ($receiver->hasTerminal()) { - $writer->writeAttribute('offloadPostcode', $receiver->getTerminal()); + + if ($hasPickupPoint) { + $writer->writeAttribute('offloadPostcode', $pickupPoint->getIdentifier()); } else { $writer->writeAttribute('postcode', $receiver->getPostCode()); $writer->writeAttribute('deliverypoint', $receiver->getCity()); $writer->writeAttribute('street', $receiver->getStreet()); } + $writer->writeAttribute('country', $receiver->getCountryCode()); $writer->endElement(); @@ -168,7 +175,7 @@ public function createShipment(Parcel $parcel): stdClass $writer->endElement(); $writer->endElement(); - return $this->client->businessToClientMsg( + return $this->getSoapClient()->businessToClientMsg( new SoapVar($writer->outputMemory(), XSD_ANYXML) ); } @@ -204,8 +211,85 @@ public function getLabel(Parcel $parcel): stdClass $writer->endElement(); $writer->endElement(); - return $this->client->addrcardMsg( + return $this->getSoapClient()->addrcardMsg( new SoapVar($writer->outputMemory(), XSD_ANYXML) ); } + + public function getSoapCLient(): SoapClient + { + if (!$this->soapClient instanceof SoapClient) { + $this->soapClient = new SoapClient( + 'https://edixml.post.ee/epmx/services/messagesService.wsdl', + [ + 'login' => $this->username, + 'password' => $this->password, + 'trace' => true, + 'exceptions' => true + ] + ); + } + + return $this->soapClient; + } + + public function getHttpClient(): HttpClient + { + if (!$this->httpClient instanceof HttpClient) { + $this->httpClient = new HttpClient(); + } + + return $this->httpClient; + } + + /** + * multidimension array with item structure: + * + * array(25) { + * [0]=> string(6) "ZIP" + * [1]=> string(4) "NAME" + * [2]=> string(4) "TYPE" + * [3]=> string(7) "A0_NAME" + * [4]=> string(7) "A1_NAME" + * [5]=> string(7) "A2_NAME" + * [6]=> string(7) "A3_NAME" + * [7]=> string(7) "A4_NAME" + * [8]=> string(7) "A5_NAME" + * [9]=> string(7) "A6_NAME" + * [10]=> string(7) "A7_NAME" + * [11]=> string(7) "A8_NAME" + * [12]=> string(12) "X_COORDINATE" + * [13]=> string(12) "Y_COORDINATE" + * [14]=> string(13) "SERVICE_HOURS" + * [15]=> string(18) "TEMP_SERVICE_HOURS" + * [16]=> string(24) "TEMP_SERVICE_HOURS_UNTIL" + * [17]=> string(20) "TEMP_SERVICE_HOURS_2" + * [18]=> string(26) "TEMP_SERVICE_HOURS_2_UNTIL" + * [19]=> string(11) "comment_est" + * [20]=> string(11) "comment_eng" + * [21]=> string(11) "comment_rus" + * [22]=> string(11) "comment_lav" + * [23]=> string(11) "comment_lit" + * [24]=> string(8) "MODIFIED" + * } + */ + public function getPickupPoints(): array + { + $response = $this->getHttpClient()->request('GET', 'https://www.omniva.ee/locations.csv'); + + $content = (string)$response->getBody(); + + $pickupPoints = []; + $file = fopen('php://temp','r+'); + fwrite($file, $content); + rewind($file); //rewind to process CSV + while (($row = fgetcsv($file, 0, ';')) !== FALSE) { + $pickupPoints[] = $row; + } + + // remove first item because it has only titles + unset($pickupPoints[0]); + + return $pickupPoints; + } } diff --git a/src/PickupPoint.php b/src/PickupPoint.php new file mode 100644 index 0000000..1f43097 --- /dev/null +++ b/src/PickupPoint.php @@ -0,0 +1,62 @@ +identifier = $identifier; + } + + public function setIdentifier(string $identifier): self + { + $this->identifier = $identifier; + return $this; + } + + public function getIdentifier(): string + { + return $this->identifier; + } + + public function setType(int $type): self + { + if (!in_array($type, [self::TYPE_TERMINAL, self::TYPE_POST_OFFICE])) { + throw new \InvalidArgumentException('Unsupported type'); + } + + $this->type = $type; + return $this; + } + + public function getType(): ?int + { + return $this->type; + } + + public function isPostOffice(): bool + { + $this->guardAgainstEmptyType(); + return $this->getType() === self::TYPE_POST_OFFICE; + } + + public function isTerminal(): bool + { + $this->guardAgainstEmptyType(); + return $this->getType() === self::TYPE_TERMINAL; + } + + private function guardAgainstEmptyType(): void + { + if ($this->getType() === null) { + throw new \RuntimeException('No type has been provided'); + } + } +} diff --git a/src/Service.php b/src/Service.php index 7414901..9f2e883 100644 --- a/src/Service.php +++ b/src/Service.php @@ -4,12 +4,19 @@ use MyCLabs\Enum\Enum; +/** + * @method static Service TERMINAL() + * @method static Service COURIER() + * @method static Service COURIER_LT_LV() + * @method static Service POST_OFFICE() + */ class Service extends Enum { private const SMS = 'ST'; private const EMAIL = 'SF'; private const COD = 'BP'; private const TERMINAL = 'PP'; + private const POST_OFFICE = 'CD'; private const COURIER = 'QP'; private const COURIER_LT_LV = 'QH'; }