From dc70b65d25df2b9a3ae1c3cd7afff5e8d80680af Mon Sep 17 00:00:00 2001 From: Artem Stepin Date: Tue, 22 Jun 2021 18:28:44 +0200 Subject: [PATCH] refactored code ( psr7, psr17 support) --- README.md | 28 +- composer.json | 29 +- composer.lock | 1874 ++++++++++++++--- phpunit.xml | 8 +- src/Api/AbstractApi.php | 141 ++ src/Api/Content.php | 207 ++ src/Client.php | 256 --- src/ConfluenceClient.php | 63 + src/Curl.php | 149 -- src/CurlTokenAuth.php | 20 - .../{ConfluencePage.php => Content.php} | 42 +- src/Exception/RequestException.php | 17 + src/HttpClient/Builder.php | 103 + src/HttpClient/Plugin/TokenAuthentication.php | 25 + .../ContentTest.php} | 16 +- .../Plugin/TokenAuthenticationTest.php | 41 + tests/Tests/ClientTest.php | 121 -- 17 files changed, 2298 insertions(+), 842 deletions(-) create mode 100644 src/Api/AbstractApi.php create mode 100644 src/Api/Content.php delete mode 100644 src/Client.php create mode 100644 src/ConfluenceClient.php delete mode 100644 src/Curl.php delete mode 100644 src/CurlTokenAuth.php rename src/Entity/{ConfluencePage.php => Content.php} (76%) create mode 100644 src/Exception/RequestException.php create mode 100644 src/HttpClient/Builder.php create mode 100644 src/HttpClient/Plugin/TokenAuthentication.php rename tests/{Tests/Entity/ConfluencePageTest.php => Entity/ContentTest.php} (65%) create mode 100644 tests/HttpClient/Plugin/TokenAuthenticationTest.php delete mode 100644 tests/Tests/ClientTest.php diff --git a/README.md b/README.md index 80a7764..9d25f97 100644 --- a/README.md +++ b/README.md @@ -19,35 +19,35 @@ $ php composer.phar require cloudplaydev/confluence-php-client authenticate('NjU2OTA4NDI2MTY5OkBznOUO8YjaUF7KoOruZRXhILJ9'); -//Create a confluence page -$page = new ConfluencePage(); +//Create a confluence content +$page = new ContentEntity(); //Configure your page -$page->setSpace('testSpaceKey')->setTitle('Test')->setContent('

test page

'); +$page->setSpace('testSpaceKey') + ->setTitle('Test') + ->setContent('

test page

'); //Create the page in confluence in the test space -$client->createPage($page); +$client->content()->create($page); //Get the page we created -$createdPage = $client->selectPageBy([ +$createdPage = $client->content()->findOneBy([ 'spaceKey' => 'testSpaceKey', 'title' => 'Test' ]); //Update page content $createdPage->setContent('some new content'); -$client->updatePage($createdPage); +$client->content()->update($createdPage); diff --git a/composer.json b/composer.json index cdb8a37..5ab4594 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "cloudplaydev/confluence-php-client", "description": "Confluence API PHP Client", - "version": "0.0.2", + "version": "0.1.0", "license": "MIT", "keywords": [ "Atlassian", @@ -11,10 +11,6 @@ "Client" ], "authors": [ - { - "name": "Yuxiao (Shawn) Tan", - "email": "yuxiaota@gmail.com" - }, { "name": "Artem Stepin", "email": "stepin.artem@gmail.com" @@ -24,7 +20,13 @@ "autoload": { "psr-4": { "CloudPlayDev\\ConfluenceClient\\": [ - "src/", + "src/" + ] + } + }, + "autoload-dev": { + "psr-4": { + "CloudPlayDev\\Tests\\ConfluenceClient\\": [ "tests/" ] } @@ -32,11 +34,22 @@ "require": { "php": "^7.4", "ext-curl": "*", - "ext-json": "*" + "ext-json": "*", + "psr/http-message": "^1.0", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory": "^1.0", + "php-http/httplug": "^2.0", + "php-http/discovery": "^1.0", + "php-http/promise": "^1.0", + "php-http/client-common": "^2.0" }, "require-dev": { + "roave/security-advisories": "dev-latest", "phpunit/phpunit": "^9.5.5", "phpstan/phpstan": "^0.12.90", - "vimeo/psalm": "^4.8" + "vimeo/psalm": "^4.8", + "guzzlehttp/guzzle": "^7.2", + "http-interop/http-factory-guzzle": "^1.0" } } diff --git a/composer.lock b/composer.lock index f887630..f794db0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,1200 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b7af9b3a819f1cf56aec8e80b146e2c9", - "packages": [], + "content-hash": "668927162209bccc1768c6783626c54a", + "packages": [ + { + "name": "clue/stream-filter", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/clue/stream-filter.git", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "support": { + "issues": "https://github.com/clue/stream-filter/issues", + "source": "https://github.com/clue/stream-filter/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-10-02T12:38:20+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "7008573787b430c1c1f650e3722d9bba59967628" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628", + "reference": "7008573787b430c1c1f650e3722d9bba59967628", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.4", + "guzzlehttp/psr7": "^1.7 || ^2.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0" + }, + "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" + }, + "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.3-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "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.3.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://github.com/alexeyshockov", + "type": "github" + }, + { + "url": "https://github.com/gmponos", + "type": "github" + } + ], + "time": "2021-03-23T11:33:13+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.4.1" + }, + "time": "2021-03-07T09:25:29+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.8.2" + }, + "time": "2021-04-26T09:17:50+00:00" + }, + { + "name": "php-http/client-common", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "e37e46c610c87519753135fb893111798c69076a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/e37e46c610c87519753135fb893111798c69076a", + "reference": "e37e46c610c87519753135fb893111798c69076a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.4.20 || ~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "nyholm/psr7": "^1.2", + "phpspec/phpspec": "^5.1 || ^6.0", + "phpspec/prophecy": "^1.10.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "support": { + "issues": "https://github.com/php-http/client-common/issues", + "source": "https://github.com/php-http/client-common/tree/2.3.0" + }, + "time": "2020-07-21T10:04:13+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.14.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "778f722e29250c1fac0bbdef2c122fa5d038c9eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/778f722e29250c1fac0bbdef2c122fa5d038c9eb", + "reference": "778f722e29250c1fac0bbdef2c122fa5d038c9eb", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.14.0" + }, + "time": "2021-06-01T14:30:21+00:00" + }, + { + "name": "php-http/httplug", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "reference": "191a0a1b41ed026b717421931f8d3bd2514ffbf9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1", + "phpspec/phpspec": "^5.1 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/master" + }, + "time": "2020-07-13T15:43:23+00:00" + }, + { + "name": "php-http/message", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "887734d9c515ad9a564f6581a682fff87a6253cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/887734d9c515ad9a564f6581a682fff87a6253cc", + "reference": "887734d9c515ad9a564f6581a682fff87a6253cc", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.5", + "php": "^7.1 || ^8.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.6", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "laminas/laminas-diactoros": "^2.0", + "phpspec/phpspec": "^5.1 || ^6.3", + "slim/slim": "^3.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "laminas/laminas-diactoros": "Used with Diactoros Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "support": { + "issues": "https://github.com/php-http/message/issues", + "source": "https://github.com/php-http/message/tree/1.11.1" + }, + "time": "2021-05-24T18:11:08+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "support": { + "issues": "https://github.com/php-http/message-factory/issues", + "source": "https://github.com/php-http/message-factory/tree/master" + }, + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", + "phpspec/phpspec": "^5.1.2 || ^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.1.0" + }, + "time": "2020-07-07T09:29:14+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" + }, + { + "name": "symfony/options-resolver", + "version": "v5.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/162e886ca035869866d233a2bfef70cc28f9bbe5", + "reference": "162e886ca035869866d233a2bfef70cc28f9bbe5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.15" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.3.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-05-26T17:43:10+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "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\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/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": "symfony/polyfill-php80", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "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\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/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" + } + ], "packages-dev": [ { "name": "amphp/amp", @@ -598,6 +1790,60 @@ }, "time": "2021-02-22T14:02:09+00:00" }, + { + "name": "http-interop/http-factory-guzzle", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-factory-guzzle.git", + "reference": "34861658efb9899a6618cef03de46e2a52c80fc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/34861658efb9899a6618cef03de46e2a52c80fc0", + "reference": "34861658efb9899a6618cef03de46e2a52c80fc0", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.4.2", + "psr/http-factory": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.5", + "phpunit/phpunit": "^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Factory\\Guzzle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "An HTTP Factory using Guzzle PSR7", + "keywords": [ + "factory", + "http", + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/http-interop/http-factory-guzzle/issues", + "source": "https://github.com/http-interop/http-factory-guzzle/tree/master" + }, + "time": "2018-07-31T19:32:56+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.10.2", @@ -1719,21 +2965,389 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "roave/security-advisories", + "version": "dev-latest", + "source": { + "type": "git", + "url": "https://github.com/Roave/SecurityAdvisories.git", + "reference": "ac3658667fbbdd16f2be6f0976b8527f5f9ddf6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/ac3658667fbbdd16f2be6f0976b8527f5f9ddf6d", + "reference": "ac3658667fbbdd16f2be6f0976b8527f5f9ddf6d", + "shasum": "" + }, + "conflict": { + "3f/pygmentize": "<1.2", + "adodb/adodb-php": "<5.20.12", + "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", + "amazing/media2click": ">=1,<1.3.3", + "amphp/artax": "<1.0.6|>=2,<2.0.6", + "amphp/http": "<1.0.1", + "amphp/http-client": ">=4,<4.4", + "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", + "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", + "aws/aws-sdk-php": ">=3,<3.2.1", + "bagisto/bagisto": "<0.1.5", + "barrelstrength/sprout-base-email": "<1.2.7", + "barrelstrength/sprout-forms": "<3.9", + "baserproject/basercms": "<4.4.5", + "bk2k/bootstrap-package": ">=7.1,<7.1.2|>=8,<8.0.8|>=9,<9.0.4|>=9.1,<9.1.3|>=10,<10.0.10|>=11,<11.0.3", + "bolt/bolt": "<3.7.2", + "bolt/core": "<4.1.13", + "brightlocal/phpwhois": "<=4.2.5", + "buddypress/buddypress": "<5.1.2", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", + "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", + "cartalyst/sentry": "<=2.1.6", + "centreon/centreon": "<20.10.7", + "cesnet/simplesamlphp-module-proxystatistics": "<3.1", + "codeigniter/framework": "<=3.0.6", + "composer/composer": "<1.10.22|>=2-alpha.1,<2.0.13", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/core": ">=2,<3.5.39", + "contao/core-bundle": ">=4,<4.4.52|>=4.5,<4.9.6|= 4.10.0", + "contao/listing-bundle": ">=4,<4.4.8", + "datadog/dd-trace": ">=0.30,<0.30.2", + "david-garcia/phpwhois": "<=4.3.1", + "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", + "directmailteam/direct-mail": "<5.2.4", + "doctrine/annotations": ">=1,<1.2.7", + "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", + "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", + "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", + "doctrine/doctrine-bundle": "<1.5.2", + "doctrine/doctrine-module": "<=0.7.1", + "doctrine/mongodb-odm": ">=1,<1.0.2", + "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", + "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", + "dolibarr/dolibarr": "<11.0.4", + "dompdf/dompdf": ">=0.6,<0.6.2", + "drupal/core": ">=7,<7.80|>=8,<8.9.14|>=9,<9.0.12|>=9.1,<9.1.7", + "drupal/drupal": ">=7,<7.80|>=8,<8.9.14|>=9,<9.0.12|>=9.1,<9.1.7", + "dweeves/magmi": "<=0.7.24", + "endroid/qr-code-bundle": "<3.4.2", + "enshrined/svg-sanitize": "<0.13.1", + "erusev/parsedown": "<1.7.2", + "ezsystems/demobundle": ">=5.4,<5.4.6.1", + "ezsystems/ez-support-tools": ">=2.2,<2.2.3", + "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", + "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", + "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", + "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", + "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<=1.3.1", + "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<=1.3.1", + "ezsystems/ezplatform-user": ">=1,<1.0.1", + "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<=7.5.15.1", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.2|>=2011,<2017.12.7.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.5.1", + "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1", + "ezyang/htmlpurifier": "<4.1.1", + "facade/ignition": "<1.16.14|>=2,<2.4.2|>=2.5,<2.5.2", + "feehi/cms": "<=2.1.1", + "firebase/php-jwt": "<2", + "flarum/core": ">=1,<=1.0.1", + "flarum/sticky": ">=0.1-beta.14,<=0.1-beta.15", + "flarum/tags": "<=0.1-beta.13", + "fluidtypo3/vhs": "<5.1.1", + "fooman/tcpdf": "<6.2.22", + "forkcms/forkcms": "<5.8.3", + "fossar/tcpdf-parser": "<6.2.22", + "francoisjacquet/rosariosis": "<6.5.1", + "friendsofsymfony/oauth2-php": "<1.3", + "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", + "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", + "fuel/core": "<1.8.1", + "getgrav/grav": "<=1.7.10", + "getkirby/cms": "<3.5.4", + "getkirby/panel": "<2.5.14", + "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", + "gree/jose": "<=2.2", + "gregwar/rst": "<1.0.3", + "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", + "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", + "illuminate/database": "<6.20.26|>=7,<8.40", + "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "illuminate/view": ">=7,<7.1.2", + "impresscms/impresscms": "<=1.4.2", + "ivankristianto/phpwhois": "<=4.3", + "james-heinrich/getid3": "<1.9.9", + "joomla/archive": "<1.1.10", + "joomla/session": "<1.3.1", + "jsmitty12/phpwhois": "<5.1", + "kazist/phpwhois": "<=4.2.6", + "kitodo/presentation": "<3.1.2", + "klaviyo/magento2-extension": ">=1,<3", + "kreait/firebase-php": ">=3.2,<3.8.1", + "la-haute-societe/tcpdf": "<6.2.22", + "laminas/laminas-http": "<2.14.2", + "laravel/framework": "<6.20.26|>=7,<8.40", + "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "league/commonmark": "<0.18.3", + "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3", + "librenms/librenms": "<21.1", + "livewire/livewire": ">2.2.4,<2.2.6", + "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", + "magento/magento1ce": "<1.9.4.3", + "magento/magento1ee": ">=1,<1.14.4.3", + "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", + "marcwillmann/turn": "<0.3.3", + "mautic/core": "<3.3.2|= 2.13.1", + "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", + "mittwald/typo3_forum": "<1.2.1", + "monolog/monolog": ">=1.8,<1.12", + "moodle/moodle": "<3.5.17|>=3.7,<3.7.9|>=3.8,<3.8.8|>=3.9,<3.9.5|>=3.10,<3.10.2", + "namshi/jose": "<2.2", + "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", + "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.9.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", + "neos/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", + "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", + "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", + "nystudio107/craft-seomatic": "<3.3", + "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", + "october/backend": "<1.1.2", + "october/cms": "= 1.1.1|= 1.0.471|= 1.0.469|>=1.0.319,<1.0.469", + "october/october": ">=1.0.319,<1.0.466", + "october/rain": "<1.0.472|>=1.1,<1.1.2", + "onelogin/php-saml": "<2.10.4", + "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", + "opencart/opencart": "<=3.0.3.2", + "openid/php-openid": "<2.3", + "openmage/magento-lts": "<=19.4.12|>=20,<=20.0.8", + "orchid/platform": ">=9,<9.4.4", + "oro/crm": ">=1.7,<1.7.4", + "oro/platform": ">=1.7,<1.7.4", + "padraic/humbug_get_contents": "<1.1.2", + "pagarme/pagarme-php": ">=0,<3", + "paragonie/random_compat": "<2", + "passbolt/passbolt_api": "<2.11", + "paypal/merchant-sdk-php": "<3.12", + "pear/archive_tar": "<1.4.12", + "personnummer/personnummer": "<3.0.2", + "phanan/koel": "<5.1.4", + "phpfastcache/phpfastcache": ">=5,<5.0.13", + "phpmailer/phpmailer": "<6.5", + "phpmussel/phpmussel": ">=1,<1.6", + "phpmyadmin/phpmyadmin": "<4.9.6|>=5,<5.0.3", + "phpoffice/phpexcel": "<1.8.2", + "phpoffice/phpspreadsheet": "<1.16", + "phpseclib/phpseclib": "<2.0.31|>=3,<3.0.7", + "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", + "phpwhois/phpwhois": "<=4.2.5", + "phpxmlrpc/extras": "<0.6.1", + "pimcore/pimcore": "<6.8.8", + "pocketmine/pocketmine-mp": "<3.15.4", + "pressbooks/pressbooks": "<5.18", + "prestashop/autoupgrade": ">=4,<4.10.1", + "prestashop/contactform": ">1.0.1,<4.3", + "prestashop/gamification": "<2.3.2", + "prestashop/productcomments": ">=4,<4.2.1", + "prestashop/ps_emailsubscription": "<2.6.1", + "prestashop/ps_facetedsearch": "<3.4.1", + "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", + "propel/propel": ">=2-alpha.1,<=2-alpha.7", + "propel/propel1": ">=1,<=1.7.1", + "pterodactyl/panel": "<0.7.19|>=1-rc.0,<=1-rc.6", + "pusher/pusher-php-server": "<2.2.1", + "pwweb/laravel-core": "<=0.3.6-beta", + "rainlab/debugbar-plugin": "<3.1", + "rmccue/requests": ">=1.6,<1.8", + "robrichards/xmlseclibs": "<3.0.4", + "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", + "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", + "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", + "sensiolabs/connect": "<4.2.3", + "serluck/phpwhois": "<=4.2.6", + "shopware/core": "<=6.3.5.2", + "shopware/platform": "<=6.3.5.2", + "shopware/production": "<=6.3.5.2", + "shopware/shopware": "<=5.6.9", + "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", + "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", + "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", + "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", + "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", + "silverstripe/framework": "<4.7.4", + "silverstripe/graphql": "<=3.5|>=4-alpha.1,<4-alpha.2", + "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", + "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", + "silverstripe/subsites": ">=2,<2.1.1", + "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", + "silverstripe/userforms": "<3", + "simple-updates/phpwhois": "<=1", + "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", + "simplesamlphp/simplesamlphp": "<1.18.6", + "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", + "simplito/elliptic-php": "<1.0.6", + "slim/slim": "<2.6", + "smarty/smarty": "<3.1.39", + "socalnick/scn-social-auth": "<1.15.2", + "socialiteproviders/steam": "<1.1", + "spoonity/tcpdf": "<6.2.22", + "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", + "ssddanbrown/bookstack": "<0.29.2", + "stormpath/sdk": ">=0,<9.9.99", + "studio-42/elfinder": "<2.1.59", + "sulu/sulu": "<1.6.34|>=2,<2.0.10|>=2.1,<2.1.1", + "swiftmailer/swiftmailer": ">=4,<5.4.5", + "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", + "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", + "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", + "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", + "sylius/sylius": "<1.6.9|>=1.7,<1.7.9|>=1.8,<1.8.3", + "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", + "symbiote/silverstripe-queuedjobs": ">=3,<3.0.2|>=3.1,<3.1.4|>=4,<4.0.7|>=4.1,<4.1.2|>=4.2,<4.2.4|>=4.3,<4.3.3|>=4.4,<4.4.3|>=4.5,<4.5.1|>=4.6,<4.6.4", + "symbiote/silverstripe-versionedfiles": "<=2.0.3", + "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", + "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/maker-bundle": ">=1.27,<1.29.2|>=1.30,<1.31.1", + "symfony/mime": ">=4.3,<4.3.8", + "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/polyfill": ">=1,<1.10", + "symfony/polyfill-php55": ">=1,<1.10", + "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", + "symfony/routing": ">=2,<2.0.19", + "symfony/security": ">=2,<2.7.51|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.8", + "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.9", + "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8|>=5.3,<5.3.2", + "symfony/serializer": ">=2,<2.0.11", + "symfony/symfony": ">=2,<3.4.49|>=4,<4.4.24|>=5,<5.2.9|>=5.3,<5.3.2", + "symfony/translation": ">=2,<2.0.17", + "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", + "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", + "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", + "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "t3/dce": ">=2.2,<2.6.2", + "t3g/svg-sanitizer": "<1.0.3", + "tecnickcom/tcpdf": "<6.2.22", + "thelia/backoffice-default-template": ">=2.1,<2.1.2", + "thelia/thelia": ">=2.1-beta.1,<2.1.3", + "theonedemon/phpwhois": "<=4.2.5", + "titon/framework": ">=0,<9.9.99", + "tribalsystems/zenario": "<8.8.53370", + "truckersmp/phpwhois": "<=4.3.1", + "twig/twig": "<1.38|>=2,<2.7", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.38|>=9,<9.5.25|>=10,<10.4.14|>=11,<11.1.1", + "typo3/cms-backend": ">=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/cms-core": ">=6.2,<=6.2.56|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<9.5.25|>=10,<10.4.14|>=11,<11.1.1", + "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", + "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", + "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", + "typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", + "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10", + "ua-parser/uap-php": "<3.8", + "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", + "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", + "vrana/adminer": "<4.7.9", + "wallabag/tcpdf": "<6.2.22", + "wikimedia/parsoid": "<0.12.2", + "willdurand/js-translation-bundle": "<2.1.1", + "wp-cli/wp-cli": "<2.5", + "yii2mod/yii2-cms": "<1.9.2", + "yiisoft/yii": ">=1.1.14,<1.1.15", + "yiisoft/yii2": "<2.0.38", + "yiisoft/yii2-bootstrap": "<2.0.4", + "yiisoft/yii2-dev": "<2.0.15", + "yiisoft/yii2-elasticsearch": "<2.0.5", + "yiisoft/yii2-gii": "<2.0.4", + "yiisoft/yii2-jui": "<2.0.4", + "yiisoft/yii2-redis": "<2.0.8", + "yoast-seo-for-typo3/yoast_seo": "<7.2.1", + "yourls/yourls": "<1.7.4", + "zendesk/zendesk_api_client_php": "<2.2.11", + "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", + "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", + "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", + "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", + "zendframework/zend-diactoros": ">=1,<1.8.4", + "zendframework/zend-feed": ">=1,<2.10.3", + "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-http": ">=1,<2.8.1", + "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", + "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", + "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", + "zendframework/zend-validator": ">=2.3,<2.3.6", + "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", + "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", + "zendframework/zendframework": "<=3", + "zendframework/zendframework1": "<1.12.20", + "zendframework/zendopenid": ">=2,<2.0.2", + "zendframework/zendxml": ">=1,<1.0.1", + "zetacomponents/mail": "<1.8.2", + "zf-commons/zfc-user": "<1.2.2", + "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", + "zfr/zfr-oauth2-server-module": "<0.1.2", + "zoujingli/thinkadmin": "<6.0.22" + }, + "default-branch": true, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "role": "maintainer" + }, + { + "name": "Ilya Tribusean", + "email": "slash3b@gmail.com", + "role": "maintainer" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], + "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "issues": "https://github.com/Roave/SecurityAdvisories/issues", + "source": "https://github.com/Roave/SecurityAdvisories/tree/latest" }, - "time": "2021-05-03T11:20:27+00:00" + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", + "type": "tidelift" + } + ], + "time": "2021-06-17T16:09:58+00:00" }, { "name": "sebastian/cli-parser", @@ -2588,7 +4202,6 @@ "type": "github" } ], - "abandoned": true, "time": "2020-09-28T06:45:17+00:00" }, { @@ -2798,73 +4411,6 @@ ], "time": "2021-06-12T09:42:48+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" - }, { "name": "symfony/polyfill-ctype", "version": "v1.23.0", @@ -3189,168 +4735,6 @@ ], "time": "2021-05-27T09:27:20+00:00" }, - { - "name": "symfony/polyfill-php73", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "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\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/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": "symfony/polyfill-php80", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "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\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/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": "symfony/service-contracts", "version": "v2.4.0", @@ -3779,7 +5163,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "roave/security-advisories": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/phpunit.xml b/phpunit.xml index 03223a9..ece7afa 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,13 @@ + - tests/Tests + ./tests + + + ./src + + \ No newline at end of file diff --git a/src/Api/AbstractApi.php b/src/Api/AbstractApi.php new file mode 100644 index 0000000..90ebeca --- /dev/null +++ b/src/Api/AbstractApi.php @@ -0,0 +1,141 @@ +client = $client; + } + + /** + * @param string $uri + * @param mixed[] $params + * @param array $headers + * @return ResponseInterface + * @throws Exception + */ + protected function get(string $uri, array $params = [], array $headers = []): ResponseInterface + { + return $this->client->getHttpClient()->get(self::prepareUri($uri, $params), $headers); + } + + /** + * @param string $uri + * @param mixed[] $params + * @param array $headers + * @return ResponseInterface + * @throws Exception + * @throws JsonException + */ + protected function put(string $uri, array $params = [], array $headers = []): ResponseInterface + { + $body = self::prepareJsonBody($params); + + if ($body !== '') { + $headers = self::addJsonContentType($headers); + } + + return $this->client->getHttpClient()->put(self::prepareUri($uri), $headers, $body); + } + + /** + * @param string $uri + * @param mixed[] $params + * @param array $headers + * @return ResponseInterface + * @throws Exception + * @throws JsonException + */ + protected function post(string $uri, array $params = [], array $headers = []): ResponseInterface + { + $body = self::prepareJsonBody($params); + + if ($body !== '') { + $headers = self::addJsonContentType($headers); + } + + return $this->client->getHttpClient()->post(self::prepareUri($uri), $headers, $body); + } + + /** + * @param string $uri + * @param mixed[] $params + * @param array $headers + * @return ResponseInterface + * @throws Exception + * @throws JsonException + */ + protected function delete(string $uri, array $params = [], array $headers = []): ResponseInterface + { + $body = self::prepareJsonBody($params); + + if ($body !== '') { + $headers = self::addJsonContentType($headers); + } + + return $this->client->getHttpClient()->delete(self::prepareUri($uri), $headers, $body); + } + + /** + * @param array $headers + * @return array + */ + private static function addJsonContentType(array $headers): array + { + return array_merge(['Content-Type' => 'application/json'], $headers); + } + + /** + * @param mixed[] $params + * @return string + * @throws JsonException + */ + private static function prepareJsonBody(array $params): string + { + return json_encode($params, JSON_THROW_ON_ERROR); + } + + /** + * @param string $uri + * @param mixed[] $query + * @return string + */ + private static function prepareUri(string $uri, array $query = []): string + { + $query = array_filter($query, static function ($value): bool { + return null !== $value; + }); + + return sprintf('%s%s%s', self::URI_PREFIX, $uri, http_build_query($query)); + } + + /** + * @param mixed $uri + * @return string + */ + protected static function encodePath($uri): string + { + return rawurlencode((string)$uri); + } +} \ No newline at end of file diff --git a/src/Api/Content.php b/src/Api/Content.php new file mode 100644 index 0000000..21f4a04 --- /dev/null +++ b/src/Api/Content.php @@ -0,0 +1,207 @@ +get(self::getContentUri($contentId)); + + if ($response->getStatusCode() !== 200) { + throw new RequestException($response); + } + + return $this->deserialize($response); + } + + /** + * @param ContentEntity $page + * @return ResponseInterface + * @throws Exception + * @throws JsonException + * @throws HttpClientException + */ + public function update(ContentEntity $page): ResponseInterface + { + $contentId = $page->getId(); + if (null === $contentId) { + throw new Exception('Only saved pages can be updated.'); + } + $data = [ + 'id' => $contentId, + 'type' => $page->getType(), + 'title' => $page->getTitle(), + 'space' => ['key' => $page->getSpace()], + 'body' => [ + 'storage' => [ + 'value' => $page->getContent(), + 'representation' => 'storage', + ], + ], + 'version' => ['number' => $page->getVersion() + 1] + ]; + + return $this->put(self::getContentUri($contentId), $data); + + } + + /** + * @param ContentEntity $page + * @return ContentEntity + * @throws Exception + * @throws HttpClientException + * @throws JsonException + */ + public function create(ContentEntity $page): ContentEntity + { + if (null !== $page->getId()) { + throw new Exception('Only new pages can be created.'); + } + + $data = [ + 'type' => $page->getType(), + 'title' => $page->getTitle(), + 'space' => ['key' => $page->getSpace()], + 'body' => [ + 'storage' => [ + 'value' => $page->getContent(), + 'representation' => 'storage', + ], + ], + ]; + + $response = $this->post(self::getContentUri(), $data); + + if ($response->getStatusCode() !== 200) { + throw new RequestException($response); + } + + return $this->deserialize($response); + + } + + /** + * @param ContentEntity $page + * @return ResponseInterface + */ + public function remove(ContentEntity $page): ResponseInterface + { + $contentId = $page->getId(); + if (null === $contentId) { + throw new Exception('Only saved pages can be removed.'); + } + return $this->put(self::getContentUri($contentId)); + } + + /** + * @param array{title?: string, spaceKey?: string, type?: string, id?: int|string, expand?: string} $searchParameter + * @return ContentEntity|null + * @throws Exception + * @throws JsonException + */ + public function findOneBy(array $searchParameter): ?ContentEntity + { + $allowedSearchParameter = ['title', 'spaceKey', 'type', 'id', 'expand']; + $queryParameter = array_filter($searchParameter, static function (string $searchKey) use ($allowedSearchParameter) { + return in_array($searchKey, $allowedSearchParameter, true); + }, ARRAY_FILTER_USE_KEY); + + $searchResponse = $this->get('content?', $queryParameter); + + if ($searchResponse->getStatusCode() !== 200) { + throw new RequestException($searchResponse); + } + + $decodedSearchResponse = (array)json_decode($searchResponse->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); + + if (isset($decodedSearchResponse['results'], $decodedSearchResponse['size']) && is_array($decodedSearchResponse['results']) && $decodedSearchResponse['size'] >= 1 && count($decodedSearchResponse['results']) >= 1) { + $firstPage = (array)reset($decodedSearchResponse['results']); + if (isset($firstPage['id'])) { + return $this->findOneById((int)$firstPage['id']); + } + } + + return null; + } + + /** + * @param ResponseInterface $response + * @return ContentEntity + * @throws Exception + * @throws JsonException + */ + private function deserialize(ResponseInterface $response): ContentEntity + { + $responseData = $response->getBody()->getContents(); + + $decodedData = json_decode($responseData, true, 512, JSON_THROW_ON_ERROR); + + if (!is_array($decodedData)) { + throw new Exception('Return value could not be decoded.'); + } + + return $this->deserializeContent($decodedData); + } + + /** + * @param mixed[] $decodedData + * @return ContentEntity + * @throws Exception + */ + private function deserializeContent(array $decodedData): ContentEntity + { + if (!isset($decodedData['id'], + $decodedData['type'], + $decodedData['title'], + $decodedData['_links']['self'], + $decodedData['space']['key'], + $decodedData['version']['number']) + ) { + throw new Exception('Invalid content data'); + } + + $page = new ContentEntity(); + $page->setId((int)$decodedData['id']); + $page->setType((string)$decodedData['type']); + $page->setTitle((string)$decodedData['title']); + $page->setUrl((string)$decodedData['_links']['self']); + $page->setSpace(str_replace('/rest/api/space/', '', (string)$decodedData['space']['key'])); + $page->setVersion((int)$decodedData['version']['number']); + + return $page; + } +} \ No newline at end of file diff --git a/src/Client.php b/src/Client.php deleted file mode 100644 index 07d7c81..0000000 --- a/src/Client.php +++ /dev/null @@ -1,256 +0,0 @@ -curl = $curl; - } - - /** - * Create new page - * - * @param ConfluencePage $page - * @return mixed - * @throws Exception - */ - public function createPage(ConfluencePage $page) - { - $data = [ - 'type' => $page->getType(), - 'title' => $page->getTitle(), - 'ancestors' => $page->getAncestors(), - 'space' => ['key' => $page->getSpace()], - 'history' => [ - 'createdDate' => $page->getCreatedDate() ?: date('Y-m-d\TH:i:s.uP') - ], - 'body' => [ - 'storage' => [ - 'value' => $page->getContent(), - 'representation' => 'storage', - ], - ], - ]; - - return $this->request('GET', $this->curl->getHost() . '/rest/api/content', $data); - } - - - /** - * Update an existing page - * - * @param ConfluencePage $page - * @return mixed - * @throws Exception - */ - public function updatePage(ConfluencePage $page) - { - $data = [ - 'id' => $page->getId(), - 'type' => $page->getType(), - 'title' => $page->getTitle(), - 'space' => ['key' => $page->getSpace()], - 'body' => [ - 'storage' => [ - 'value' => $page->getContent(), - 'representation' => 'storage', - ], - ], - 'version' => ['number' => $page->getVersion()+1] - ]; - - return $this->request('PUT', $this->curl->getHost() . "/rest/api/content/{$page->getId()}", $data); - } - - /** - * Delete a page - * - * @param string $id - * @return mixed - * @throws Exception - */ - public function deletePage(string $id) - { - return $this->request('DELETE', $this->curl->getHost() . "/rest/api/content/$id"); - } - - /** - * Search page by title, space key, type or id - * @param array $parameters - * @return ConfluencePage|null - * @throws Exception - */ - public function selectPageBy(array $parameters = []): ?ConfluencePage - { - $url = $this->curl->getHost() . '/rest/api/content?'; - if (isset($parameters['title'])) { - $url .= "title={$parameters['title']}&"; - } - if (isset($parameters['spaceKey'])) { - $url .= "spaceKey={$parameters['spaceKey']}&"; - } - if (isset($parameters['type'])) { - $url .= "type={$parameters['type']}&"; - } - if (isset($parameters['id'])) { - return $this->getPageById((int)$parameters['id']); - } - if (isset($parameters['expand'])) { - $url .= 'expand=' . $parameters['expand']; - } - - $searchResponse = $this->request('GET', $url); - - if (is_array($searchResponse) && isset($searchResponse['results'], $searchResponse['size']) && is_array($searchResponse['results']) && $searchResponse['size'] >= 1 && count($searchResponse['results']) >= 1) { - $firstPage = (array)reset($searchResponse['results']); - if (isset($firstPage['id'])) { - return $this->getPageById((int)$firstPage['id']); - } - } - return null; - } - - public function getPageById(int $pageId): ?ConfluencePage - { - $url = $this->curl->getHost() . '/rest/api/content/'.$pageId; - $firstPage = $this->request('GET', $url); - - if (!isset($firstPage['id'], - $firstPage['type'], - $firstPage['title'], - $firstPage['_links']['self'], - $firstPage['space']['key'], - $firstPage['version']['number']) - ) { - return null; - } - - $page = new ConfluencePage(); - $page->setId((int)$firstPage['id']); - $page->setType((string)$firstPage['type']); - $page->setTitle((string)$firstPage['title']); - $page->setUrl((string)$firstPage['_links']['self']); - $page->setSpace(str_replace('/rest/api/space/', '', (string)$firstPage['space']['key'])); - $page->setVersion((int)$firstPage['version']['number']); - return $page; - } - - /** - * Upload an attachment - * @param string $path - * @param string $parentPageId - * @return mixed - * @throws Exception - */ - public function uploadAttachment(string $path, string $parentPageId) - { - $headers = [ - 'Content-Type' => 'multipart/form-data', - 'X-Atlassian-Token' => 'no-check' - ]; - $data = [ - 'file' => '@' . $path - ]; - return $this->request( - 'POST', - $this->curl->getHost() . "/rest/api/content/$parentPageId/child/attachment", - $data, - $headers - ); - } - - /** - * Get attachments from the page - * - * @param string $pageId - * @return mixed - * @throws Exception - */ - public function selectAttachments(string $pageId) - { - return $this->request('GET', $this->curl->getHost() . "/rest/api/content/$pageId/child/attachment"); - } - - /** - * @param string $pageId - * @param mixed[] $labels [['name'=>'example_tag'],...] - * @return mixed - * @throws Exception - */ - public function addLabel(string $pageId, array $labels) - { - return $this->request('POST', $this->curl->getHost() . "/rest/api/content/$pageId/label", $labels); - } - - /** - * Make request. - * - * @param string $method - * @param string $url - * @param mixed[] $data - * @param array $headers - * - * @return mixed[]|null - * - * @throws Exception - */ - public function request(string $method, string $url, array $data = [], array $headers = ['Content-Type' => 'application/json']): ?array - { - //Detect invalid method - $method = strtoupper($method); - $methods = ['DELETE', 'GET', 'POST', 'PUT']; - if (!in_array($method, $methods)) { - throw new Exception('Invalid method'); - } - $this->curl->setOptions([ - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => 1, - CURLOPT_CUSTOMREQUEST => $method, - ])->setHeaders($headers); - - if ($data !== []) { - $this->curl->setOption(CURLOPT_POSTFIELDS, json_encode($data, JSON_THROW_ON_ERROR)); - } - - $serverOutput = $this->curl->execute(); - - if (!is_string($serverOutput)) { - throw new InvalidArgumentException('Unexpected return value'); - } - - if(empty($serverOutput)) { - return null; - } - - $decodedData = json_decode($serverOutput, true, 512, JSON_THROW_ON_ERROR); - - if (!is_array($decodedData)) { - throw new InvalidArgumentException('Return value could not be decoded.'); - } - - return $decodedData; - } -} \ No newline at end of file diff --git a/src/ConfluenceClient.php b/src/ConfluenceClient.php new file mode 100644 index 0000000..31bb5b9 --- /dev/null +++ b/src/ConfluenceClient.php @@ -0,0 +1,63 @@ +httpClientBuilder = $httpClientBuilder ?: new Builder(); + $this->httpClientBuilder->addPlugin(new HeaderDefaultsPlugin([ + 'User-Agent' => self::USER_AGENT, + ])); + + $this->setUrl($confluenceHostUrl); + } + + public function authenticate(string $token): ConfluenceClient + { + $this->httpClientBuilder->removePlugin(TokenAuthentication::class); + $this->httpClientBuilder->addPlugin(new TokenAuthentication($token)); + + return $this; + } + + public function content(): Content + { + return new Content($this); + } + + /** + * Get the HTTP client. + * + * @return HttpMethodsClientInterface + */ + public function getHttpClient(): HttpMethodsClientInterface + { + return $this->httpClientBuilder->getHttpClient(); + } + + public function setUrl(string $url): void + { + $uri = $this->httpClientBuilder->getUriFactory()->createUri($url); + + $this->httpClientBuilder->removePlugin(AddHostPlugin::class); + $this->httpClientBuilder->addPlugin(new AddHostPlugin($uri)); + } + + +} \ No newline at end of file diff --git a/src/Curl.php b/src/Curl.php deleted file mode 100644 index 3d83307..0000000 --- a/src/Curl.php +++ /dev/null @@ -1,149 +0,0 @@ -curl = $ch; - $this->hostUrl = $host; - - $this->setOptions([ - CURLOPT_HTTPAUTH => CURLAUTH_BASIC, - CURLOPT_USERPWD => $username . ':' . $password, - CURLINFO_HEADER_OUT => true, - ]); - } - - public function __destruct() - { - $this->close(); - } - - - /** - * Get host url - * - * @return string - */ - public function getHost(): string - { - return $this->hostUrl; - } - - /** - * Set option to web client - * - * @param int $name - * @param mixed $value - * @return $this - */ - public function setOption(int $name, $value): Curl - { - curl_setopt($this->curl, $name, $value); - return $this; - } - - /** - * Set multiple options - * - * @param array $options - * @return $this - */ - public function setOptions(array $options): Curl - { - curl_setopt_array($this->curl, $options); - return $this; - } - - /** - * Execute the quest and return response from server - * @return mixed - */ - public function execute() - { - $result = curl_exec($this->curl); - if ($result === false) { - throw new Exception(curl_error($this->curl) . curl_errno($this->curl)); - } - - $responseCode = (int)curl_getinfo($this->curl, CURLINFO_RESPONSE_CODE); - - if($responseCode !== 200) { - throw new Exception('Response code: ' . $responseCode . ' ( ' . $result . ' )'); - } - - return $result; - } - - /** - * Set headers from an array to web client - * - * @param array $headers - * @return $this - */ - public function setHeaders(array $headers): Curl - { - $httpHeaders = []; - foreach ($headers as $key => $value) { - $httpHeaders[] = $key . ':' . $value; - } - curl_setopt($this->curl, CURLOPT_HTTPHEADER, $httpHeaders); - return $this; - } - - /** - * Get information of the request - * - * @param int $name - * @return mixed - */ - public function getInfo(int $name) - { - return curl_getinfo($this->curl, $name); - } - - /** - * Close connection - * - * @return $this - */ - private function close(): Curl - { - curl_close($this->curl); - return $this; - } -} \ No newline at end of file diff --git a/src/CurlTokenAuth.php b/src/CurlTokenAuth.php deleted file mode 100644 index 46eb651..0000000 --- a/src/CurlTokenAuth.php +++ /dev/null @@ -1,20 +0,0 @@ -setOptions([ - CURLOPT_HTTPAUTH => CURLAUTH_BEARER, - CURLOPT_XOAUTH2_BEARER => $token, - CURLOPT_USERPWD => null - ]); - } -} \ No newline at end of file diff --git a/src/Entity/ConfluencePage.php b/src/Entity/Content.php similarity index 76% rename from src/Entity/ConfluencePage.php rename to src/Entity/Content.php index 1089e29..303c9c4 100644 --- a/src/Entity/ConfluencePage.php +++ b/src/Entity/Content.php @@ -9,7 +9,7 @@ namespace CloudPlayDev\ConfluenceClient\Entity; -class ConfluencePage +class Content { private ?int $id = null; private ?string $title = null; @@ -41,9 +41,9 @@ public function getType(): ?string /** * @param string $type - * @return ConfluencePage + * @return Content */ - public function setType(string $type): ConfluencePage + public function setType(string $type): Content { $this->type = $type; return $this; @@ -59,9 +59,9 @@ public function getId(): ?int /** * @param int $id - * @return ConfluencePage + * @return Content */ - public function setId(int $id): ConfluencePage + public function setId(int $id): Content { $this->id = $id; return $this; @@ -74,9 +74,9 @@ public function getTitle(): ?string /** * @param string $title - * @return ConfluencePage + * @return Content */ - public function setTitle(string $title): ConfluencePage + public function setTitle(string $title): Content { $this->title = $title; return $this; @@ -92,9 +92,9 @@ public function getSpace(): ?string /** * @param string $space - * @return ConfluencePage + * @return Content */ - public function setSpace(string $space): ConfluencePage + public function setSpace(string $space): Content { $this->space = $space; return $this; @@ -110,9 +110,9 @@ public function getAncestors() /** * @param array $ancestors - * @return ConfluencePage + * @return Content */ - public function setAncestors(array $ancestors): ConfluencePage + public function setAncestors(array $ancestors): Content { $this->ancestors = $ancestors; return $this; @@ -128,9 +128,9 @@ public function getContent(): ?string /** * @param string $content - * @return ConfluencePage + * @return Content */ - public function setContent(string $content): ConfluencePage + public function setContent(string $content): Content { $this->content = $content; return $this; @@ -146,9 +146,9 @@ public function getVersion(): int /** * @param int $version - * @return ConfluencePage + * @return Content */ - public function setVersion(int $version): ConfluencePage + public function setVersion(int $version): Content { $this->version = $version; return $this; @@ -164,9 +164,9 @@ public function getChildren(): array /** * @param array $children - * @return ConfluencePage + * @return Content */ - public function setChildren(array $children): ConfluencePage + public function setChildren(array $children): Content { $this->children = $children; return $this; @@ -182,9 +182,9 @@ public function getUrl(): ?string /** * @param string $url - * @return ConfluencePage + * @return Content */ - public function setUrl(string $url): ConfluencePage + public function setUrl(string $url): Content { $this->url = $url; return $this; @@ -200,9 +200,9 @@ public function getCreatedDate() /** * @param string $createdDate - * @return ConfluencePage + * @return Content */ - public function setCreatedDate(string $createdDate): ConfluencePage + public function setCreatedDate(string $createdDate): Content { $this->createdDate = $createdDate; return $this; diff --git a/src/Exception/RequestException.php b/src/Exception/RequestException.php new file mode 100644 index 0000000..2dc1620 --- /dev/null +++ b/src/Exception/RequestException.php @@ -0,0 +1,17 @@ +getBody()->getContents(), $response->getStatusCode(), $previous); + } + +} \ No newline at end of file diff --git a/src/HttpClient/Builder.php b/src/HttpClient/Builder.php new file mode 100644 index 0000000..d623a85 --- /dev/null +++ b/src/HttpClient/Builder.php @@ -0,0 +1,103 @@ +httpClient = $httpClient ?? Psr18ClientDiscovery::find(); + $this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory(); + $this->streamFactory = $streamFactory ?? Psr17FactoryDiscovery::findStreamFactory(); + $this->uriFactory = $uriFactory ?? Psr17FactoryDiscovery::findUriFactory(); + } + + /** + * Add a new plugin to the end of the plugin chain. + * + * @param Plugin $plugin + * + * @return void + */ + public function addPlugin(Plugin $plugin): void + { + $this->plugins[] = $plugin; + $this->pluginClient = null; + } + + /** + * Remove a plugin by its fully qualified class name (FQCN). + * + * @param string $fqcn + * + * @return void + */ + public function removePlugin(string $fqcn): void + { + foreach ($this->plugins as $idx => $plugin) { + if ($plugin instanceof $fqcn) { + unset($this->plugins[$idx]); + $this->pluginClient = null; + } + } + } + + /** + * @return HttpMethodsClientInterface + */ + public function getHttpClient(): HttpMethodsClientInterface + { + if (null === $this->pluginClient) { + $this->pluginClient = new HttpMethodsClient( + (new PluginClientFactory())->createClient($this->httpClient, $this->plugins), + $this->requestFactory, + $this->streamFactory + ); + } + + return $this->pluginClient; + } + + /** + * Get the URI factory. + * + * @return UriFactoryInterface + */ + public function getUriFactory(): UriFactoryInterface + { + return $this->uriFactory; + } +} \ No newline at end of file diff --git a/src/HttpClient/Plugin/TokenAuthentication.php b/src/HttpClient/Plugin/TokenAuthentication.php new file mode 100644 index 0000000..2346526 --- /dev/null +++ b/src/HttpClient/Plugin/TokenAuthentication.php @@ -0,0 +1,25 @@ +token = $token; + } + + public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise + { + return $next($request->withHeader('Authorization', sprintf('Bearer %s', $this->token))); + } +} \ No newline at end of file diff --git a/tests/Tests/Entity/ConfluencePageTest.php b/tests/Entity/ContentTest.php similarity index 65% rename from tests/Tests/Entity/ConfluencePageTest.php rename to tests/Entity/ContentTest.php index dd24d65..398ab76 100644 --- a/tests/Tests/Entity/ConfluencePageTest.php +++ b/tests/Entity/ContentTest.php @@ -7,22 +7,22 @@ * file that was distributed with this source code. */ -namespace CloudPlayDev\ConfluenceClient\Tests\Entity; +namespace CloudPlayDev\Tests\ConfluenceClient\Entity; -use CloudPlayDev\ConfluenceClient\Entity\ConfluencePage; +use CloudPlayDev\ConfluenceClient\Entity\Content; use PHPUnit\Framework\TestCase; /** * Class ConfluencePageModelTest */ -class ConfluencePageTest extends TestCase +class ContentTest extends TestCase { /** * Test get space */ public function testGetSpace(): void { - $confluencePage = new ConfluencePage(); + $confluencePage = new Content(); self::assertNull($confluencePage->getSpace()); } @@ -31,8 +31,8 @@ public function testGetSpace(): void */ public function testSetSpace(): void { - self::assertClassHasAttribute('space', ConfluencePage::class); - $confluencePage = new ConfluencePage(); + self::assertClassHasAttribute('space', Content::class); + $confluencePage = new Content(); $confluencePage->setSpace('TEST'); static::assertSame('TEST', $confluencePage->getSpace()); } @@ -42,8 +42,8 @@ public function testSetSpace(): void */ public function testSetId(): void { - self::assertClassHasAttribute('id', ConfluencePage::class); - $confluencePage = new ConfluencePage(); + self::assertClassHasAttribute('id', Content::class); + $confluencePage = new Content(); $confluencePage->setId(123); self::assertSame(123, $confluencePage->getId()); } diff --git a/tests/HttpClient/Plugin/TokenAuthenticationTest.php b/tests/HttpClient/Plugin/TokenAuthenticationTest.php new file mode 100644 index 0000000..02bba00 --- /dev/null +++ b/tests/HttpClient/Plugin/TokenAuthenticationTest.php @@ -0,0 +1,41 @@ +first = static function () {}; + } + + public function testCanAddTokenHeader(): void + { + $token = 'someTestToken'; + $plugin = new TokenAuthentication($token); + + $verify = function (RequestInterface $request) use ($token) { + + static::assertTrue($request->hasHeader('Authorization')); + static::assertSame('Bearer ' . $token, $request->getHeaderLine('Authorization')); + + return new HttpFulfilledPromise(new Response()); + }; + + $request = new Request('GET', 'https://example.com'); + $plugin->handleRequest($request, $verify, $this->first); + } +} diff --git a/tests/Tests/ClientTest.php b/tests/Tests/ClientTest.php deleted file mode 100644 index a224a18..0000000 --- a/tests/Tests/ClientTest.php +++ /dev/null @@ -1,121 +0,0 @@ -getMockBuilder(Curl::class) - ->setConstructorArgs([$url, $username, $password]) - ->getMock(); - $curl->expects(self::once()) - ->method('setOptions') - ->willReturnSelf(); - $curl->expects(self::once()) - ->method('execute') - ->willReturn('{"result":true}'); - $client = new Client($curl); - $page = new ConfluencePage(); - $response = $client->createPage($page); - - static::assertIsArray($response); - self::assertEquals(['result' => true], $response); - } - - /** - * Test search page - */ - public function testSelectBy(): void - { - $url = 'some/url'; - $username = 'username'; - $password = 'password'; - $curl = $this->getMockBuilder(Curl::class) - ->setConstructorArgs([$url, $username, $password]) - ->getMock(); - $curl->expects(self::once()) - ->method('setOptions') - ->willReturnSelf(); - $curl->expects(self::once()) - ->method('execute') - ->willReturn('{"result":true}'); - $response = (new Client($curl))->selectPageBy(['title' => 'test']); - - self::assertNull($response); - } - - /** - * Test request function - */ - public function testRequest(): void - { - $url = 'some/url'; - $username = 'username'; - $password = 'password'; - $curl = $this->getMockBuilder(Curl::class) - ->setConstructorArgs([$url, $username, $password]) - ->getMock(); - $curl->expects(self::once()) - ->method('setOptions') - ->willReturnSelf(); - $curl->expects(self::once()) - ->method('setOption') - ->willReturnSelf(); - $curl->expects(self::once()) - ->method('execute') - ->willReturn('{"result":true}'); - $response = (new Client($curl))->request('POST', $url, ['id' => 123]); - - self::assertIsArray($response); - self::assertEquals(['result'=>true], $response); - } - - /** - * Test the exception when put invalid method - */ - public function testRequestWithInvalidMethod(): void - { - $this->expectException(Exception::class); - $this->expectExceptionMessageMatches('#.*Invalid method.*#'); - $url = 'some/url'; - $username = 'username'; - $password = 'password'; - $curl = $this->getMockBuilder(Curl::class) - ->setConstructorArgs([$url, $username, $password]) - ->getMock(); - $curl - ->method('setOptions') - ->willReturnSelf(); - $curl - ->method('setOption') - ->willReturnSelf(); - $curl - ->method('execute') - ->willReturn(['result' => true]); - $client = new Client($curl); - $client->request('TEST', $url, ['id' => 123]); - } -} \ No newline at end of file