From ae3df9e3af44caa9d572993fda3bb5531bde94a1 Mon Sep 17 00:00:00 2001 From: Mike van Diepen Date: Tue, 23 Nov 2021 12:14:16 +0100 Subject: [PATCH 1/3] Updated the package to v3.0-beta --- CHANGELOG.md | 34 + composer.json | 12 +- composer.lock | 2710 +++++++++++++++++ phpunit.xml | 43 +- readme.md | 44 +- src/Client.php | 186 +- src/Endpoints/CertificatesEndpoint.php | 25 +- src/Endpoints/InvoicesEndpoint.php | 23 +- src/Endpoints/RequestsEndpoint.php | 82 +- src/Endpoints/SupportEndpoint.php | 17 +- src/Exceptions/XolphinRequestException.php | 32 +- src/Helpers/CertificateDownloadTypes.php | 3 +- src/Helpers/DCVTypes.php | 2 +- src/Helpers/InvoiceDownloadTypes.php | 2 +- src/Helpers/RequestLanguage.php | 4 +- src/Requests/CertificateRequest.php | 212 +- .../Contracts/ApiRequestInterface.php | 15 + src/Requests/DCVDomain.php | 14 +- src/Requests/ReissueRequest.php | 179 +- src/Requests/RenewRequest.php | 201 +- src/Requests/RequestDCV.php | 26 - src/Requests/RequestEERequest.php | 51 +- src/Responses/Base.php | 28 +- src/Responses/CSR.php | 25 +- src/Responses/Certificate.php | 23 +- src/Responses/Certificates.php | 4 +- src/Responses/Invoice.php | 24 +- src/Responses/Invoices.php | 4 +- src/Responses/Note.php | 22 +- src/Responses/Notes.php | 7 +- src/Responses/Product.php | 25 +- src/Responses/ProductPrice.php | 13 +- src/Responses/Products.php | 4 +- src/Responses/Request.php | 48 +- src/Responses/RequestEE.php | 14 +- src/Responses/RequestValidation.php | 12 +- src/Responses/RequestValidationDomain.php | 32 +- src/Responses/Requests.php | 4 +- src/Responses/SSLCheck.php | 28 +- src/Responses/ValidationCall.php | 8 +- src/Responses/ValidationCalls.php | 6 +- tests/Endpoint/CertificateTest.php | 3 +- tests/Endpoint/InvoiceTest.php | 3 +- tests/Endpoint/RequestTest.php | 25 +- tests/Endpoint/SupportTest.php | 3 +- tests/Requests/CertificateRequestTest.php | 140 + tests/Requests/ReissueRequestTest.php | 129 + tests/Requests/RenewRequestTest.php | 133 + tests/Requests/RequestEERequestTest.php | 77 + tests/TestCase.php | 5 +- 50 files changed, 4051 insertions(+), 715 deletions(-) create mode 100644 composer.lock create mode 100644 src/Requests/Contracts/ApiRequestInterface.php delete mode 100644 src/Requests/RequestDCV.php create mode 100644 tests/Requests/CertificateRequestTest.php create mode 100644 tests/Requests/ReissueRequestTest.php create mode 100644 tests/Requests/RenewRequestTest.php create mode 100644 tests/Requests/RequestEERequestTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 7073c58..bab13b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,35 @@ # Changelog + All notable changes to the wrapper will be documented in this file. +## [3.0.0] +### Updated +- Dropped support for all versions below PHP 7.4 +- Some minor code-style changes +- Made class properties typed and worked on type consistency +- Updated guzzle from `6.x|7.x` to `^9` +- Minor changes in the readme +- Updated the phpunit.xml configuration file +### Added +- Added support for PHP 8.0 +- Added the `disableFreeSan` field for requests. +- Added an interface for the requests +- Added tests for the ApiRequests +### Removed +- Dropped support for all versions below PHP 7.4 +- Removed functions previously marked deprecated +- Removed deprecated RequestDCV class + ## [2.0.1] + ### Updated + - Returntype of getMessage method (issue #18) ## [2.0.0] + ### Updated + - Support for PHP upgraded to >= 7.2 - Support for PHP 5.6 is now on deprecated. Latest version supporting this is 1.8.4 - Refactored UnitTests for compatibility with PHPUnit 8 @@ -14,35 +37,46 @@ All notable changes to the wrapper will be documented in this file. - Lowered Endpoint class creation count ($client->certificate()->... is now $client->certificates->...) ### Added + - Created seperate namespace for Helpers that return API Strings ## [1.8.3] + ### Added + - Added support for SSLCheck - Added support for Invoices - Added support for scheduling validation calls ### Updated + - Updated Client with remaining request count - Added sa_email and referenceOrderNr to Request (Pull request #12) - Deprecated sendComodoSAEmail, replaced by sendSectigoSAEmail ## [1.6.2] + ### Updated + - Made the request notes visible in the request endpoint ## [1.6.1] + ### Updated + - Error handling in Client (pull request #5) - Correct extra domain and price information for MDC in support/products ## [1.6.0] + ### Added + - Compatability with Xolphin REST Api v1.6.0 - Support for the new Comodo DCV method - Supports the uniqueValueDcv (optional) to send an own unique DCV token - Compatability with Encryption Everywhere ### Updated + - Better error handling - Updated markup of the code diff --git a/composer.json b/composer.json index 4d875a5..6a5feeb 100644 --- a/composer.json +++ b/composer.json @@ -19,18 +19,22 @@ { "name": "Bart van Kalmthout", "email": "bart@xolphin.nl" + }, + { + "name": "Mike van Diepen", + "email": "mike@xolphin.nl" } ], "support": { "email": "api@xolphin.com" }, "require": { - "php": ">=7.2.0", - "guzzlehttp/guzzle": "~6|^7.0", - "ext-json": "*" + "php": ">=7.4|8.0", + "ext-json": "*", + "guzzlehttp/guzzle": "^7.4" }, "require-dev": { - "phpunit/phpunit": "~8" + "phpunit/phpunit": "9.5.*" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..141a52c --- /dev/null +++ b/composer.lock @@ -0,0 +1,2710 @@ +{ + "_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": "c608b3c86636dd55b7f64d7d783a0771", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "7.4.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94", + "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2021-10-18T09:52:00+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-06T17:43:30+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.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 interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+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" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.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": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-23T23:28:01+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "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": "https://ocramius.github.io/" + } + ], + "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" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "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" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-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" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1" + }, + "time": "2021-11-03T20:52:16+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "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)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.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", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.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" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.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": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + }, + "time": "2021-10-02T14:08:47+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.14.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "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" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" + }, + "time": "2021-09-10T09:02:12+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", + "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.9" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-19T15:21:02+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-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": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-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": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:38:51+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-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/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "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": "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", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-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": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "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": "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", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.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", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-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" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.4|8.0", + "ext-json": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/phpunit.xml b/phpunit.xml index 776a885..a2e224f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,26 +1,19 @@ - - - - ./tests/ - - - - - src - - - - - - - - - \ No newline at end of file + + + + src + + + + + ./tests/ + + + + + + + + + diff --git a/readme.md b/readme.md index 16bde74..1d682a2 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,14 @@ # Xolphin API wrapper for PHP -xolphin-php-api is a library which allows quick integration of the [Xolphin REST API](https://api.xolphin.com) in PHP to automated ordering, issuance and installation of SSL Certificates. +xolphin-php-api is a library which allows quick integration of the [Xolphin REST API](https://api.xolphin.com) in PHP to +automated ordering, issuance and installation of SSL Certificates. ## About Xolphin -[Xolphin](https://www.xolphin.nl/) is the largest supplier of [SSL Certificates](https://www.sslcertificaten.nl) and [Digital Signatures](https://www.digitalehandtekeningen.nl) in the Netherlands. Xolphin has a professional team providing reliable support and rapid issuance of SSL Certificates at an affordable price from industry leading brands such as Sectigo, GeoTrust, GlobalSign, Thawte and Symantec. + +[Xolphin](https://www.xolphin.nl/) is the largest supplier of [SSL Certificates](https://www.sslcertificaten.nl) +and [Digital Signatures](https://www.digitalehandtekeningen.nl) in the Netherlands. Xolphin has a professional team +providing reliable support and rapid issuance of SSL Certificates at an affordable price from industry leading brands +such as Sectigo, GeoTrust, GlobalSign, Thawte and Symantec. ## Library installation @@ -20,26 +25,34 @@ composer update xolphin/xolphin-api-php ``` ### Upgrade guide from v1.8.3 to v2.x + Update your `xolphin/xolphin-api-php` dependency to `^2.0` in your `composer.json` file. #### Renamed classes + All endpoint classes have been renamed to a more generic name `Endpoint`. You should update your usages. #### Calling Endpoint classes -All endpoint classes are started during startup -They can be called using `$client->certificates->all()` instead of `$client->certificate()->all()`. + +All endpoint classes are started during startup They can be called using `$client->certificates->all()` instead +of `$client->certificate()->all()`. #### Using Helpers instead of strings + In version 2.0.0 we introduced Helper classes. These classes contain constants of all static string variables (enums). -Use these constants instead of a string, because we will alter these constants whenever we change the corresponding value in the API. +Use these constants instead of a string, because we will alter these constants whenever we change the corresponding +value in the API. For instance, when creating a DCV for a domain: + ```php $dcvDomain = new Xolphin\Requests\DCVDomain('someDomain', Xolphin\Helpers\DCVTypes::EMAIL_VALIDATION, 'someemail@address.com'); ``` #### Certificate download() method returns string -The method `download()` on the class `CertificatesEndpoint` now returns the certificate string instead of the `GuzzlestreamInterface`. + +The method `download()` on the class `CertificatesEndpoint` now returns the certificate string instead of +the `GuzzlestreamInterface`. ## Usage @@ -56,15 +69,17 @@ $client = new Xolphin\Client('', ''); ### Rate Limiting #### Current limit + ```php $limit = $client->getLimit(); -echo $limit . "\n"; +echo $limit . PHP_EOL; ``` #### Requests remaining for limit + ```php $requestsRemaining = $client->getRequestsRemaining(); -echo $requestsRemaining . "\n"; +echo $requestsRemaining . PHP_EOL; ``` ### Requests @@ -74,7 +89,7 @@ echo $requestsRemaining . "\n"; ```php $requests = $client->requests->all(); foreach($requests as $request) { - echo $request->id . "\n"; + echo $request->id . PHP_EOL; } ``` @@ -136,7 +151,7 @@ $client->certificates->renew(, $renew); #### Create a note ```php -$result = $client->requests->sendNote(1234,'My message'); +$result = $client->requests->sendNote(1234, 'My message'); ``` #### Get list of notes @@ -156,13 +171,14 @@ $client->requests->sendSectigoSAEmail(1234, 'mail@example.com', RequestLanguage: ``` #### Request an "Encryption Everywhere" certificate + ```php $request = $this->_client->requests->createEE(); -$request->setCsr(); +$request->setCsr(''); $request->setApproverEmail('email@example.com'); $request->setApproverFirstName('FirstName'); $request->setApproverLastName('SecondName'); -$request->setApproverPhone(+12345678901); +$request->setApproverPhone('+12345678901'); $request->setDcvType(DCVTypes::FILE_VALIDATION); // if you just want to validate $request->setValidate(true); @@ -196,7 +212,7 @@ file_put_contents('cert.crt', $cert); ```php $products = $client->support->products(); foreach($products as $product) { - echo $product->id . "\n"; + echo $product->id . PHP_EOL; } ``` @@ -214,7 +230,7 @@ echo $csr->type; ```php $invoices = $client->invoices->all(); foreach($invoices as $invoice) { - echo $invoice->id . ' ' . $invoice->invoiceNr . ' ' . $invoice->amount . "\n"; + echo $invoice->id . ' ' . $invoice->invoiceNr . ' ' . $invoice->amount . PHP_EOL; } ``` diff --git a/src/Client.php b/src/Client.php index 9e85f06..58d8f85 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,7 +1,10 @@ username = $username; $this->password = $password; @@ -74,17 +68,20 @@ function __construct($username, $password, $test = false) 'Accept' => 'application/json', 'User-Agent' => 'xolphin-api-php/' . Client::VERSION ] + ]; + if (getenv('TEST_PROXY') !== false) { $options['proxy'] = getenv('TEST_PROXY'); $options['verify'] = false; } + $this->guzzle = new \GuzzleHttp\Client($options); $this->initializeEndpoints(); } - public function initializeEndpoints() + public function initializeEndpoints(): void { $this->certificates = new CertificatesEndpoint($this); $this->invoices = new InvoicesEndpoint($this); @@ -92,46 +89,10 @@ public function initializeEndpoints() $this->support = new SupportEndpoint($this); } - /** - * @return SupportEndpoint - * @deprecated Use $client->support instead - */ - public function support() - { - return $this->support; - } - - /** - * @return InvoicesEndpoint - * @deprecated Use $client->invoices instead - */ - public function invoice() - { - return $this->invoices; - } - - /** - * @return CertificatesEndpoint - * @deprecated Use $client->certificates instead - */ - public function certificate() - { - return $this->certificates; - } - - /** - * @return RequestsEndpoint - * @deprecated Use $client->requests instead - */ - public function request() - { - return $this->requests; - } - /** * @return int */ - public function getLimit() + public function getLimit(): int { return $this->limit; } @@ -139,77 +100,94 @@ public function getLimit() /** * @return int */ - public function getRequestsRemaining() + public function getRequestsRemaining(): int { return $this->requestsRemaining; } - /** - * @param $method + * @param string $uri * @param array $data * @return mixed + * @throws GuzzleException * @throws XolphinRequestException */ - public function get($method, $data = []) + public function get(string $uri, array $data = []) { try { - $result = $this->guzzle->get($method, ['query' => $data]); - $this->updateLimitAndRemaining($result->getHeader('X-RateLimit-Limit')[0], - $result->getHeader('X-RateLimit-Remaining')[0]); - return json_decode($result->getBody()); + $result = $this->guzzle->get($uri, ['query' => $data]); + + $this->updateLimitAndRemaining( + (int) $result->getHeader('X-RateLimit-Limit')[0], + (int) $result->getHeader('X-RateLimit-Remaining')[0] + ); + + return json_decode( + $result->getBody()->getContents() + ); + } catch (RequestException $e) { throw XolphinRequestException::createFromRequestException($e); } } - /** - * @param $method + * @param string $uri * @param array $data * @return mixed - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ - public function post($method, $data = []) + public function post(string $uri, array $data = []) { try { - $mp = []; - foreach ($data as $k => $v) { - if ($k == 'document') { - $mp[] = [ - 'name' => $k, - 'contents' => $v, + $multipart = []; + + foreach ($data as $name => $content) { + if ($name === 'document') { + $multipart[] = [ + 'name' => $name, + 'contents' => $content, 'filename' => 'document.pdf' ]; } else { - $mp[] = [ - 'name' => $k, - 'contents' => (string)$v + $multipart[] = [ + 'name' => $name, + 'contents' => (string) $content ]; } } - $result = $this->guzzle->post($method, ['multipart' => $mp]); - $this->updateLimitAndRemaining($result->getHeader('X-RateLimit-Limit')[0], - $result->getHeader('X-RateLimit-Remaining')[0]); - return json_decode($result->getBody()); + $result = $this->guzzle->post($uri, ['multipart' => $multipart]); + + $this->updateLimitAndRemaining( + (int) $result->getHeader('X-RateLimit-Limit')[0], + (int) $result->getHeader('X-RateLimit-Remaining')[0] + ); + + return json_decode( + $result->getBody()->getContents() + ); } catch (RequestException $e) { throw XolphinRequestException::createFromRequestException($e); } } /** - * @param $method + * @param string $uri * @param array $data * @return StreamInterface - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ - public function download($method, $data = []) + public function download(string $uri, array $data = []): StreamInterface { try { - $result = $this->guzzle->get($method, ['query' => $data]); - $this->updateLimitAndRemaining($result->getHeader('X-RateLimit-Limit')[0], - $result->getHeader('X-RateLimit-Remaining')[0]); + $result = $this->guzzle->get($uri, ['query' => $data]); + + $this->updateLimitAndRemaining( + (int) $result->getHeader('X-RateLimit-Limit')[0], + (int) $result->getHeader('X-RateLimit-Remaining')[0] + ); + return $result->getBody(); } catch (RequestException $e) { throw XolphinRequestException::createFromRequestException($e); @@ -217,10 +195,10 @@ public function download($method, $data = []) } /** - * @param $limit - * @param $remaining + * @param int $limit + * @param int $remaining */ - public function updateLimitAndRemaining($limit, $remaining) + public function updateLimitAndRemaining(int $limit, int $remaining): void { $this->limit = $limit; $this->requestsRemaining = $remaining; diff --git a/src/Endpoints/CertificatesEndpoint.php b/src/Endpoints/CertificatesEndpoint.php index b92bd74..adc775f 100644 --- a/src/Endpoints/CertificatesEndpoint.php +++ b/src/Endpoints/CertificatesEndpoint.php @@ -1,8 +1,11 @@ client = $client; } - /** * @return array * @throws XolphinRequestException - * @throws Exception + * @throws Exception|GuzzleException */ public function all(): array { @@ -53,26 +55,24 @@ public function all(): array return $certificates; } - /** * @param int $id * @return Certificate * @throws XolphinRequestException - * @throws Exception + * @throws Exception|GuzzleException */ public function get(int $id): Certificate { return new Certificate($this->client->get('certificates/' . $id)); } - /** * @param int $id * @param string $format * @return string - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ - public function download(int $id, string $format = 'CRT') + public function download(int $id, string $format = 'CRT'): string { $response = $this->client->download('certificates/' . $id . '/download', [ 'format' => $format @@ -81,39 +81,36 @@ public function download(int $id, string $format = 'CRT') return $response->getContents(); } - /** * @param int $id * @param ReissueRequest $reissue * @return Request * @throws XolphinRequestException - * @throws Exception + * @throws Exception|GuzzleException */ public function reissue(int $id, ReissueRequest $reissue): Request { return new Request($this->client->post('certificates/' . $id . '/reissue', $reissue->getApiRequestBody())); } - /** * @param int $id * @param RenewRequest $renew * @return Request * @throws XolphinRequestException - * @throws Exception + * @throws Exception|GuzzleException */ public function renew(int $id, RenewRequest $renew): Request { return new Request($this->client->post('certificates/' . $id . '/renew', $renew->getApiRequestBody())); } - /** * @param int $id * @param string $reason * @param bool $revoke * @return Base - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ public function cancel(int $id, string $reason, bool $revoke = false): Base { diff --git a/src/Endpoints/InvoicesEndpoint.php b/src/Endpoints/InvoicesEndpoint.php index 58ede30..b2b8e2d 100644 --- a/src/Endpoints/InvoicesEndpoint.php +++ b/src/Endpoints/InvoicesEndpoint.php @@ -1,7 +1,11 @@ client = $client; } - /** * @return array * @throws XolphinRequestException + * @throws Exception|GuzzleException */ public function all(): array { @@ -48,11 +51,11 @@ public function all(): array return $invoices; } - /** * @param int $id * @return Invoice * @throws XolphinRequestException + * @throws Exception|GuzzleException */ public function get(int $id): Invoice { @@ -63,16 +66,14 @@ public function get(int $id): Invoice * @param int $id * @param string $format * @return string - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ public function download(int $id, string $format = 'PDF'): string { - $response = $this->client->download( - 'invoices/' . $id . '/download', - [ - 'type' => $format, - ] - ); + $response = $this->client->download('invoices/' . $id . '/download', [ + 'type' => $format, + ]); + return $response->getContents(); } } \ No newline at end of file diff --git a/src/Endpoints/RequestsEndpoint.php b/src/Endpoints/RequestsEndpoint.php index 9b6a081..fa0912c 100644 --- a/src/Endpoints/RequestsEndpoint.php +++ b/src/Endpoints/RequestsEndpoint.php @@ -1,8 +1,12 @@ client = $client; } - /** * @return array * @throws XolphinRequestException + * @throws Exception|GuzzleException */ public function all(): array { @@ -54,7 +58,6 @@ public function all(): array return $requests; } - /** * @param int $product * @param int $years @@ -67,18 +70,17 @@ public function create(int $product, int $years, string $csr, string $dcvType): return new CertificateRequest($product, $years, $csr, $dcvType); } - /** * @param CertificateRequest $request * @return Request * @throws XolphinRequestException + * @throws Exception|GuzzleException */ public function send(CertificateRequest $request): Request { return new Request($this->client->post('requests', $request->getApiRequestBody())); } - /** * @return RequestEERequest */ @@ -87,69 +89,65 @@ public function createEE(): RequestEERequest return new RequestEERequest(); } - /** * @param RequestEERequest $request * @return RequestEE - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ public function sendEE(RequestEERequest $request): RequestEE { return new RequestEE($this->client->post('requests/ee', $request->getApiRequestBody())); } - /** * @param int $id * @return Request * @throws XolphinRequestException + * @throws Exception|GuzzleException */ public function get(int $id): Request { return new Request($this->client->get('requests/' . $id)); } - /** * @param int $id * @param string $document - * @param string $description + * @param string|null $description * @return Base - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ - public function upload(int $id, string $document, string $description = ''): Base + public function upload(int $id, string $document, ?string $description = null): Base { return new Base($this->client->post('requests/' . $id . '/upload-document', [ 'document' => $document, - 'description' => $description + 'description' => $description ?? '' ])); } - /** * @param int $id * @param string $domain * @param string $dcvType - * @param string $email + * @param string|null $email * @return Base - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ - public function retryDCV(int $id, string $domain, string $dcvType, string $email = ''): Base + public function retryDCV(int $id, string $domain, string $dcvType, ?string $email = null): Base { return new Base($this->client->post('requests/' . $id . '/retry-dcv', [ 'domain' => $domain, 'dcvType' => $dcvType, - 'email' => $email + 'email' => $email ?? '' ])); } - /** * @param int $id * @param DateTime $dateTime * @param string $timezone * @return Base - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ public function scheduleValidationCall(int $id, DateTime $dateTime, string $timezone = 'Europe/Amsterdam'): Base { @@ -160,11 +158,11 @@ public function scheduleValidationCall(int $id, DateTime $dateTime, string $time ])); } - /** * @param int $id * @return array * @throws XolphinRequestException + * @throws Exception|GuzzleException */ public function getScheduleValidationCall(int $id): array { @@ -176,15 +174,14 @@ public function getScheduleValidationCall(int $id): array return $list; } - /** * @param int $id * @return array * @throws XolphinRequestException + * @throws Exception|GuzzleException */ public function getNotes(int $id): array { - $messages = []; $result = new Notes($this->client->get('requests/' . $id . '/notes')); @@ -200,50 +197,41 @@ public function getNotes(int $id): array * @param string $note * @param bool $endCustomer * @return Base - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ public function sendNote(int $id, string $note, bool $endCustomer = false): Base { - return new Base($this->client->post('requests/' . $id . '/notes', - [ - 'message' => $note, - 'endCustomer' => $endCustomer - ]) - ); + return new Base($this->client->post('requests/' . $id . '/notes', [ + 'message' => $note, + 'endCustomer' => $endCustomer + ])); } - /** * @param int $id * @param string $to * @param string|null $language * @return Base - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ - public function sendSectigoSAEmail(int $id, string $to, string $language = null): Base + public function sendSectigoSAEmail(int $id, string $to, ?string $language = null): Base { - return new Base( - $this->client->post( - 'requests/' . $id . '/sa', - [ - 'sa_email' => $to, - 'language' => $language - ] - ) - ); + return new Base($this->client->post('requests/' . $id . '/sa', [ + 'sa_email' => $to, + 'language' => $language ?? '' + ])); } - /** * @param int $id - * @param string $reason + * @param string|null $reason * @return Base - * @throws XolphinRequestException + * @throws XolphinRequestException|GuzzleException */ - public function cancel(int $id, string $reason = ''): Base + public function cancel(int $id, ?string $reason = null): Base { return new Base($this->client->post('requests/' . $id . '/cancel', [ - 'reason' => $reason + 'reason' => $reason ?? '' ])); } } \ No newline at end of file diff --git a/src/Endpoints/SupportEndpoint.php b/src/Endpoints/SupportEndpoint.php index 4dbed25..aa7e8b0 100644 --- a/src/Endpoints/SupportEndpoint.php +++ b/src/Endpoints/SupportEndpoint.php @@ -1,12 +1,15 @@ getResponse()->getBody()); - - if ($data == null) { - return new self($requestException->getResponse()->getBody(), null, $requestException); - } - - if (!isset($data->message)) { - return new self($requestException->getMessage(), $requestException->getCode()); + $message = null; + $code = null; + $errors = null; + + if ($requestException->getResponse() !== null && $requestException->getResponse()->getBody() !== null) { + $data = json_decode( + $requestException->getResponse()->getBody()->getContents() + ); + + $message = !empty($data->message) ? $data->message : null; + $errors = !empty($data->errors) ? $data->errors : null; + $code = $requestException->getCode() ?? null; } - $customException = new self($data->message, $requestException->getCode(), $requestException); - $customException->errors = (isset($data->errors)) ? $data->errors : null; + $exception = new self($message ?? 'Unknown exception', $code ?? 0, $requestException); + $exception->errors = $errors; - return $customException; + return $exception; } } \ No newline at end of file diff --git a/src/Helpers/CertificateDownloadTypes.php b/src/Helpers/CertificateDownloadTypes.php index b7add24..5bac572 100644 --- a/src/Helpers/CertificateDownloadTypes.php +++ b/src/Helpers/CertificateDownloadTypes.php @@ -1,9 +1,9 @@ dcvType = $dcvType; } - /** - * @return array - */ - public function getApiRequestBody(): array - { - $result = []; - - $result['product'] = $this->productId; - $result['years'] = $this->years; - $result['csr'] = $this->csr; - $result['dcvType'] = $this->dcvType; - - if (!empty($this->language)) { - $result['language'] = $this->language; - } - if (!empty($this->subjectAlternativeNames)) { - $result['subjectAlternativeNames'] = implode(',', $this->subjectAlternativeNames); - } - if (!empty($this->dcv)) { - $result['dcv'] = json_encode($this->dcv); - } - if (!empty($this->company)) { - $result['company'] = $this->company; - } - if (!empty($this->department)) { - $result['department'] = $this->department; - } - if (!empty($this->address)) { - $result['address'] = $this->address; - } - if (!empty($this->zipcode)) { - $result['zipcode'] = $this->zipcode; - } - if (!empty($this->city)) { - $result['city'] = $this->city; - } - if (!empty($this->approverFirstName)) { - $result['approverFirstName'] = $this->approverFirstName; - } - if (!empty($this->approverLastName)) { - $result['approverLastName'] = $this->approverLastName; - } - if (!empty($this->approverEmail)) { - $result['approverEmail'] = $this->approverEmail; - } - if (!empty($this->approverPhone)) { - $result['approverPhone'] = $this->approverPhone; - } - if (!empty($this->kvk)) { - $result['kvk'] = $this->kvk; - } - if (!empty($this->reference)) { - $result['reference'] = $this->reference; - } - if (!empty($this->referenceOrderNr)) { - $result['referenceOrderNr'] = $this->referenceOrderNr; - } - if (!empty($this->sa_email)) { - $result['sa_email'] = $this->sa_email; - } - if (!is_null($this->uniqueValueDcv)) { - $result['uniqueValueDcv'] = $this->uniqueValueDcv; - } - - return $result; - } - /** * @return string[] */ @@ -438,9 +378,9 @@ public function setLanguage(string $lang): CertificateRequest } /** - * @return string + * @return string|null */ - public function getUniqueValueDcv(): string + public function getUniqueValueDcv(): ?string { return $this->uniqueValueDcv; } @@ -454,4 +394,92 @@ public function setUniqueValueDcv(string $uniqueValue): CertificateRequest $this->uniqueValueDcv = $uniqueValue; return $this; } + + /** + * @return bool + */ + public function getDisableFreeSan(): bool + { + return $this->disableFreeSan; + } + + /** + * @param bool $disableFreeSan + * @return CertificateRequest + */ + public function setDisableFreeSan(bool $disableFreeSan): CertificateRequest + { + $this->disableFreeSan = $disableFreeSan; + return $this; + } + + /** + * @return array + */ + public function getApiRequestBody(): array + { + $result = []; + + $result['product'] = $this->productId; + $result['years'] = $this->years; + $result['csr'] = $this->csr; + $result['dcvType'] = $this->dcvType; + + if (!empty($this->language)) { + $result['language'] = $this->language; + } + if (!empty($this->subjectAlternativeNames)) { + $result['subjectAlternativeNames'] = implode(',', $this->subjectAlternativeNames); + } + if (!empty($this->dcv)) { + $result['dcv'] = json_encode($this->dcv); + } + if (!empty($this->company)) { + $result['company'] = $this->company; + } + if (!empty($this->department)) { + $result['department'] = $this->department; + } + if (!empty($this->address)) { + $result['address'] = $this->address; + } + if (!empty($this->zipcode)) { + $result['zipcode'] = $this->zipcode; + } + if (!empty($this->city)) { + $result['city'] = $this->city; + } + if (!empty($this->approverFirstName)) { + $result['approverFirstName'] = $this->approverFirstName; + } + if (!empty($this->approverLastName)) { + $result['approverLastName'] = $this->approverLastName; + } + if (!empty($this->approverEmail)) { + $result['approverEmail'] = $this->approverEmail; + } + if (!empty($this->approverPhone)) { + $result['approverPhone'] = $this->approverPhone; + } + if (!empty($this->kvk)) { + $result['kvk'] = $this->kvk; + } + if (!empty($this->reference)) { + $result['reference'] = $this->reference; + } + if (!empty($this->referenceOrderNr)) { + $result['referenceOrderNr'] = $this->referenceOrderNr; + } + if (!empty($this->sa_email)) { + $result['sa_email'] = $this->sa_email; + } + if (!empty($this->uniqueValueDcv)) { + $result['uniqueValueDcv'] = $this->uniqueValueDcv; + } + if (!empty($this->disableFreeSan)) { + $result['disableFreeSan'] = $this->disableFreeSan; + } + + return $result; + } } diff --git a/src/Requests/Contracts/ApiRequestInterface.php b/src/Requests/Contracts/ApiRequestInterface.php new file mode 100644 index 0000000..bf52454 --- /dev/null +++ b/src/Requests/Contracts/ApiRequestInterface.php @@ -0,0 +1,15 @@ +domain = $domain; $this->dcvType = $dcvType; diff --git a/src/Requests/ReissueRequest.php b/src/Requests/ReissueRequest.php index f189aa9..2a42fe2 100644 --- a/src/Requests/ReissueRequest.php +++ b/src/Requests/ReissueRequest.php @@ -1,57 +1,63 @@ dcvType = $dcvType; } - /** - * @return array - */ - public function getApiRequestBody(): array - { - $result = []; - $result['csr'] = $this->csr; - $result['dcvType'] = $this->dcvType; - if (!empty($this->subjectAlternativeNames)) { - $result['subjectAlternativeNames'] = implode(',', $this->subjectAlternativeNames); - } - if (!empty($this->dcv)) { - $result['dcv'] = json_encode($this->dcv); - } - if (!empty($this->company)) { - $result['company'] = $this->company; - } - if (!empty($this->department)) { - $result['department'] = $this->department; - } - if (!empty($this->address)) { - $result['address'] = $this->address; - } - if (!empty($this->zipcode)) { - $result['zipcode'] = $this->zipcode; - } - if (!empty($this->city)) { - $result['city'] = $this->city; - } - if (!empty($this->approverFirstName)) { - $result['approverFirstName'] = $this->approverFirstName; - } - if (!empty($this->approverLastName)) { - $result['approverLastName'] = $this->approverLastName; - } - if (!empty($this->approverEmail)) { - $result['approverEmail'] = $this->approverEmail; - } - if (!empty($this->approverPhone)) { - $result['approverPhone'] = $this->approverPhone; - } - if (!empty($this->kvk)) { - $result['kvk'] = $this->kvk; - } - if (!empty($this->reference)) { - $result['reference'] = $this->reference; - } - if (!is_null($this->uniqueValueDcv)) { - $result['uniqueValueDcv'] = $this->uniqueValueDcv; - } - return $result; - } - /** * @return string[] */ @@ -129,7 +82,7 @@ public function getSubjectAlternativeNames(): array * @param string $subjectAlternativeNames * @return ReissueRequest */ - public function addSubjectAlternativeNames($subjectAlternativeNames): ReissueRequest + public function addSubjectAlternativeNames(string $subjectAlternativeNames): ReissueRequest { $this->subjectAlternativeNames[] = $subjectAlternativeNames; return $this; @@ -352,15 +305,15 @@ public function setReference(string $reference): ReissueRequest } /** - * @return string + * @return string|null */ - public function getUniqueValueDcv(): string + public function getUniqueValueDcv(): ?string { return $this->uniqueValueDcv; } /** - * @param $uniqueValue + * @param string $uniqueValue * @return ReissueRequest */ public function setUniqueValueDcv(string $uniqueValue): ReissueRequest @@ -368,4 +321,80 @@ public function setUniqueValueDcv(string $uniqueValue): ReissueRequest $this->uniqueValueDcv = $uniqueValue; return $this; } + + /** + * @return bool + */ + public function getDisableFreeSan(): bool + { + return $this->disableFreeSan; + } + + /** + * @param bool $disableFreeSan + * @return ReissueRequest + */ + public function setDisableFreeSan(bool $disableFreeSan): ReissueRequest + { + $this->disableFreeSan = $disableFreeSan; + return $this; + } + + /** + * @return array + */ + public function getApiRequestBody(): array + { + $result = []; + $result['csr'] = $this->csr; + $result['dcvType'] = $this->dcvType; + if (!empty($this->subjectAlternativeNames)) { + $result['subjectAlternativeNames'] = implode(',', $this->subjectAlternativeNames); + } + if (!empty($this->dcv)) { + $result['dcv'] = json_encode($this->dcv); + } + if (!empty($this->company)) { + $result['company'] = $this->company; + } + if (!empty($this->department)) { + $result['department'] = $this->department; + } + if (!empty($this->address)) { + $result['address'] = $this->address; + } + if (!empty($this->zipcode)) { + $result['zipcode'] = $this->zipcode; + } + if (!empty($this->city)) { + $result['city'] = $this->city; + } + if (!empty($this->approverFirstName)) { + $result['approverFirstName'] = $this->approverFirstName; + } + if (!empty($this->approverLastName)) { + $result['approverLastName'] = $this->approverLastName; + } + if (!empty($this->approverEmail)) { + $result['approverEmail'] = $this->approverEmail; + } + if (!empty($this->approverPhone)) { + $result['approverPhone'] = $this->approverPhone; + } + if (!empty($this->kvk)) { + $result['kvk'] = $this->kvk; + } + if (!empty($this->reference)) { + $result['reference'] = $this->reference; + } + if (!empty($this->uniqueValueDcv)) { + $result['uniqueValueDcv'] = $this->uniqueValueDcv; + } + + if (!empty($this->disableFreeSan)) { + $result['disableFreeSan'] = $this->disableFreeSan; + } + + return $result; + } } diff --git a/src/Requests/RenewRequest.php b/src/Requests/RenewRequest.php index 527b7be..4d6efae 100644 --- a/src/Requests/RenewRequest.php +++ b/src/Requests/RenewRequest.php @@ -1,62 +1,69 @@ dcvType = $dcvType; } - /** - * @return array - */ - public function getApiRequestBody(): array - { - $result = []; - $result['product'] = $this->productId; - $result['years'] = $this->years; - $result['csr'] = $this->csr; - $result['dcvType'] = $this->dcvType; - if (!empty($this->subjectAlternativeNames)) { - $result['subjectAlternativeNames'] = implode(',', $this->subjectAlternativeNames); - } - if (!empty($this->dcv)) { - $result['dcv'] = json_encode($this->dcv); - } - if (!empty($this->company)) { - $result['company'] = $this->company; - } - if (!empty($this->department)) { - $result['department'] = $this->department; - } - if (!empty($this->address)) { - $result['address'] = $this->address; - } - if (!empty($this->zipcode)) { - $result['zipcode'] = $this->zipcode; - } - if (!empty($this->city)) { - $result['city'] = $this->city; - } - if (!empty($this->approverFirstName)) { - $result['approverFirstName'] = $this->approverFirstName; - } - if (!empty($this->approverLastName)) { - $result['approverLastName'] = $this->approverLastName; - } - if (!empty($this->approverEmail)) { - $result['approverEmail'] = $this->approverEmail; - } - if (!empty($this->approverPhone)) { - $result['approverPhone'] = $this->approverPhone; - } - if (!empty($this->kvk)) { - $result['kvk'] = $this->kvk; - } - if (!empty($this->reference)) { - $result['reference'] = $this->reference; - } - if (!is_null($this->uniqueValueDcv)) { - $result['uniqueValueDcv'] = $this->uniqueValueDcv; - } - return $result; - } - /** * @return string[] */ @@ -203,7 +155,7 @@ public function setDepartment(string $department): RenewRequest /** * @return string */ - public function getAddress() + public function getAddress(): string { return $this->address; } @@ -221,7 +173,7 @@ public function setAddress(string $address): RenewRequest /** * @return string */ - public function getZipcode() + public function getZipcode(): string { return $this->zipcode; } @@ -239,7 +191,7 @@ public function setZipcode(string $zipcode): RenewRequest /** * @return string */ - public function getCity() + public function getCity(): string { return $this->city; } @@ -257,7 +209,7 @@ public function setCity(string $city): RenewRequest /** * @return string */ - public function getApproverFirstName() + public function getApproverFirstName(): string { return $this->approverFirstName; } @@ -275,7 +227,7 @@ public function setApproverFirstName(string $approverFirstName): RenewRequest /** * @return string */ - public function getApproverLastName() + public function getApproverLastName(): string { return $this->approverLastName; } @@ -293,7 +245,7 @@ public function setApproverLastName(string $approverLastName): RenewRequest /** * @return string */ - public function getApproverEmail() + public function getApproverEmail(): string { return $this->approverEmail; } @@ -311,7 +263,7 @@ public function setApproverEmail(string $approverEmail): RenewRequest /** * @return string */ - public function getApproverPhone() + public function getApproverPhone(): string { return $this->approverPhone; } @@ -329,7 +281,7 @@ public function setApproverPhone(string $approverPhone): RenewRequest /** * @return string */ - public function getKvk() + public function getKvk(): string { return $this->kvk; } @@ -347,7 +299,7 @@ public function setKvk(string $kvk): RenewRequest /** * @return string */ - public function getReference() + public function getReference(): string { return $this->reference; } @@ -363,9 +315,9 @@ public function setReference(string $reference): RenewRequest } /** - * @return string + * @return string|null */ - public function getUniqueValueDcv() + public function getUniqueValueDcv(): ?string { return $this->uniqueValueDcv; } @@ -379,4 +331,81 @@ public function setUniqueValueDcv(string $uniqueValue): RenewRequest $this->uniqueValueDcv = $uniqueValue; return $this; } + + /** + * @return bool + */ + public function getDisableFreeSan(): bool + { + return $this->disableFreeSan; + } + + /** + * @param bool $disableFreeSan + * @return RenewRequest + */ + public function setDisableFreeSan(bool $disableFreeSan): RenewRequest + { + $this->disableFreeSan = $disableFreeSan; + return $this; + } + + /** + * @return array + */ + public function getApiRequestBody(): array + { + $result = []; + $result['product'] = $this->productId; + $result['years'] = $this->years; + $result['csr'] = $this->csr; + $result['dcvType'] = $this->dcvType; + if (!empty($this->subjectAlternativeNames)) { + $result['subjectAlternativeNames'] = implode(',', $this->subjectAlternativeNames); + } + if (!empty($this->dcv)) { + $result['dcv'] = json_encode($this->dcv); + } + if (!empty($this->company)) { + $result['company'] = $this->company; + } + if (!empty($this->department)) { + $result['department'] = $this->department; + } + if (!empty($this->address)) { + $result['address'] = $this->address; + } + if (!empty($this->zipcode)) { + $result['zipcode'] = $this->zipcode; + } + if (!empty($this->city)) { + $result['city'] = $this->city; + } + if (!empty($this->approverFirstName)) { + $result['approverFirstName'] = $this->approverFirstName; + } + if (!empty($this->approverLastName)) { + $result['approverLastName'] = $this->approverLastName; + } + if (!empty($this->approverEmail)) { + $result['approverEmail'] = $this->approverEmail; + } + if (!empty($this->approverPhone)) { + $result['approverPhone'] = $this->approverPhone; + } + if (!empty($this->kvk)) { + $result['kvk'] = $this->kvk; + } + if (!empty($this->reference)) { + $result['reference'] = $this->reference; + } + if (!empty($this->uniqueValueDcv)) { + $result['uniqueValueDcv'] = $this->uniqueValueDcv; + } + if (!empty($this->disableFreeSan)) { + $result['disableFreeSan'] = $this->disableFreeSan; + } + + return $result; + } } diff --git a/src/Requests/RequestDCV.php b/src/Requests/RequestDCV.php deleted file mode 100644 index 63d78f6..0000000 --- a/src/Requests/RequestDCV.php +++ /dev/null @@ -1,26 +0,0 @@ -domain = $domain; - $this->dcvType = $dcvType; - $this->approverEmail = $approverEmail; - } -} diff --git a/src/Requests/RequestEERequest.php b/src/Requests/RequestEERequest.php index d96db7a..cee3a7e 100644 --- a/src/Requests/RequestEERequest.php +++ b/src/Requests/RequestEERequest.php @@ -1,36 +1,40 @@ subjectAlternativeNames; } @@ -169,29 +173,28 @@ public function setDcvType(string $dcvType): RequestEERequest } /** - * @return boolean + * @return bool */ - public function isValidate() + public function isValidate(): bool { return $this->validate; } - - + /** * Array representation * * @return array */ - public function getApiRequestBody() + public function getApiRequestBody(): array { $result = [ - 'csr' => $this->getCsr(), - 'approverEmail' => $this->getApproverEmail(), - 'approverFirstName' => $this->getApproverFirstName(), - 'approverLastName' => $this->getApproverLastName(), - 'approverPhone' => $this->getApproverPhone(), - 'dcvType' => $this->getDcvType(), - 'validate' => $this->isValidate() + 'csr' => $this->csr, + 'approverEmail' => $this->approverEmail, + 'approverFirstName' => $this->approverFirstName, + 'approverLastName' => $this->approverLastName, + 'approverPhone' => $this->approverPhone, + 'dcvType' => $this->dcvType, + 'validate' => $this->validate, ]; if (!empty($this->subjectAlternativeNames)) { diff --git a/src/Responses/Base.php b/src/Responses/Base.php index 24df874..0fab783 100644 --- a/src/Responses/Base.php +++ b/src/Responses/Base.php @@ -1,27 +1,33 @@ errors); } diff --git a/src/Responses/CSR.php b/src/Responses/CSR.php index d6ba5c0..a868c78 100644 --- a/src/Responses/CSR.php +++ b/src/Responses/CSR.php @@ -1,25 +1,34 @@ = $this->dateExpired; } diff --git a/src/Responses/Certificates.php b/src/Responses/Certificates.php index 8a6f27d..864d244 100644 --- a/src/Responses/Certificates.php +++ b/src/Responses/Certificates.php @@ -1,5 +1,7 @@ id)) { diff --git a/src/Responses/Notes.php b/src/Responses/Notes.php index 2e56e40..f89edc3 100644 --- a/src/Responses/Notes.php +++ b/src/Responses/Notes.php @@ -1,16 +1,17 @@ pkcs7 = $data->pkcs7; } } - } diff --git a/src/Responses/RequestValidation.php b/src/Responses/RequestValidation.php index 8e97d15..ccd35b4 100644 --- a/src/Responses/RequestValidation.php +++ b/src/Responses/RequestValidation.php @@ -1,20 +1,22 @@ dcvType)) { - if ($data->dcvType == 'FILE') { + if ($data->dcvType === DCVTypes::FILE_VALIDATION) { if (isset($data->fileLocation)) { $this->fileLocation = $data->fileLocation; } if (isset($data->fileContents)) { $this->fileContents = $data->fileContents; } - } elseif ($data->dcvType == 'DNS') { + } elseif ($data->dcvType === DCVTypes::DNS_VALIDATION) { if (isset($data->dnsRecord)) { $this->dnsRecord = $data->dnsRecord; } if (isset($data->dnsCnameValue)) { $this->dnsCnameValue = $data->dnsCnameValue; } - } elseif ($data->dcvType == 'EMAIL') { + } elseif ($data->dcvType === DCVTypes::EMAIL_VALIDATION) { if (isset($data->dcvEmail)) { $this->dcvEmail = $data->dcvEmail; } diff --git a/src/Responses/Requests.php b/src/Responses/Requests.php index efa095a..88f3b35 100644 --- a/src/Responses/Requests.php +++ b/src/Responses/Requests.php @@ -1,5 +1,7 @@ _client->requests->retryDCV(960000024, 'test24-san-1.ssl-test.nl', DCVTypes::EMAIL_VALIDATION, - 'test@ssl-test.nl'); + $request = $this->_client->requests->retryDCV( + 960000024, + 'test24-san-1.ssl-test.nl', + DCVTypes::EMAIL_VALIDATION, + 'test@ssl-test.nl' + ); $this->assertFalse($request->isError()); $this->assertEquals('The DCV will be retried shortly.', $request->getMessage()); @@ -104,7 +110,7 @@ public function testCreateRequestSuccess() xg== -----END CERTIFICATE REQUEST-----"; $approverEmail = 'test@xolphin.nl'; - $param = $this->_client->requests->create(18, 1, $csr, DCVTypes::EMAIL_VALIDATION); + $param = $this->_client->requests->create(18, 1, $csr, DCVTypes::EMAIL_VALIDATION); $param->setApproverEmail($approverEmail); $param->setLanguage(RequestLanguage::ENGLISH); @@ -128,7 +134,6 @@ public function testCreateRequestSuccess() */ public function testGetAllNotes() { - $requestId = 960000000; // we have at least one note @@ -138,7 +143,6 @@ public function testGetAllNotes() $this->assertIsArray($notes); $this->assertEquals(true, count($notes) > 0); $this->assertInstanceOf(Note::class, $notes[0]); - } /** @@ -146,7 +150,6 @@ public function testGetAllNotes() */ public function testCreateNote() { - $rand = rand(1, 10000); $requestId = 960000024; @@ -160,7 +163,6 @@ public function testCreateNote() $this->assertEquals('Test note ' . $rand, $last_note->messageBody); // message was added in last 10 seconds $this->assertEqualsWithDelta($last_note->createdAt->diff(new DateTime())->format("%s"), 0, 10); - } /** @@ -168,14 +170,15 @@ public function testCreateNote() */ public function testSendSectigoSAEmail() { - $requestId = 960000024; $to = 'email@example.com'; $result = $this->_client->requests->sendSectigoSAEmail($requestId, $to); $this->assertEquals(false, $result->isError()); - $this->assertEquals('The Subscriber Agreement will be sent to the given e-mail address.', - $result->getMessage()); + $this->assertEquals( + 'The Subscriber Agreement will be sent to the given e-mail address.', + $result->getMessage() + ); } } diff --git a/tests/Endpoint/SupportTest.php b/tests/Endpoint/SupportTest.php index 7f4452d..74aa1da 100644 --- a/tests/Endpoint/SupportTest.php +++ b/tests/Endpoint/SupportTest.php @@ -1,4 +1,5 @@ - [ + [ + 'product' => 1, + 'years' => 1, + 'csr' => $csr, + 'dcvType' => DCVTypes::DNS_VALIDATION, + 'language' => RequestLanguage::DUTCH, + 'subjectAlternativeNames' => 'xolphin.nl,xolphin.com,xolphin.net', + 'dcv' => json_encode([ + new DCVDomain( + 'xolphin.nl', + DCVTypes::DNS_VALIDATION, + ), + new DCVDomain( + 'xolphin.com', + DCVTypes::EMAIL_VALIDATION, + ), + new DCVDomain( + 'xolphin.net', + DCVTypes::FILE_VALIDATION, + ), + ]), + 'company' => 'Xolphin B.V.', + 'department' => 'Development', + 'address' => 'Main Street 1', + 'zipcode' => '1234 AB', + 'city' => 'Alkmaar', + 'approverFirstName' => 'John', + 'approverLastName' => 'Doe', + 'approverEmail' => 'johndoe@xolphin.nl', + 'approverPhone' => '+316123456789', + 'kvk' => '1234567890', + 'reference' => 'foobar', + 'referenceOrderNr' => 'foobar', + 'sa_email' => 'foobar', + 'uniqueValueDcv' => 'foobar', + 'disableFreeSan' => true, + ], + (new CertificateRequest(1, 1, $csr, DCVTypes::DNS_VALIDATION)) + ->addDcv( + new DCVDomain( + 'xolphin.nl', + DCVTypes::DNS_VALIDATION, + ), + ) + ->addDcv( + new DCVDomain( + 'xolphin.com', + DCVTypes::EMAIL_VALIDATION, + ), + ) + ->addDcv( + new DCVDomain( + 'xolphin.net', + DCVTypes::FILE_VALIDATION, + ), + ) + ->addSubjectAlternativeNames('xolphin.nl') + ->addSubjectAlternativeNames('xolphin.com') + ->addSubjectAlternativeNames('xolphin.net') + ->setLanguage(RequestLanguage::DUTCH) + ->setCompany('Xolphin B.V.') + ->setDepartment('Development') + ->setAddress('Main Street 1') + ->setZipcode('1234 AB') + ->setCity('Alkmaar') + ->setApproverFirstName('John') + ->setApproverLastName('Doe') + ->setApproverEmail('johndoe@xolphin.nl') + ->setApproverPhone('+316123456789') + ->setKvk('1234567890') + ->setReference('foobar') + ->setReferenceOrderNr('foobar') + ->setSaEmail('foobar') + ->setUniqueValueDcv('foobar') + ->setDisableFreeSan(true), + ], + 'Only has base fields' => [ + [ + 'product' => 1, + 'years' => 1, + 'csr' => $csr, + 'dcvType' => DCVTypes::DNS_VALIDATION, + ], + new CertificateRequest(1, 1, $csr, DCVTypes::DNS_VALIDATION) + ], + ]; + } + + /** + * @dataProvider getApiRequestBodyDataProvider + */ + public function testGetApiRequestBody(array $expectedResults, CertificateRequest $certificateRequest): void + { + $actualResults = $certificateRequest->getApiRequestBody(); + + $this->assertEquals( + $expectedResults, + $actualResults + ); + } +} \ No newline at end of file diff --git a/tests/Requests/ReissueRequestTest.php b/tests/Requests/ReissueRequestTest.php new file mode 100644 index 0000000..e2b1156 --- /dev/null +++ b/tests/Requests/ReissueRequestTest.php @@ -0,0 +1,129 @@ + [ + [ + 'csr' => $csr, + 'dcvType' => DCVTypes::DNS_VALIDATION, + 'subjectAlternativeNames' => 'xolphin.nl,xolphin.com,xolphin.net', + 'dcv' => json_encode([ + new DCVDomain( + 'xolphin.nl', + DCVTypes::DNS_VALIDATION, + ), + new DCVDomain( + 'xolphin.com', + DCVTypes::EMAIL_VALIDATION, + ), + new DCVDomain( + 'xolphin.net', + DCVTypes::FILE_VALIDATION, + ), + ]), + 'company' => 'Xolphin B.V.', + 'department' => 'Development', + 'address' => 'Main Street 1', + 'zipcode' => '1234 AB', + 'city' => 'Alkmaar', + 'approverFirstName' => 'John', + 'approverLastName' => 'Doe', + 'approverEmail' => 'johndoe@xolphin.nl', + 'approverPhone' => '+316123456789', + 'kvk' => '1234567890', + 'reference' => 'foobar', + 'uniqueValueDcv' => 'foobar', + 'disableFreeSan' => true, + ], + (new ReissueRequest( $csr, DCVTypes::DNS_VALIDATION)) + ->addDcv( + new DCVDomain( + 'xolphin.nl', + DCVTypes::DNS_VALIDATION, + ), + ) + ->addDcv( + new DCVDomain( + 'xolphin.com', + DCVTypes::EMAIL_VALIDATION, + ), + ) + ->addDcv( + new DCVDomain( + 'xolphin.net', + DCVTypes::FILE_VALIDATION, + ), + ) + ->addSubjectAlternativeNames('xolphin.nl') + ->addSubjectAlternativeNames('xolphin.com') + ->addSubjectAlternativeNames('xolphin.net') + ->setCompany('Xolphin B.V.') + ->setDepartment('Development') + ->setAddress('Main Street 1') + ->setZipcode('1234 AB') + ->setCity('Alkmaar') + ->setApproverFirstName('John') + ->setApproverLastName('Doe') + ->setApproverEmail('johndoe@xolphin.nl') + ->setApproverPhone('+316123456789') + ->setKvk('1234567890') + ->setReference('foobar') + ->setUniqueValueDcv('foobar') + ->setDisableFreeSan(true), + ], + 'Only has base fields' => [ + [ + 'csr' => $csr, + 'dcvType' => DCVTypes::DNS_VALIDATION, + ], + new ReissueRequest($csr, DCVTypes::DNS_VALIDATION) + ], + ]; + } + + /** + * @dataProvider getApiRequestBodyDataProvider + */ + public function testGetApiRequestBody(array $expectedResults, ReissueRequest $reissueRequest): void + { + $actualResults = $reissueRequest->getApiRequestBody(); + + $this->assertEquals( + $expectedResults, + $actualResults + ); + } +} \ No newline at end of file diff --git a/tests/Requests/RenewRequestTest.php b/tests/Requests/RenewRequestTest.php new file mode 100644 index 0000000..6e5d516 --- /dev/null +++ b/tests/Requests/RenewRequestTest.php @@ -0,0 +1,133 @@ + [ + [ + 'product' => 1, + 'years' => 1, + 'csr' => $csr, + 'dcvType' => DCVTypes::DNS_VALIDATION, + 'subjectAlternativeNames' => 'xolphin.nl,xolphin.com,xolphin.net', + 'dcv' => json_encode([ + new DCVDomain( + 'xolphin.nl', + DCVTypes::DNS_VALIDATION, + ), + new DCVDomain( + 'xolphin.com', + DCVTypes::EMAIL_VALIDATION, + ), + new DCVDomain( + 'xolphin.net', + DCVTypes::FILE_VALIDATION, + ), + ]), + 'company' => 'Xolphin B.V.', + 'department' => 'Development', + 'address' => 'Main Street 1', + 'zipcode' => '1234 AB', + 'city' => 'Alkmaar', + 'approverFirstName' => 'John', + 'approverLastName' => 'Doe', + 'approverEmail' => 'johndoe@xolphin.nl', + 'approverPhone' => '+316123456789', + 'kvk' => '1234567890', + 'reference' => 'foobar', + 'uniqueValueDcv' => 'foobar', + 'disableFreeSan' => true, + ], + (new RenewRequest(1, 1, $csr, DCVTypes::DNS_VALIDATION)) + ->addDcv( + new DCVDomain( + 'xolphin.nl', + DCVTypes::DNS_VALIDATION, + ), + ) + ->addDcv( + new DCVDomain( + 'xolphin.com', + DCVTypes::EMAIL_VALIDATION, + ), + ) + ->addDcv( + new DCVDomain( + 'xolphin.net', + DCVTypes::FILE_VALIDATION, + ), + ) + ->addSubjectAlternativeNames('xolphin.nl') + ->addSubjectAlternativeNames('xolphin.com') + ->addSubjectAlternativeNames('xolphin.net') + ->setCompany('Xolphin B.V.') + ->setDepartment('Development') + ->setAddress('Main Street 1') + ->setZipcode('1234 AB') + ->setCity('Alkmaar') + ->setApproverFirstName('John') + ->setApproverLastName('Doe') + ->setApproverEmail('johndoe@xolphin.nl') + ->setApproverPhone('+316123456789') + ->setKvk('1234567890') + ->setReference('foobar') + ->setUniqueValueDcv('foobar') + ->setDisableFreeSan(true), + ], + 'Only has base fields' => [ + [ + 'product' => 1, + 'years' => 1, + 'csr' => $csr, + 'dcvType' => DCVTypes::DNS_VALIDATION, + ], + new RenewRequest(1, 1, $csr, DCVTypes::DNS_VALIDATION) + ], + ]; + } + + /** + * @dataProvider getApiRequestBodyDataProvider + */ + public function testGetApiRequestBody(array $expectedResults, RenewRequest $RenewRequest): void + { + $actualResults = $RenewRequest->getApiRequestBody(); + + $this->assertEquals( + $expectedResults, + $actualResults + ); + } +} \ No newline at end of file diff --git a/tests/Requests/RequestEERequestTest.php b/tests/Requests/RequestEERequestTest.php new file mode 100644 index 0000000..f2cb127 --- /dev/null +++ b/tests/Requests/RequestEERequestTest.php @@ -0,0 +1,77 @@ + [ + [ + 'csr' => $csr, + 'dcvType' => DCVTypes::DNS_VALIDATION, + 'subjectAlternativeNames' => 'xolphin.nl,xolphin.com,xolphin.net', + 'approverFirstName' => 'John', + 'approverLastName' => 'Doe', + 'approverEmail' => 'johndoe@xolphin.nl', + 'approverPhone' => '+316123456789', + 'validate' => true + ], + (new RequestEERequest()) + ->setCsr($csr) + ->setApproverEmail('johndoe@xolphin.nl') + ->setApproverFirstName('John') + ->setApproverLastName('Doe') + ->setApproverPhone('+316123456789') + ->setSubjectAlternativeNames([ + 'xolphin.nl', + 'xolphin.com', + 'xolphin.net' + ]) + ->setValidate(true) + ->setDcvType(DCVTypes::DNS_VALIDATION) + ], + ]; + } + + /** + * @dataProvider getApiRequestBodyDataProvider + */ + public function testGetApiRequestBody(array $expectedResults, RequestEERequest $RequestEERequest): void + { + $actualResults = $RequestEERequest->getApiRequestBody(); + + $this->assertEquals( + $expectedResults, + $actualResults + ); + } +} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index 808b771..e60bb4c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,15 +2,15 @@ namespace Tests; -use Xolphin\Client; use PHPUnit\Framework\TestCase as BaseTestCase; +use Xolphin\Client; class TestCase extends BaseTestCase { /** * @var Client */ - public $_client; + public Client $_client; /** * @description "Initialize function before test run" @@ -19,5 +19,4 @@ protected function setUp(): void { $this->_client = new Client('youremail@domain.com', 'YourPassword', true); } - } From cafa406a3a530bea93dfceba31ae0bff3062961f Mon Sep 17 00:00:00 2001 From: Mike van Diepen Date: Tue, 23 Nov 2021 12:23:02 +0100 Subject: [PATCH 2/3] Replaced the default download types with constants --- src/Endpoints/CertificatesEndpoint.php | 3 ++- src/Endpoints/InvoicesEndpoint.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Endpoints/CertificatesEndpoint.php b/src/Endpoints/CertificatesEndpoint.php index adc775f..d87c9f4 100644 --- a/src/Endpoints/CertificatesEndpoint.php +++ b/src/Endpoints/CertificatesEndpoint.php @@ -8,6 +8,7 @@ use GuzzleHttp\Exception\GuzzleException; use Xolphin\Client; use Xolphin\Exceptions\XolphinRequestException; +use Xolphin\Helpers\CertificateDownloadTypes; use Xolphin\Requests\ReissueRequest; use Xolphin\Requests\RenewRequest; use Xolphin\Responses\Base; @@ -72,7 +73,7 @@ public function get(int $id): Certificate * @return string * @throws XolphinRequestException|GuzzleException */ - public function download(int $id, string $format = 'CRT'): string + public function download(int $id, string $format = CertificateDownloadTypes::CRT): string { $response = $this->client->download('certificates/' . $id . '/download', [ 'format' => $format diff --git a/src/Endpoints/InvoicesEndpoint.php b/src/Endpoints/InvoicesEndpoint.php index b2b8e2d..4c6262a 100644 --- a/src/Endpoints/InvoicesEndpoint.php +++ b/src/Endpoints/InvoicesEndpoint.php @@ -8,6 +8,7 @@ use GuzzleHttp\Exception\GuzzleException; use Xolphin\Client; use Xolphin\Exceptions\XolphinRequestException; +use Xolphin\Helpers\InvoiceDownloadTypes; use Xolphin\Responses\Invoice; use Xolphin\Responses\Invoices; @@ -68,7 +69,7 @@ public function get(int $id): Invoice * @return string * @throws XolphinRequestException|GuzzleException */ - public function download(int $id, string $format = 'PDF'): string + public function download(int $id, string $format = InvoiceDownloadTypes::PDF): string { $response = $this->client->download('invoices/' . $id . '/download', [ 'type' => $format, From 435aa49945cd0c74773139ef5a5d570ece9183ad Mon Sep 17 00:00:00 2001 From: Mike van Diepen Date: Tue, 23 Nov 2021 12:24:26 +0100 Subject: [PATCH 3/3] Added the current exception message & code as fallback in the XolphinRequestException --- src/Exceptions/XolphinRequestException.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Exceptions/XolphinRequestException.php b/src/Exceptions/XolphinRequestException.php index 076c535..0ee68ec 100644 --- a/src/Exceptions/XolphinRequestException.php +++ b/src/Exceptions/XolphinRequestException.php @@ -40,7 +40,11 @@ public static function createFromRequestException(RequestException $requestExcep $code = $requestException->getCode() ?? null; } - $exception = new self($message ?? 'Unknown exception', $code ?? 0, $requestException); + $exception = new self( + $message ?? $requestException->getMessage(), + $code ?? $requestException->getCode(), + $requestException + ); $exception->errors = $errors; return $exception;