From b98ecc702495ba404e85234c539a9dc16b1f120e Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov Date: Thu, 30 Jul 2020 19:25:40 +0700 Subject: [PATCH 01/73] Use new default password for integration testing --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0862227d..c13b384f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: build: . environment: REMOTE_URL: https://plesk:8443 - REMOTE_PASSWORD: changeme + REMOTE_PASSWORD: changeme1Q** command: bash -c "cd /opt/api-php-lib && composer install && ./wait-for-plesk.sh && composer test -- --testdox" depends_on: - plesk From 3428abccacf3c895eb52fc235b971336b1be7868 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov Date: Thu, 30 Jul 2020 21:23:08 +0700 Subject: [PATCH 02/73] Fix redirect handling in case of latest Plesk --- wait-for-plesk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wait-for-plesk.sh b/wait-for-plesk.sh index 98c90dd8..beaa48d6 100755 --- a/wait-for-plesk.sh +++ b/wait-for-plesk.sh @@ -2,7 +2,7 @@ ### Copyright 1999-2020. Plesk International GmbH. while : ; do - curl -ks https://plesk:8443/ | grep "Plesk" > /dev/null + curl -ksL https://plesk:8443/ | grep "<title>Plesk" > /dev/null [ $? -eq 0 ] && break sleep 5 done From 47f5f2e7b03bd088f35c84c6c10187bcc4698bcc Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 30 Jul 2020 21:34:11 +0700 Subject: [PATCH 03/73] Make StyleCI a little bit happier --- tests/TestCase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index c5c855e4..ac1378e3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -60,7 +60,8 @@ protected static function _createWebspace() [ 'name' => "test{$id}.test", 'ip_address' => static::_getIpAddress(), - ], [ + ], + [ 'ftp_login' => "u{$id}", 'ftp_password' => PasswordProvider::STRONG_PASSWORD, ] From 3285435cd86d57f8a0996806439812627cec619f Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 30 Jul 2020 19:14:35 +0700 Subject: [PATCH 04/73] Switch to PHPUnit 9 --- composer.json | 2 +- composer.lock | 1115 +++++++++++++++++++++++++++------------ tests/IpTest.php | 2 +- tests/SecretKeyTest.php | 2 +- tests/ServerTest.php | 2 +- 5 files changed, 789 insertions(+), 334 deletions(-) diff --git a/composer.json b/composer.json index 9e5857eb..9ca7bacc 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "ext-simplexml": "*" }, "require-dev": { - "phpunit/phpunit": "^8", + "phpunit/phpunit": "^9", "spatie/phpunit-watcher": "^1.22" }, "config": { diff --git a/composer.lock b/composer.lock index 392b946c..f5f3cb85 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "91bba94ac759a4ec871837c6636d457c", + "content-hash": "554cb70d6a29bd690fd9e966b98003d0", "packages": [], "packages-dev": [ { @@ -179,20 +179,20 @@ }, { "name": "doctrine/instantiator", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", @@ -231,7 +231,7 @@ "constructor", "instantiate" ], - "time": "2019-10-21T16:45:58+00:00" + "time": "2020-05-29T17:27:14+00:00" }, { "name": "evenement/evenement", @@ -278,25 +278,26 @@ }, { "name": "jolicode/jolinotif", - "version": "v2.0.2", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/jolicode/JoliNotif.git", - "reference": "0b5f786c5f181b3916df616ca191892713257662" + "reference": "52f5b98f964f6009b8ec4c0e951edcd0862e2ac7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/0b5f786c5f181b3916df616ca191892713257662", - "reference": "0b5f786c5f181b3916df616ca191892713257662", + "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/52f5b98f964f6009b8ec4c0e951edcd0862e2ac7", + "reference": "52f5b98f964f6009b8ec4c0e951edcd0862e2ac7", "shasum": "" }, "require": { "php": ">=7.0", - "symfony/process": "~3.3|~4.0" + "symfony/process": "^3.3|^4.0|^5.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.0", - "symfony/phpunit-bridge": "^3.3" + "friendsofphp/php-cs-fixer": "^2.0", + "symfony/finder": "^3.3|^4.0|^5.0", + "symfony/phpunit-bridge": "^3.4.26|^4.0|^5.0" }, "bin": [ "jolinotif" @@ -304,7 +305,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -330,24 +331,24 @@ "notification", "windows" ], - "time": "2019-02-26T18:10:50+00:00" + "time": "2020-06-17T08:25:38+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.4", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "replace": { "myclabs/deep-copy": "self.version" @@ -378,7 +379,7 @@ "object", "object graph" ], - "time": "2019-12-15T19:12:40+00:00" + "time": "2020-06-29T13:22:24+00:00" }, { "name": "phar-io/manifest", @@ -484,28 +485,25 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~6" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -532,45 +530,41 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.4", + "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" + "reference": "3170448f5769fe19f456173d833734e0ff1b84df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/3170448f5769fe19f456173d833734e0ff1b84df", + "reference": "3170448f5769fe19f456173d833734e0ff1b84df", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpdocumentor/type-resolver": "0.4.*", - "phpunit/phpunit": "^6.4" + "mockery/mockery": "~1.3.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -581,38 +575,40 @@ { "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.", - "time": "2019-12-28T18:55:12+00:00" + "time": "2020-07-20T20:05:34+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.0.1", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", + "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.2 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "ext-tokenizer": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { @@ -631,37 +627,37 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "time": "2020-06-27T10:12:23+00:00" }, { "name": "phpspec/prophecy", - "version": "1.10.1", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc" + "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", + "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "doctrine/instantiator": "^1.2", + "php": "^7.2", + "phpdocumentor/reflection-docblock": "^5.0", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.11.x-dev" } }, "autoload": { @@ -694,44 +690,45 @@ "spy", "stub" ], - "time": "2019-12-22T21:05:45+00:00" + "time": "2020-07-08T12:44:21+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "7.0.10", + "version": "8.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" + "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", - "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca6647ffddd2add025ab3f21644a441d7c146cdc", + "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.1", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", + "php": "^7.3", + "phpunit/php-file-iterator": "^3.0", + "phpunit/php-text-template": "^2.0", + "phpunit/php-token-stream": "^4.0", + "sebastian/code-unit-reverse-lookup": "^2.0", + "sebastian/environment": "^5.0", + "sebastian/version": "^3.0", "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^8.2.2" + "phpunit/phpunit": "^9.0" }, "suggest": { - "ext-xdebug": "^2.7.2" + "ext-pcov": "*", + "ext-xdebug": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "8.0-dev" } }, "autoload": { @@ -757,32 +754,32 @@ "testing", "xunit" ], - "time": "2019-11-20T13:55:58+00:00" + "time": "2020-05-23T08:02:54+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.2", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" + "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/25fefc5b19835ca653877fe081644a3f8c1d915e", + "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -807,26 +804,87 @@ "filesystem", "iterator" ], - "time": "2018-09-13T20:33:42+00:00" + "time": "2020-07-11T05:18:21+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f6eedfed1085dd1f4c599629459a0277d25f9a66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f6eedfed1085dd1f4c599629459a0277d25f9a66", + "reference": "f6eedfed1085dd1f4c599629459a0277d25f9a66", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "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": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "time": "2020-06-26T11:53:53+00:00" }, { "name": "phpunit/php-text-template", - "version": "1.2.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", + "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -848,32 +906,32 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2020-06-26T11:55:37+00:00" }, { "name": "phpunit/php-timer", - "version": "2.1.2", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/cc49734779cbb302bf51a44297dab8c4bbf941e7", + "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -897,33 +955,33 @@ "keywords": [ "timer" ], - "time": "2019-06-07T04:22:29+00:00" + "time": "2020-06-26T11:58:13+00:00" }, { "name": "phpunit/php-token-stream", - "version": "3.1.1", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5672711b6b07b14d5ab694e700c62eeb82fcf374", + "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.1" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -946,56 +1004,58 @@ "keywords": [ "tokenizer" ], - "time": "2019-09-17T06:23:10+00:00" + "time": "2020-06-27T06:36:25+00:00" }, { "name": "phpunit/phpunit", - "version": "8.5.1", + "version": "9.2.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2" + "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7870c78da3c5e4883eaef36ae47853ebb3cb86f2", - "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1c6a9e4312e209e659f1fce3ce88dd197c2448f6", + "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2.0", + "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.1", + "myclabs/deep-copy": "^1.9.5", "phar-io/manifest": "^1.0.3", "phar-io/version": "^2.0.1", - "php": "^7.2", - "phpspec/prophecy": "^1.8.1", - "phpunit/php-code-coverage": "^7.0.7", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.2", - "sebastian/exporter": "^3.1.1", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" + "php": "^7.3", + "phpspec/prophecy": "^1.10.3", + "phpunit/php-code-coverage": "^8.0.2", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-invoker": "^3.0.2", + "phpunit/php-text-template": "^2.0.2", + "phpunit/php-timer": "^5.0.1", + "sebastian/code-unit": "^1.0.5", + "sebastian/comparator": "^4.0.3", + "sebastian/diff": "^4.0.1", + "sebastian/environment": "^5.1.2", + "sebastian/exporter": "^4.0.2", + "sebastian/global-state": "^4.0", + "sebastian/object-enumerator": "^4.0.2", + "sebastian/resource-operations": "^3.0.2", + "sebastian/type": "^2.1.1", + "sebastian/version": "^3.0.1" }, "require-dev": { - "ext-pdo": "*" + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0" }, "suggest": { "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" + "ext-xdebug": "*" }, "bin": [ "phpunit" @@ -1003,12 +1063,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.5-dev" + "dev-master": "9.2-dev" } }, "autoload": { "classmap": [ "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1029,7 +1092,7 @@ "testing", "xunit" ], - "time": "2019-12-25T14:49:39+00:00" + "time": "2020-07-13T17:55:55+00:00" }, { "name": "psr/container", @@ -1124,16 +1187,16 @@ }, { "name": "react/stream", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/reactphp/stream.git", - "reference": "50426855f7a77ddf43b9266c22320df5bf6c6ce6" + "reference": "7c02b510ee3f582c810aeccd3a197b9c2f52ff1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/50426855f7a77ddf43b9266c22320df5bf6c6ce6", - "reference": "50426855f7a77ddf43b9266c22320df5bf6c6ce6", + "url": "https://api.github.com/repos/reactphp/stream/zipball/7c02b510ee3f582c810aeccd3a197b9c2f52ff1a", + "reference": "7c02b510ee3f582c810aeccd3a197b9c2f52ff1a", "shasum": "" }, "require": { @@ -1143,7 +1206,7 @@ }, "require-dev": { "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { @@ -1166,32 +1229,78 @@ "stream", "writable" ], - "time": "2019-01-01T16:15:09+00:00" + "time": "2020-05-04T10:17:57+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "c1e2df332c905079980b119c4db103117e5e5c90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/c1e2df332c905079980b119c4db103117e5e5c90", + "reference": "c1e2df332c905079980b119c4db103117e5e5c90", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "time": "2020-06-26T12:50:45+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ee51f9bb0c6d8a43337055db3120829fa14da819", + "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1211,34 +1320,34 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2020-06-26T12:04:00+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f", + "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f", "shasum": "" }, "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": "^7.3 || ^8.0", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1251,6 +1360,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -1262,10 +1375,6 @@ { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", @@ -1275,33 +1384,33 @@ "compare", "equality" ], - "time": "2018-07-12T15:12:46+00:00" + "time": "2020-06-26T12:05:46+00:00" }, { "name": "sebastian/diff", - "version": "3.0.2", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113", + "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^9.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1314,13 +1423,13 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", @@ -1331,27 +1440,27 @@ "unidiff", "unified diff" ], - "time": "2019-02-04T06:01:07+00:00" + "time": "2020-06-30T04:46:02+00:00" }, { "name": "sebastian/environment", - "version": "4.2.3", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2", + "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^9.0" }, "suggest": { "ext-posix": "*" @@ -1359,7 +1468,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1384,34 +1493,34 @@ "environment", "hhvm" ], - "time": "2019-11-20T08:46:58+00:00" + "time": "2020-06-26T12:07:24+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.2", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + "reference": "571d721db4aec847a0e59690b954af33ebf9f023" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/571d721db4aec847a0e59690b954af33ebf9f023", + "reference": "571d721db4aec847a0e59690b954af33ebf9f023", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "php": "^7.3 || ^8.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1451,30 +1560,30 @@ "export", "exporter" ], - "time": "2019-09-14T09:02:43+00:00" + "time": "2020-06-26T12:08:55+00:00" }, { "name": "sebastian/global-state", - "version": "3.0.0", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" + "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bdb1e7c79e592b8c82cb1699be3c8743119b8a72", + "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72", "shasum": "" }, "require": { - "php": "^7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": "^7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^9.0" }, "suggest": { "ext-uopz": "*" @@ -1482,7 +1591,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1505,34 +1614,34 @@ "keywords": [ "global state" ], - "time": "2019-02-01T05:30:01+00:00" + "time": "2020-02-07T06:11:37+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/074fed2d0a6d08e1677dd8ce9d32aecb384917b8", + "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": "^7.3 || ^8.0", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1552,32 +1661,32 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "time": "2020-06-26T12:11:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "reference": "127a46f6b057441b201253526f81d5406d6c7840" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/127a46f6b057441b201253526f81d5406d6c7840", + "reference": "127a46f6b057441b201253526f81d5406d6c7840", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1597,32 +1706,32 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2020-06-26T12:12:55+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/062231bf61d2b9448c4fa5a7643b5e1829c11d63", + "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1635,14 +1744,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" @@ -1650,29 +1759,32 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "time": "2020-06-26T12:14:17+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + "reference": "0653718a5a629b065e91f774595267f8dc32e213" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0653718a5a629b065e91f774595267f8dc32e213", + "reference": "0653718a5a629b065e91f774595267f8dc32e213", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1692,32 +1804,32 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" + "time": "2020-06-26T12:16:22+00:00" }, { "name": "sebastian/type", - "version": "1.1.3", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/86991e2b33446cd96e648c18bcdb1e95afb2c05a", + "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a", "shasum": "" }, "require": { - "php": "^7.2" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^8.2" + "phpunit/phpunit": "^9.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -1738,29 +1850,29 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", - "time": "2019-07-02T08:10:15+00:00" + "time": "2020-07-05T08:31:53+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "626586115d0ed31cb71483be55beb759b5af5a3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/626586115d0ed31cb71483be55beb759b5af5a3c", + "reference": "626586115d0ed31cb71483be55beb759b5af5a3c", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "^7.3 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1781,7 +1893,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2020-06-26T12:18:43+00:00" }, { "name": "spatie/phpunit-watcher", @@ -1843,26 +1955,29 @@ }, { "name": "symfony/console", - "version": "v5.0.2", + "version": "v5.1.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47" + "reference": "2226c68009627934b8cfc01260b4d287eab070df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fe6e3cd889ca64172d7a742a2eb058541404ef47", - "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47", + "url": "https://api.github.com/repos/symfony/console/zipball/2226c68009627934b8cfc01260b4d287eab070df", + "reference": "2226c68009627934b8cfc01260b4d287eab070df", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" }, "conflict": { "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", "symfony/lock": "<4.4", "symfony/process": "<4.4" @@ -1888,7 +2003,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1915,29 +2030,79 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-12-17T13:20:22+00:00" + "time": "2020-07-06T13:23:11+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.1.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5e20b83385a77593259c9f8beb2c43cd03b2ac14", + "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-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", + "time": "2020-06-06T08:49:21+00:00" }, { "name": "symfony/finder", - "version": "v5.0.2", + "version": "v5.1.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "17874dd8ab9a19422028ad56172fb294287a701b" + "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/17874dd8ab9a19422028ad56172fb294287a701b", - "reference": "17874dd8ab9a19422028ad56172fb294287a701b", + "url": "https://api.github.com/repos/symfony/finder/zipball/4298870062bfc667cb78d2b379be4bf5dec5f187", + "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1964,20 +2129,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-05-20T17:43:50+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { @@ -1989,7 +2154,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2022,20 +2191,151 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.18.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.18.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "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 for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "shasum": "" }, "require": { @@ -2047,7 +2347,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2081,20 +2385,20 @@ "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.13.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca", "shasum": "" }, "require": { @@ -2103,7 +2407,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2139,29 +2447,96 @@ "portable", "shim" ], - "time": "2019-11-27T16:25:15+00:00" + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.18.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "shasum": "" + }, + "require": { + "php": ">=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-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" + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/process", - "version": "v4.4.2", + "version": "v5.1.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b" + "reference": "1864216226af21eb76d9477f691e7cbf198e0402" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b84501ad50adb72a94fb460a5b5c91f693e99c9b", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b", + "url": "https://api.github.com/repos/symfony/process/zipball/1864216226af21eb76d9477f691e7cbf198e0402", + "reference": "1864216226af21eb76d9477f691e7cbf198e0402", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -2188,24 +2563,24 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-12-06T10:06:46+00:00" + "time": "2020-07-23T08:36:24+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442", + "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -2214,7 +2589,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2246,24 +2625,96 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-07-06T13:23:11+00:00" + }, + { + "name": "symfony/string", + "version": "v5.1.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/f629ba9b611c76224feb21fe2bcbf0b6f992300b", + "reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "time": "2020-07-08T08:27:49+00:00" }, { "name": "symfony/yaml", - "version": "v5.0.2", + "version": "v5.1.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "847661e77afa48d99ecfa508e8b60f0b029a19c0" + "reference": "ea342353a3ef4f453809acc4ebc55382231d4d23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/847661e77afa48d99ecfa508e8b60f0b029a19c0", - "reference": "847661e77afa48d99ecfa508e8b60f0b029a19c0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ea342353a3ef4f453809acc4ebc55382231d4d23", + "reference": "ea342353a3ef4f453809acc4ebc55382231d4d23", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -2275,10 +2726,13 @@ "suggest": { "symfony/console": "For validating YAML files using the lint command" }, + "bin": [ + "Resources/bin/yaml-lint" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -2305,27 +2759,27 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-12-10T11:06:55+00:00" + "time": "2020-05-20T17:43:50+00:00" }, { "name": "theseer/tokenizer", - "version": "1.1.3", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "reference": "75a63c33a8577608444246075ea0af0d052e452a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -2345,28 +2799,29 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" + "time": "2020-07-12T23:59:07+00:00" }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": "^5.3.3 || ^7.0 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "vimeo/psalm": "<3.6.0" + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" @@ -2393,7 +2848,7 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+00:00" + "time": "2020-07-08T17:02:28+00:00" }, { "name": "yosymfony/resource-watcher", diff --git a/tests/IpTest.php b/tests/IpTest.php index 683aa5f1..28f4d996 100644 --- a/tests/IpTest.php +++ b/tests/IpTest.php @@ -11,6 +11,6 @@ public function testGet() $this->assertGreaterThan(0, count($ips)); $ip = reset($ips); - $this->assertRegExp('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $ip->ipAddress); + $this->assertMatchesRegularExpression('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $ip->ipAddress); } } diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php index 7ac6a313..e9c392a5 100644 --- a/tests/SecretKeyTest.php +++ b/tests/SecretKeyTest.php @@ -10,7 +10,7 @@ class SecretKeyTest extends TestCase public function testCreate() { $keyId = static::$_client->secretKey()->create('192.168.0.1'); - $this->assertRegExp('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $keyId); + $this->assertMatchesRegularExpression('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $keyId); static::$_client->secretKey()->delete($keyId); } diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 419002ae..1018fd97 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -16,7 +16,7 @@ public function testGetGenInfo() { $generalInfo = static::$_client->server()->getGeneralInfo(); $this->assertGreaterThan(0, strlen($generalInfo->serverName)); - $this->assertRegExp('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', strtolower($generalInfo->serverGuid)); + $this->assertMatchesRegularExpression('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', strtolower($generalInfo->serverGuid)); $this->assertEquals('standard', $generalInfo->mode); } From f8d6be57399212f6da837ba08ee95933e0ef05da Mon Sep 17 00:00:00 2001 From: Vladimir Selliakhov <vselliakhov@plesk.com> Date: Wed, 16 Dec 2020 17:18:02 +0700 Subject: [PATCH 05/73] Added method for a bulk create and delete DNS records --- src/Api/Operator/Dns.php | 53 ++++++++++++++++++++++++++++++++++++ tests/DnsTest.php | 58 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/src/Api/Operator/Dns.php b/src/Api/Operator/Dns.php index 8b7e3f04..a10449b6 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -24,6 +24,34 @@ public function create($properties) return new Struct\Info($this->_client->request($packet)); } + /** + * Send multiply records by one request. + * + * @param array $records + * + * @return \PleskX\Api\XmlResponse[] + */ + public function bulkCreate(array $records) + { + $packet = $this->_client->getPacket(); + + foreach ($records as $properties) { + $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec'); + + foreach ($properties as $name => $value) { + $info->addChild($name, $value); + } + } + + $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $items = []; + foreach ($response->xpath('//result') as $xmlResult) { + $items[] = $xmlResult; + } + + return $items; + } + /** * @param string $field * @param int|string $value @@ -74,4 +102,29 @@ public function delete($field, $value) { return $this->_delete($field, $value, 'del_rec'); } + + /** + * Delete multiply records by one request. + * + * @param array $recordIds + * + * @return \PleskX\Api\XmlResponse[] + */ + public function bulkDelete(array $recordIds) + { + $packet = $this->_client->getPacket(); + + foreach ($recordIds as $recordId) { + $packet->addChild($this->_wrapperTag)->addChild('del_rec') + ->addChild('filter')->addChild('id', $recordId); + } + + $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $items = []; + foreach ($response->xpath('//result') as $xmlResult) { + $items[] = $xmlResult; + } + + return $items; + } } diff --git a/tests/DnsTest.php b/tests/DnsTest.php index 5feadcac..633f50d7 100644 --- a/tests/DnsTest.php +++ b/tests/DnsTest.php @@ -44,6 +44,64 @@ public function testCreate() static::$_client->dns()->delete('id', $dns->id); } + /** + * @return \PleskX\Api\XmlResponse[] + */ + public function testBulkCreate() + { + $response = static::$_client->dns()->bulkCreate([ + [ + 'site-id' => static::$webspace->id, + 'type' => 'TXT', + 'host' => 'host', + 'value' => 'value', + ], + [ + 'site-id' => static::$webspace->id, + 'type' => 'A', + 'host' => 'host', + 'value' => '1.1.1.1', + ], + [ + 'site-id' => static::$webspace->id, + 'type' => 'MX', + 'host' => 'custom-mail', + 'value' => '1.1.1.1', + 'opt' => '10', + ], + ]); + + $this->assertCount(3, $response); + + foreach ($response as $xml) { + $this->assertEquals('ok', (string) $xml->status); + $this->assertGreaterThan(0, (int) $xml->id); + } + + return $response; + } + + /** + * @depends testBulkCreate + * + * @param \PleskX\Api\XmlResponse[] $createdRecords + */ + public function testBulkDelete(array $createdRecords) + { + $createdRecordIds = array_map(function ($record) { + return (int) $record->id; + }, $createdRecords); + + $response = static::$_client->dns()->bulkDelete($createdRecordIds); + + $this->assertCount(3, $response); + + foreach ($response as $xml) { + $this->assertEquals('ok', (string) $xml->status); + $this->assertGreaterThan(0, (int) $xml->id); + } + } + public function testGetById() { $dns = static::$_client->dns()->create([ From 1b2efa8717fc946e3af84f2678970418ed016b6d Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 17 Dec 2020 12:10:56 +0700 Subject: [PATCH 06/73] Fix assertion after switching to PHPUnit 9 --- tests/DnsTemplateTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DnsTemplateTest.php b/tests/DnsTemplateTest.php index 7eafebff..1d579d7b 100644 --- a/tests/DnsTemplateTest.php +++ b/tests/DnsTemplateTest.php @@ -34,7 +34,7 @@ public function testCreate() 'host' => 'test.create', 'value' => 'value', ]); - $this->assertInternalType('integer', $dns->id); + $this->assertIsInt($dns->id); $this->assertGreaterThan(0, $dns->id); $this->assertEquals(0, $dns->siteId); $this->assertEquals(0, $dns->siteAliasId); From e86a2010a15c6866086707da96ed2ccdbfd7e8cc Mon Sep 17 00:00:00 2001 From: Vyacheslav Ovchinnikov <vovchinnikov@plesk.com> Date: Wed, 23 Dec 2020 13:12:37 +0700 Subject: [PATCH 07/73] New SecretKeys response format support --- tests/SecretKeyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php index e9c392a5..026683c4 100644 --- a/tests/SecretKeyTest.php +++ b/tests/SecretKeyTest.php @@ -19,7 +19,7 @@ public function testGet() $keyId = static::$_client->secretKey()->create('192.168.0.1'); $keyInfo = static::$_client->secretKey()->get($keyId); - $this->assertEquals($keyId, $keyInfo->key); + $this->assertNotEmpty($keyInfo->key); $this->assertEquals('192.168.0.1', $keyInfo->ipAddress); $this->assertEquals('admin', $keyInfo->login); From 7626f9c7fa6e318a6c5fae743b49683546f843af Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sat, 9 Jan 2021 19:39:40 +0700 Subject: [PATCH 08/73] Fix incorrect XML creation for delete requests --- src/Api/Operator.php | 8 +++++++- src/Api/Operator/Webspace.php | 2 +- src/Api/Struct/Webspace/Info.php | 6 +++++- tests/WebspaceTest.php | 8 ++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/Api/Operator.php b/src/Api/Operator.php index 427bd993..fc83d66c 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -54,7 +54,13 @@ public function request($request, $mode = Client::RESPONSE_SHORT) */ protected function _delete($field, $value, $deleteMethodName = 'del') { - $response = $this->request("$deleteMethodName.filter.$field=$value"); + $response = $this->request([ + $deleteMethodName => [ + 'filter' => [ + $field => $value, + ], + ], + ]); return 'ok' === (string) $response->status; } diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index b530b55b..132bee72 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -96,7 +96,7 @@ public function create(array $properties, array $hostingProperties = null, $plan $response = $this->_client->request($packet); - return new Struct\Info($response); + return new Struct\Info($response, $properties['name'] ?? ''); } /** diff --git a/src/Api/Struct/Webspace/Info.php b/src/Api/Struct/Webspace/Info.php index a39d709a..c33f8a4a 100644 --- a/src/Api/Struct/Webspace/Info.php +++ b/src/Api/Struct/Webspace/Info.php @@ -11,11 +11,15 @@ class Info extends \PleskX\Api\Struct /** @var string */ public $guid; - public function __construct($apiResponse) + /** @var string */ + public $name; + + public function __construct($apiResponse, $name = '') { $this->_initScalarProperties($apiResponse, [ 'id', 'guid', ]); + $this->name = $name; } } diff --git a/tests/WebspaceTest.php b/tests/WebspaceTest.php index 3cc18759..0e388b89 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceTest.php @@ -80,6 +80,14 @@ public function testDelete() $this->assertTrue($result); } + public function testDeleteByName() + { + $webspace = static::_createWebspace(); + $result = static::$_client->webspace()->delete('name', $webspace->name); + + $this->assertTrue($result); + } + public function testRequestCreateWebspace() { $handlers = static::$_client->phpHandler()->getAll(); From b0eecee352af55f9436c1602ef771f24acd7932f Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sat, 9 Jan 2021 21:24:23 +0700 Subject: [PATCH 09/73] Add an ability to use proxy server --- src/Api/Client.php | 15 +++++++++++++++ tests/TestCase.php | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/src/Api/Client.php b/src/Api/Client.php index 2c456553..c74cd91d 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -18,6 +18,7 @@ class Client protected $_protocol; protected $_login; protected $_password; + protected $_proxy = ''; protected $_secretKey; protected $_version = ''; @@ -64,6 +65,16 @@ public function setSecretKey($secretKey) $this->_secretKey = $secretKey; } + /** + * Set proxy server for requests + * + * @param string $proxy + */ + public function setProxy($proxy) + { + $this->_proxy = $proxy; + } + /** * Set default version for requests. * @@ -188,6 +199,10 @@ private function _performHttpRequest($request) curl_setopt($curl, CURLOPT_HTTPHEADER, $this->_getHeaders()); curl_setopt($curl, CURLOPT_POSTFIELDS, $request); + if ('' !== $this->_proxy) { + curl_setopt($curl, CURLOPT_PROXY, $this->_proxy); + } + $result = curl_exec($curl); if (false === $result) { diff --git a/tests/TestCase.php b/tests/TestCase.php index ac1378e3..b17f15f3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -27,6 +27,10 @@ public static function setUpBeforeClass(): void static::$_client = new \PleskX\Api\Client($host, $port, $scheme); static::$_client->setCredentials($login, $password); + + if ($proxy = getenv('REMOTE_PROXY')) { + static::$_client->setProxy($proxy); + } } public static function tearDownAfterClass(): void From a1bbe188f9b64b7f46048695d05ba1d26216596b Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sat, 9 Jan 2021 21:25:58 +0700 Subject: [PATCH 10/73] Fix doc style --- src/Api/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index c74cd91d..c467d083 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -66,7 +66,7 @@ public function setSecretKey($secretKey) } /** - * Set proxy server for requests + * Set proxy server for requests. * * @param string $proxy */ From e634b7830cd4789b106465334dcb54367cd9afe8 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sat, 9 Jan 2021 21:57:08 +0700 Subject: [PATCH 11/73] Use Docker access token for TravisCI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e38b9d80..d7ea2e8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ services: docker script: + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker-compose run tests From 1e06f0cbd94ac3da022cfc836dbf543234e9136f Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 13:51:25 +0700 Subject: [PATCH 12/73] Use a special image for tests --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c13b384f..501c85a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: plesk: - image: plesk/plesk + image: plesk/plesk:tests logging: driver: none ports: From a484fc923970c7cec7233dbbb2faf31c1a212df1 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 14:00:06 +0700 Subject: [PATCH 13/73] Update copyright year --- LICENSE | 2 +- phpunit.xml.dist | 2 +- src/Api/Client.php | 2 +- src/Api/Client/Exception.php | 2 +- src/Api/Exception.php | 2 +- src/Api/InternalClient.php | 2 +- src/Api/Operator.php | 2 +- src/Api/Operator/Aps.php | 2 +- src/Api/Operator/Certificate.php | 2 +- src/Api/Operator/Customer.php | 2 +- src/Api/Operator/Database.php | 2 +- src/Api/Operator/DatabaseServer.php | 2 +- src/Api/Operator/Dns.php | 2 +- src/Api/Operator/DnsTemplate.php | 2 +- src/Api/Operator/EventLog.php | 2 +- src/Api/Operator/Ip.php | 2 +- src/Api/Operator/Locale.php | 2 +- src/Api/Operator/LogRotation.php | 2 +- src/Api/Operator/Mail.php | 2 +- src/Api/Operator/PhpHandler.php | 2 +- src/Api/Operator/ProtectedDirectory.php | 2 +- src/Api/Operator/Reseller.php | 2 +- src/Api/Operator/ResellerPlan.php | 2 +- src/Api/Operator/SecretKey.php | 2 +- src/Api/Operator/Server.php | 2 +- src/Api/Operator/ServicePlan.php | 2 +- src/Api/Operator/ServicePlanAddon.php | 2 +- src/Api/Operator/Session.php | 2 +- src/Api/Operator/Site.php | 2 +- src/Api/Operator/SiteAlias.php | 2 +- src/Api/Operator/Subdomain.php | 2 +- src/Api/Operator/Ui.php | 2 +- src/Api/Operator/VirtualDirectory.php | 2 +- src/Api/Operator/Webspace.php | 2 +- src/Api/Struct.php | 2 +- src/Api/Struct/Certificate/Info.php | 2 +- src/Api/Struct/Customer/GeneralInfo.php | 2 +- src/Api/Struct/Customer/Info.php | 2 +- src/Api/Struct/Database/Info.php | 2 +- src/Api/Struct/Database/UserInfo.php | 2 +- src/Api/Struct/DatabaseServer/Info.php | 2 +- src/Api/Struct/Dns/Info.php | 2 +- src/Api/Struct/EventLog/DetailedEvent.php | 2 +- src/Api/Struct/EventLog/Event.php | 2 +- src/Api/Struct/Ip/Info.php | 2 +- src/Api/Struct/Locale/Info.php | 2 +- src/Api/Struct/Mail/Info.php | 2 +- src/Api/Struct/PhpHandler/Info.php | 2 +- src/Api/Struct/ProtectedDirectory/DataInfo.php | 2 +- src/Api/Struct/ProtectedDirectory/Info.php | 2 +- src/Api/Struct/ProtectedDirectory/UserInfo.php | 2 +- src/Api/Struct/Reseller/GeneralInfo.php | 2 +- src/Api/Struct/Reseller/Info.php | 2 +- src/Api/Struct/SecretKey/Info.php | 2 +- src/Api/Struct/Server/Admin.php | 2 +- src/Api/Struct/Server/GeneralInfo.php | 2 +- src/Api/Struct/Server/Preferences.php | 2 +- src/Api/Struct/Server/SessionPreferences.php | 2 +- src/Api/Struct/Server/Statistics.php | 2 +- src/Api/Struct/Server/Statistics/Objects.php | 2 +- src/Api/Struct/Server/Statistics/Version.php | 2 +- src/Api/Struct/Server/UpdatesInfo.php | 2 +- src/Api/Struct/ServicePlan/Info.php | 2 +- src/Api/Struct/Session/Info.php | 2 +- src/Api/Struct/Site/GeneralInfo.php | 2 +- src/Api/Struct/Site/HostingInfo.php | 2 +- src/Api/Struct/Site/Info.php | 2 +- src/Api/Struct/SiteAlias/GeneralInfo.php | 2 +- src/Api/Struct/SiteAlias/Info.php | 2 +- src/Api/Struct/Subdomain/Info.php | 2 +- src/Api/Struct/Ui/CustomButton.php | 2 +- src/Api/Struct/Webspace/DiskUsage.php | 2 +- src/Api/Struct/Webspace/GeneralInfo.php | 2 +- src/Api/Struct/Webspace/HostingPropertyInfo.php | 2 +- src/Api/Struct/Webspace/Info.php | 2 +- src/Api/Struct/Webspace/Limit.php | 2 +- src/Api/Struct/Webspace/LimitDescriptor.php | 2 +- src/Api/Struct/Webspace/LimitInfo.php | 2 +- src/Api/Struct/Webspace/Limits.php | 2 +- src/Api/Struct/Webspace/PermissionDescriptor.php | 2 +- src/Api/Struct/Webspace/PermissionInfo.php | 2 +- src/Api/Struct/Webspace/PhpSettings.php | 2 +- src/Api/Struct/Webspace/PhysicalHostingDescriptor.php | 2 +- src/Api/XmlResponse.php | 2 +- tests/ApiClientTest.php | 2 +- tests/CertificateTest.php | 2 +- tests/CustomerTest.php | 2 +- tests/DatabaseServerTest.php | 2 +- tests/DatabaseTest.php | 2 +- tests/DnsTemplateTest.php | 2 +- tests/DnsTest.php | 2 +- tests/EventLogTest.php | 2 +- tests/IpTest.php | 2 +- tests/LocaleTest.php | 2 +- tests/MailTest.php | 2 +- tests/PhpHandlerTest.php | 2 +- tests/ProtectedDirectoryTest.php | 2 +- tests/ResellerTest.php | 2 +- tests/SecretKeyTest.php | 2 +- tests/ServerTest.php | 2 +- tests/ServicePlanTest.php | 2 +- tests/SessionTest.php | 2 +- tests/SiteTest.php | 2 +- tests/SubdomainTest.php | 2 +- tests/TestCase.php | 2 +- tests/UiTest.php | 2 +- tests/Utility/KeyLimitChecker.php | 2 +- tests/Utility/PasswordProvider.php | 2 +- tests/WebspaceTest.php | 2 +- wait-for-plesk.sh | 2 +- 110 files changed, 110 insertions(+), 110 deletions(-) diff --git a/LICENSE b/LICENSE index 0176136a..8113e2a4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 1999-2020. Plesk International GmbH. +Copyright 1999-2021. Plesk International GmbH. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bd75a98d..d77e92d9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 1999-2020. Plesk International GmbH. --> +<!-- Copyright 1999-2021. Plesk International GmbH. --> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" diff --git a/src/Api/Client.php b/src/Api/Client.php index c467d083..3f79d3f1 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Client/Exception.php b/src/Api/Client/Exception.php index a59475dd..0d26d30b 100644 --- a/src/Api/Client/Exception.php +++ b/src/Api/Client/Exception.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Client; diff --git a/src/Api/Exception.php b/src/Api/Exception.php index e5f58986..a7ba9663 100644 --- a/src/Api/Exception.php +++ b/src/Api/Exception.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/InternalClient.php b/src/Api/InternalClient.php index fb236c7f..6ec687f2 100644 --- a/src/Api/InternalClient.php +++ b/src/Api/InternalClient.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Operator.php b/src/Api/Operator.php index fc83d66c..f355c2ef 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Operator/Aps.php b/src/Api/Operator/Aps.php index 145456fb..9f4bde31 100644 --- a/src/Api/Operator/Aps.php +++ b/src/Api/Operator/Aps.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Certificate.php b/src/Api/Operator/Certificate.php index 4946e1c6..d82969a6 100644 --- a/src/Api/Operator/Certificate.php +++ b/src/Api/Operator/Certificate.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index 8c54dc5d..6fcaec0d 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Database.php b/src/Api/Operator/Database.php index 4f9d8318..30e1458a 100644 --- a/src/Api/Operator/Database.php +++ b/src/Api/Operator/Database.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/DatabaseServer.php b/src/Api/Operator/DatabaseServer.php index f4856925..482d1d81 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Dns.php b/src/Api/Operator/Dns.php index a10449b6..0c64980e 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index 97a56bfb..4b79df77 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/EventLog.php b/src/Api/Operator/EventLog.php index c3a0d69d..6b7325a7 100644 --- a/src/Api/Operator/EventLog.php +++ b/src/Api/Operator/EventLog.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Ip.php b/src/Api/Operator/Ip.php index 8d8ddf17..4bc87f77 100644 --- a/src/Api/Operator/Ip.php +++ b/src/Api/Operator/Ip.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Locale.php b/src/Api/Operator/Locale.php index 66d1c51c..89991052 100644 --- a/src/Api/Operator/Locale.php +++ b/src/Api/Operator/Locale.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/LogRotation.php b/src/Api/Operator/LogRotation.php index 602e86a3..ef0b60e1 100644 --- a/src/Api/Operator/LogRotation.php +++ b/src/Api/Operator/LogRotation.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Mail.php b/src/Api/Operator/Mail.php index 2fcf7bbe..bf9be11f 100644 --- a/src/Api/Operator/Mail.php +++ b/src/Api/Operator/Mail.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/PhpHandler.php b/src/Api/Operator/PhpHandler.php index 802c7366..66f1ec1d 100644 --- a/src/Api/Operator/PhpHandler.php +++ b/src/Api/Operator/PhpHandler.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ProtectedDirectory.php b/src/Api/Operator/ProtectedDirectory.php index 7630fa82..af643b0a 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Reseller.php b/src/Api/Operator/Reseller.php index baf51c66..9ee8af0c 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ResellerPlan.php b/src/Api/Operator/ResellerPlan.php index 54aeb069..17d533fa 100644 --- a/src/Api/Operator/ResellerPlan.php +++ b/src/Api/Operator/ResellerPlan.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index 8de034c3..677de824 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Server.php b/src/Api/Operator/Server.php index 68899da6..65cbae61 100644 --- a/src/Api/Operator/Server.php +++ b/src/Api/Operator/Server.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index ad803e7d..63408f52 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ServicePlanAddon.php b/src/Api/Operator/ServicePlanAddon.php index e92741cf..0b9e873c 100644 --- a/src/Api/Operator/ServicePlanAddon.php +++ b/src/Api/Operator/ServicePlanAddon.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Session.php b/src/Api/Operator/Session.php index 0c1ec6c9..eb2970bd 100644 --- a/src/Api/Operator/Session.php +++ b/src/Api/Operator/Session.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Site.php b/src/Api/Operator/Site.php index e1b45dbd..170f7e32 100644 --- a/src/Api/Operator/Site.php +++ b/src/Api/Operator/Site.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index caf5c808..65f48c76 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Subdomain.php b/src/Api/Operator/Subdomain.php index bc659ca5..ece56e4b 100644 --- a/src/Api/Operator/Subdomain.php +++ b/src/Api/Operator/Subdomain.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Ui.php b/src/Api/Operator/Ui.php index d963299b..b2ac6576 100644 --- a/src/Api/Operator/Ui.php +++ b/src/Api/Operator/Ui.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/VirtualDirectory.php b/src/Api/Operator/VirtualDirectory.php index 259e050a..1c2ae8b5 100644 --- a/src/Api/Operator/VirtualDirectory.php +++ b/src/Api/Operator/VirtualDirectory.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index 132bee72..e389c576 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Struct.php b/src/Api/Struct.php index aa5a1377..11d509f0 100644 --- a/src/Api/Struct.php +++ b/src/Api/Struct.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Struct/Certificate/Info.php b/src/Api/Struct/Certificate/Info.php index 4fff03ea..7689bcbd 100644 --- a/src/Api/Struct/Certificate/Info.php +++ b/src/Api/Struct/Certificate/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Certificate; diff --git a/src/Api/Struct/Customer/GeneralInfo.php b/src/Api/Struct/Customer/GeneralInfo.php index b5bc28d2..efa1f411 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Customer; diff --git a/src/Api/Struct/Customer/Info.php b/src/Api/Struct/Customer/Info.php index 6374cf00..167b2097 100644 --- a/src/Api/Struct/Customer/Info.php +++ b/src/Api/Struct/Customer/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Customer; diff --git a/src/Api/Struct/Database/Info.php b/src/Api/Struct/Database/Info.php index 0126393e..0066e4a9 100644 --- a/src/Api/Struct/Database/Info.php +++ b/src/Api/Struct/Database/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Database; diff --git a/src/Api/Struct/Database/UserInfo.php b/src/Api/Struct/Database/UserInfo.php index 9f8f0c00..f5cb166d 100644 --- a/src/Api/Struct/Database/UserInfo.php +++ b/src/Api/Struct/Database/UserInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Database; diff --git a/src/Api/Struct/DatabaseServer/Info.php b/src/Api/Struct/DatabaseServer/Info.php index 3186fb2b..57facc61 100644 --- a/src/Api/Struct/DatabaseServer/Info.php +++ b/src/Api/Struct/DatabaseServer/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\DatabaseServer; diff --git a/src/Api/Struct/Dns/Info.php b/src/Api/Struct/Dns/Info.php index 76486278..930c7201 100644 --- a/src/Api/Struct/Dns/Info.php +++ b/src/Api/Struct/Dns/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Dns; diff --git a/src/Api/Struct/EventLog/DetailedEvent.php b/src/Api/Struct/EventLog/DetailedEvent.php index 7a61f0be..d009c08f 100644 --- a/src/Api/Struct/EventLog/DetailedEvent.php +++ b/src/Api/Struct/EventLog/DetailedEvent.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\EventLog; diff --git a/src/Api/Struct/EventLog/Event.php b/src/Api/Struct/EventLog/Event.php index a9469e6a..67fdff88 100644 --- a/src/Api/Struct/EventLog/Event.php +++ b/src/Api/Struct/EventLog/Event.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\EventLog; diff --git a/src/Api/Struct/Ip/Info.php b/src/Api/Struct/Ip/Info.php index d681fc92..ed79a6dc 100644 --- a/src/Api/Struct/Ip/Info.php +++ b/src/Api/Struct/Ip/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Ip; diff --git a/src/Api/Struct/Locale/Info.php b/src/Api/Struct/Locale/Info.php index 44a35f13..619e7a6a 100644 --- a/src/Api/Struct/Locale/Info.php +++ b/src/Api/Struct/Locale/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Locale; diff --git a/src/Api/Struct/Mail/Info.php b/src/Api/Struct/Mail/Info.php index 3396369b..566d00bc 100644 --- a/src/Api/Struct/Mail/Info.php +++ b/src/Api/Struct/Mail/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Mail; diff --git a/src/Api/Struct/PhpHandler/Info.php b/src/Api/Struct/PhpHandler/Info.php index 8cc0c4aa..5a14de6b 100644 --- a/src/Api/Struct/PhpHandler/Info.php +++ b/src/Api/Struct/PhpHandler/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\PhpHandler; diff --git a/src/Api/Struct/ProtectedDirectory/DataInfo.php b/src/Api/Struct/ProtectedDirectory/DataInfo.php index 7ca83d93..5dfe5dd6 100644 --- a/src/Api/Struct/ProtectedDirectory/DataInfo.php +++ b/src/Api/Struct/ProtectedDirectory/DataInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\ProtectedDirectory; diff --git a/src/Api/Struct/ProtectedDirectory/Info.php b/src/Api/Struct/ProtectedDirectory/Info.php index 0152b16a..af3c755c 100644 --- a/src/Api/Struct/ProtectedDirectory/Info.php +++ b/src/Api/Struct/ProtectedDirectory/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\ProtectedDirectory; diff --git a/src/Api/Struct/ProtectedDirectory/UserInfo.php b/src/Api/Struct/ProtectedDirectory/UserInfo.php index da93c296..61f6040f 100644 --- a/src/Api/Struct/ProtectedDirectory/UserInfo.php +++ b/src/Api/Struct/ProtectedDirectory/UserInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\ProtectedDirectory; diff --git a/src/Api/Struct/Reseller/GeneralInfo.php b/src/Api/Struct/Reseller/GeneralInfo.php index e7db41c2..6c5ebd63 100644 --- a/src/Api/Struct/Reseller/GeneralInfo.php +++ b/src/Api/Struct/Reseller/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Reseller; diff --git a/src/Api/Struct/Reseller/Info.php b/src/Api/Struct/Reseller/Info.php index 3a0addc9..a1b6bf80 100644 --- a/src/Api/Struct/Reseller/Info.php +++ b/src/Api/Struct/Reseller/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Reseller; diff --git a/src/Api/Struct/SecretKey/Info.php b/src/Api/Struct/SecretKey/Info.php index 32a7ba49..14d110f9 100644 --- a/src/Api/Struct/SecretKey/Info.php +++ b/src/Api/Struct/SecretKey/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\SecretKey; diff --git a/src/Api/Struct/Server/Admin.php b/src/Api/Struct/Server/Admin.php index 53760331..dfd0d7ac 100644 --- a/src/Api/Struct/Server/Admin.php +++ b/src/Api/Struct/Server/Admin.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/GeneralInfo.php b/src/Api/Struct/Server/GeneralInfo.php index fb74f435..15fee92b 100644 --- a/src/Api/Struct/Server/GeneralInfo.php +++ b/src/Api/Struct/Server/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/Preferences.php b/src/Api/Struct/Server/Preferences.php index 9f8535e6..905656c0 100644 --- a/src/Api/Struct/Server/Preferences.php +++ b/src/Api/Struct/Server/Preferences.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/SessionPreferences.php b/src/Api/Struct/Server/SessionPreferences.php index 44e23b56..654958fa 100644 --- a/src/Api/Struct/Server/SessionPreferences.php +++ b/src/Api/Struct/Server/SessionPreferences.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/Statistics.php b/src/Api/Struct/Server/Statistics.php index 26c0f60d..e15b5c22 100644 --- a/src/Api/Struct/Server/Statistics.php +++ b/src/Api/Struct/Server/Statistics.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/Statistics/Objects.php b/src/Api/Struct/Server/Statistics/Objects.php index 8ef48022..7428b1ae 100644 --- a/src/Api/Struct/Server/Statistics/Objects.php +++ b/src/Api/Struct/Server/Statistics/Objects.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/Statistics/Version.php b/src/Api/Struct/Server/Statistics/Version.php index 56675743..198495c1 100644 --- a/src/Api/Struct/Server/Statistics/Version.php +++ b/src/Api/Struct/Server/Statistics/Version.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/UpdatesInfo.php b/src/Api/Struct/Server/UpdatesInfo.php index 79f899c0..bdd2e7c7 100644 --- a/src/Api/Struct/Server/UpdatesInfo.php +++ b/src/Api/Struct/Server/UpdatesInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/ServicePlan/Info.php b/src/Api/Struct/ServicePlan/Info.php index 3b3edd23..dd53595a 100644 --- a/src/Api/Struct/ServicePlan/Info.php +++ b/src/Api/Struct/ServicePlan/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\ServicePlan; diff --git a/src/Api/Struct/Session/Info.php b/src/Api/Struct/Session/Info.php index cbb4d964..51024cbc 100644 --- a/src/Api/Struct/Session/Info.php +++ b/src/Api/Struct/Session/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Session; diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index 1a31fbdd..481ea626 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Site; diff --git a/src/Api/Struct/Site/HostingInfo.php b/src/Api/Struct/Site/HostingInfo.php index cc981a02..c473d7b8 100644 --- a/src/Api/Struct/Site/HostingInfo.php +++ b/src/Api/Struct/Site/HostingInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Site; diff --git a/src/Api/Struct/Site/Info.php b/src/Api/Struct/Site/Info.php index a2b74107..ea69dd94 100644 --- a/src/Api/Struct/Site/Info.php +++ b/src/Api/Struct/Site/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Site; diff --git a/src/Api/Struct/SiteAlias/GeneralInfo.php b/src/Api/Struct/SiteAlias/GeneralInfo.php index 732fb088..256b5ca0 100644 --- a/src/Api/Struct/SiteAlias/GeneralInfo.php +++ b/src/Api/Struct/SiteAlias/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\SiteAlias; diff --git a/src/Api/Struct/SiteAlias/Info.php b/src/Api/Struct/SiteAlias/Info.php index 133cb0ed..b60fce71 100644 --- a/src/Api/Struct/SiteAlias/Info.php +++ b/src/Api/Struct/SiteAlias/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\SiteAlias; diff --git a/src/Api/Struct/Subdomain/Info.php b/src/Api/Struct/Subdomain/Info.php index 672c1e6d..9e43dafc 100644 --- a/src/Api/Struct/Subdomain/Info.php +++ b/src/Api/Struct/Subdomain/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Subdomain; diff --git a/src/Api/Struct/Ui/CustomButton.php b/src/Api/Struct/Ui/CustomButton.php index ece61a32..ed7a712f 100644 --- a/src/Api/Struct/Ui/CustomButton.php +++ b/src/Api/Struct/Ui/CustomButton.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Ui; diff --git a/src/Api/Struct/Webspace/DiskUsage.php b/src/Api/Struct/Webspace/DiskUsage.php index 80d7f257..320f105a 100644 --- a/src/Api/Struct/Webspace/DiskUsage.php +++ b/src/Api/Struct/Webspace/DiskUsage.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. // Author: Frederic Leclercq namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index d9be8f1a..f5736538 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/HostingPropertyInfo.php b/src/Api/Struct/Webspace/HostingPropertyInfo.php index a663546c..7922d18c 100644 --- a/src/Api/Struct/Webspace/HostingPropertyInfo.php +++ b/src/Api/Struct/Webspace/HostingPropertyInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/Info.php b/src/Api/Struct/Webspace/Info.php index c33f8a4a..d71cef6d 100644 --- a/src/Api/Struct/Webspace/Info.php +++ b/src/Api/Struct/Webspace/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/Limit.php b/src/Api/Struct/Webspace/Limit.php index 5cc064ab..9faf882e 100644 --- a/src/Api/Struct/Webspace/Limit.php +++ b/src/Api/Struct/Webspace/Limit.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/LimitDescriptor.php b/src/Api/Struct/Webspace/LimitDescriptor.php index 36b32d12..e1d383ba 100644 --- a/src/Api/Struct/Webspace/LimitDescriptor.php +++ b/src/Api/Struct/Webspace/LimitDescriptor.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/LimitInfo.php b/src/Api/Struct/Webspace/LimitInfo.php index 718f221a..b8af3b67 100644 --- a/src/Api/Struct/Webspace/LimitInfo.php +++ b/src/Api/Struct/Webspace/LimitInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/Limits.php b/src/Api/Struct/Webspace/Limits.php index 36564826..e6313ea1 100644 --- a/src/Api/Struct/Webspace/Limits.php +++ b/src/Api/Struct/Webspace/Limits.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PermissionDescriptor.php b/src/Api/Struct/Webspace/PermissionDescriptor.php index 959afb0e..bc333ba0 100644 --- a/src/Api/Struct/Webspace/PermissionDescriptor.php +++ b/src/Api/Struct/Webspace/PermissionDescriptor.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PermissionInfo.php b/src/Api/Struct/Webspace/PermissionInfo.php index 8ea83ddd..9414a31a 100644 --- a/src/Api/Struct/Webspace/PermissionInfo.php +++ b/src/Api/Struct/Webspace/PermissionInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PhpSettings.php b/src/Api/Struct/Webspace/PhpSettings.php index f16f16ee..464b2012 100644 --- a/src/Api/Struct/Webspace/PhpSettings.php +++ b/src/Api/Struct/Webspace/PhpSettings.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php index acf032b0..1aff2f7a 100644 --- a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php +++ b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/XmlResponse.php b/src/Api/XmlResponse.php index 5b11ef49..687b6d8a 100644 --- a/src/Api/XmlResponse.php +++ b/src/Api/XmlResponse.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskX\Api; diff --git a/tests/ApiClientTest.php b/tests/ApiClientTest.php index eb9f8133..41547416 100644 --- a/tests/ApiClientTest.php +++ b/tests/ApiClientTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/CertificateTest.php b/tests/CertificateTest.php index 4b2e79cf..cd6cda3b 100644 --- a/tests/CertificateTest.php +++ b/tests/CertificateTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/CustomerTest.php b/tests/CustomerTest.php index 961f1153..f33c9241 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DatabaseServerTest.php b/tests/DatabaseServerTest.php index 1f6eeef4..ab716a46 100644 --- a/tests/DatabaseServerTest.php +++ b/tests/DatabaseServerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index 2e63b809..ddbdf5aa 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DnsTemplateTest.php b/tests/DnsTemplateTest.php index 1d579d7b..e53202c0 100644 --- a/tests/DnsTemplateTest.php +++ b/tests/DnsTemplateTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DnsTest.php b/tests/DnsTest.php index 633f50d7..69867418 100644 --- a/tests/DnsTest.php +++ b/tests/DnsTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/EventLogTest.php b/tests/EventLogTest.php index d0e4c7d4..c402fbc9 100644 --- a/tests/EventLogTest.php +++ b/tests/EventLogTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/IpTest.php b/tests/IpTest.php index 28f4d996..1e4625a2 100644 --- a/tests/IpTest.php +++ b/tests/IpTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/LocaleTest.php b/tests/LocaleTest.php index f450d722..003cb019 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/MailTest.php b/tests/MailTest.php index f2bb6d49..90f8bd91 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/PhpHandlerTest.php b/tests/PhpHandlerTest.php index 5b8f753a..e622cfeb 100644 --- a/tests/PhpHandlerTest.php +++ b/tests/PhpHandlerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ProtectedDirectoryTest.php b/tests/ProtectedDirectoryTest.php index 80dfd3c7..aa368fcf 100644 --- a/tests/ProtectedDirectoryTest.php +++ b/tests/ProtectedDirectoryTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ResellerTest.php b/tests/ResellerTest.php index 50a96b24..d27d9893 100644 --- a/tests/ResellerTest.php +++ b/tests/ResellerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php index 026683c4..6d56293f 100644 --- a/tests/SecretKeyTest.php +++ b/tests/SecretKeyTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 1018fd97..9f0c2a23 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ServicePlanTest.php b/tests/ServicePlanTest.php index 6a29c09b..44cef16b 100644 --- a/tests/ServicePlanTest.php +++ b/tests/ServicePlanTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SessionTest.php b/tests/SessionTest.php index acebe286..8c97c5b9 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SiteTest.php b/tests/SiteTest.php index 9cb3c960..56c9282d 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SubdomainTest.php b/tests/SubdomainTest.php index c5d77367..c6624919 100644 --- a/tests/SubdomainTest.php +++ b/tests/SubdomainTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/TestCase.php b/tests/TestCase.php index b17f15f3..af2efcff 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/UiTest.php b/tests/UiTest.php index 717b5a23..6b997653 100644 --- a/tests/UiTest.php +++ b/tests/UiTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/Utility/KeyLimitChecker.php b/tests/Utility/KeyLimitChecker.php index 0fff84d4..46951147 100644 --- a/tests/Utility/KeyLimitChecker.php +++ b/tests/Utility/KeyLimitChecker.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest\Utility; diff --git a/tests/Utility/PasswordProvider.php b/tests/Utility/PasswordProvider.php index fc60b9c3..2083642d 100644 --- a/tests/Utility/PasswordProvider.php +++ b/tests/Utility/PasswordProvider.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest\Utility; diff --git a/tests/WebspaceTest.php b/tests/WebspaceTest.php index 0e388b89..b8444537 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2020. Plesk International GmbH. +// Copyright 1999-2021. Plesk International GmbH. namespace PleskXTest; diff --git a/wait-for-plesk.sh b/wait-for-plesk.sh index beaa48d6..2daeb0f2 100755 --- a/wait-for-plesk.sh +++ b/wait-for-plesk.sh @@ -1,5 +1,5 @@ #!/bin/bash -### Copyright 1999-2020. Plesk International GmbH. +### Copyright 1999-2021. Plesk International GmbH. while : ; do curl -ksL https://plesk:8443/ | grep "<title>Plesk" > /dev/null From d2853a37e4c8cf9a6eae51cd392ac0a1533ab98b Mon Sep 17 00:00:00 2001 From: Sander van der Vlugt <svandervlugt@hostnet.nl> Date: Mon, 28 Oct 2019 16:34:50 +0100 Subject: [PATCH 14/73] Add servicePlan create and delete --- src/Api/Operator/ServicePlan.php | 24 +++++++++++ tests/ServicePlanTest.php | 68 ++++++++++++++++++++++++++++++-- tests/TestCase.php | 18 +++++++++ 3 files changed, 106 insertions(+), 4 deletions(-) diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index 63408f52..3b27908f 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -28,6 +28,30 @@ public function getAll() return $this->_get(); } + /** + * @param string $planName + * @return Struct\Info + */ + public function create($planName) + { + $packet = $this->_client->getPacket(); + $info = $packet->addChild($this->_wrapperTag)->addChild('add'); + $info->addChild('name', $planName); + + $response = $this->_client->request($packet); + return new Struct\Info($response); + } + + /** + * @param string $field + * @param integer|string $value + * @return bool + */ + public function delete($field, $value) + { + return $this->_delete($field, $value); + } + /** * @param string|null $field * @param int|string|null $value diff --git a/tests/ServicePlanTest.php b/tests/ServicePlanTest.php index 44cef16b..259088ab 100644 --- a/tests/ServicePlanTest.php +++ b/tests/ServicePlanTest.php @@ -7,16 +7,76 @@ class ServicePlanTest extends TestCase { public function testGet() { - $servicePlan = static::$_client->servicePlan()->get('name', 'Default Domain'); - $this->assertEquals('Default Domain', $servicePlan->name); - $this->assertGreaterThan(0, $servicePlan->id); + $servicePlan = static::_createServicePlan(); + $servicePlanInfo = static::$_client->servicePlan()->get('id', $servicePlan->id); + $this->assertNotEmpty($servicePlanInfo->name); + $this->assertSame($servicePlan->id, $servicePlanInfo->id); + + static::$_client->servicePlan()->delete('id', $servicePlan->id); } public function testGetAll() { + static::_createServicePlan(); + static::_createServicePlan(); + static::_createServicePlan(); + $servicePlans = static::$_client->servicePlan()->getAll(); $this->assertIsArray($servicePlans); - $this->assertGreaterThan(0, count($servicePlans)); + $this->assertGreaterThan(2, count($servicePlans)); $this->assertNotEmpty($servicePlans[0]->name); } + + public function testCreateServicePlan() + { + $servicePlan = static::_createServicePlan(); + $this->assertGreaterThan(0, $servicePlan->id); + + static::$_client->servicePlan()->delete('id', $servicePlan->id); + } + + public function testDelete() + { + $servicePlan = static::_createServicePlan(); + $result = static::$_client->servicePlan()->delete('id', $servicePlan->id); + + $this->assertTrue($result); + } + + public function testRequestCreateServicePlan() + { + $request = [ + 'add' => [ + 'name' => 'Service Plan Full Test', + 'limits' => [ + 'overuse' => 'block', + ], + 'preferences' => [ + 'stat' => 6, + 'maillists' => 'true', + ], + 'hosting' => [ + 'property' => [ + [ + 'name' => 'ftp_quota', + 'value' => '-1', + ], + [ + 'name' => 'ssl', + 'value' => 'true', + ], + ], + ], + 'performance' => [ + 'bandwidth' => 1000, + 'max_connections' => 20, + ], + ], + ]; + + $servicePlan = static::$_client->servicePlan()->request($request); + $this->assertGreaterThan(0, $servicePlan->id); + + static::$_client->servicePlan()->delete('id', $servicePlan->id); + } } diff --git a/tests/TestCase.php b/tests/TestCase.php index af2efcff..ea7a3f6e 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -11,6 +11,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase protected static $_client; private static $webspaces = []; + private static $servicePlans = []; public static function setUpBeforeClass(): void { @@ -41,6 +42,13 @@ public static function tearDownAfterClass(): void } catch (\Exception $e) { } } + + foreach (self::$servicePlans as $servicePlan) { + try { + static::$_client->servicePlan()->delete('id', $servicePlan->id); + } catch (\Exception $e) { + } + } } /** @@ -74,4 +82,14 @@ protected static function _createWebspace() return $webspace; } + + protected static function _createServicePlan() + { + $id = uniqid(); + $servicePlan = static::$_client->servicePlan()->create("test{$id}plan"); + + self::$servicePlans[] = $servicePlan; + + return $servicePlan; + } } From 80b5aa954e511387d9f35293e7672a32404e3a8e Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 15:16:56 +0700 Subject: [PATCH 15/73] Fix doc block --- src/Api/Operator/ServicePlan.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index 3b27908f..c81ee522 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -44,7 +44,7 @@ public function create($planName) /** * @param string $field - * @param integer|string $value + * @param int|string $value * @return bool */ public function delete($field, $value) From f6c144d0a9ec9dbc2df1ec132f9b422097ed7ac8 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 15:42:53 +0700 Subject: [PATCH 16/73] Unify service plan creation interface with other operators --- src/Api/Operator/ServicePlan.php | 40 ++++++++++++-------------- tests/ServicePlanTest.php | 48 +++++++++++++++----------------- tests/TestCase.php | 2 +- 3 files changed, 42 insertions(+), 48 deletions(-) diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index c81ee522..d73bdf75 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -8,48 +8,44 @@ class ServicePlan extends \PleskX\Api\Operator { /** - * @param string $field - * @param int|string $value - * + * @param array $properties * @return Struct\Info */ - public function get($field, $value) + public function create($properties) { - $items = $this->_get($field, $value); - - return reset($items); + $response = $this->request(['add' => $properties]); + return new Struct\Info($response); } /** - * @return Struct\Info[] + * @param string $field + * @param int|string $value + * @return bool */ - public function getAll() + public function delete($field, $value) { - return $this->_get(); + return $this->_delete($field, $value); } /** - * @param string $planName + * @param string $field + * @param int|string $value + * * @return Struct\Info */ - public function create($planName) + public function get($field, $value) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add'); - $info->addChild('name', $planName); + $items = $this->_get($field, $value); - $response = $this->_client->request($packet); - return new Struct\Info($response); + return reset($items); } /** - * @param string $field - * @param int|string $value - * @return bool + * @return Struct\Info[] */ - public function delete($field, $value) + public function getAll() { - return $this->_delete($field, $value); + return $this->_get(); } /** diff --git a/tests/ServicePlanTest.php b/tests/ServicePlanTest.php index 259088ab..2189ae9c 100644 --- a/tests/ServicePlanTest.php +++ b/tests/ServicePlanTest.php @@ -43,38 +43,36 @@ public function testDelete() $this->assertTrue($result); } - public function testRequestCreateServicePlan() + public function testCreateComplexServicePlan() { - $request = [ - 'add' => [ - 'name' => 'Service Plan Full Test', - 'limits' => [ - 'overuse' => 'block', + $properties = [ + 'name' => 'Complex Service Plan', + 'limits' => [ + 'overuse' => 'block', + 'limit' => [ + 'name' => 'disk_space', + 'value' => 1024*1024*1024, // 1 GB ], - 'preferences' => [ - 'stat' => 6, - 'maillists' => 'true', - ], - 'hosting' => [ - 'property' => [ - [ - 'name' => 'ftp_quota', - 'value' => '-1', - ], - [ - 'name' => 'ssl', - 'value' => 'true', - ], + ], + 'preferences' => [ + 'stat' => 6, + 'maillists' => 'true', + ], + 'hosting' => [ + 'property' => [ + [ + 'name' => 'ftp_quota', + 'value' => '-1', + ], + [ + 'name' => 'ssl', + 'value' => 'true', ], - ], - 'performance' => [ - 'bandwidth' => 1000, - 'max_connections' => 20, ], ], ]; - $servicePlan = static::$_client->servicePlan()->request($request); + $servicePlan = static::$_client->servicePlan()->create($properties); $this->assertGreaterThan(0, $servicePlan->id); static::$_client->servicePlan()->delete('id', $servicePlan->id); diff --git a/tests/TestCase.php b/tests/TestCase.php index ea7a3f6e..259537ab 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -86,7 +86,7 @@ protected static function _createWebspace() protected static function _createServicePlan() { $id = uniqid(); - $servicePlan = static::$_client->servicePlan()->create("test{$id}plan"); + $servicePlan = static::$_client->servicePlan()->create(['name' => "test{$id}plan"]); self::$servicePlans[] = $servicePlan; From d631ec1699a249fca2f5c94569ecf7b03f972f45 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 15:52:06 +0700 Subject: [PATCH 17/73] Fix StyleCI issues --- src/Api/Operator/ServicePlan.php | 2 ++ tests/ServicePlanTest.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index d73bdf75..71391b60 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -9,6 +9,7 @@ class ServicePlan extends \PleskX\Api\Operator { /** * @param array $properties + * * @return Struct\Info */ public function create($properties) @@ -20,6 +21,7 @@ public function create($properties) /** * @param string $field * @param int|string $value + * * @return bool */ public function delete($field, $value) diff --git a/tests/ServicePlanTest.php b/tests/ServicePlanTest.php index 2189ae9c..5d759800 100644 --- a/tests/ServicePlanTest.php +++ b/tests/ServicePlanTest.php @@ -51,7 +51,7 @@ public function testCreateComplexServicePlan() 'overuse' => 'block', 'limit' => [ 'name' => 'disk_space', - 'value' => 1024*1024*1024, // 1 GB + 'value' => 1024 * 1024 * 1024, // 1 GB ], ], 'preferences' => [ From 965dc514ead2e67c4ff50ba037e69e759219287d Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 15:54:29 +0700 Subject: [PATCH 18/73] Newline should be present before the return statement --- src/Api/Operator/ServicePlan.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index 71391b60..41fa075e 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -15,6 +15,7 @@ class ServicePlan extends \PleskX\Api\Operator public function create($properties) { $response = $this->request(['add' => $properties]); + return new Struct\Info($response); } From 9d3e0e780fe6b0978a99647ced5e88b3feb261a5 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 16:41:44 +0700 Subject: [PATCH 19/73] Remove outdated reference --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index d6016d2e..1a494ee8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ - # vendor /vendor/ # tests /phpunit.xml /.phpunit.result.cache -/php/tests/node_modules/ From d41c16027b7946e341222b7f168443f136993b8e Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 16:52:44 +0700 Subject: [PATCH 20/73] Introduce an integration with code coverage tracking service --- .gitignore | 1 + .travis.yml | 3 +++ Dockerfile | 3 +++ phpunit.xml.dist | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index 1a494ee8..73ee258c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ # tests /phpunit.xml /.phpunit.result.cache +/coverage.xml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d7ea2e8f..e866c8b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,3 +3,6 @@ services: docker script: - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker-compose run tests + +after_success: + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 66fbb3ef..6d754473 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,4 +3,7 @@ FROM php:7.3-cli RUN apt-get update \ && apt-get install -y unzip \ && docker-php-ext-install pcntl \ + && pecl install xdebug \ + && echo "zend_extension=xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini \ + && echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/xdebug.ini \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d77e92d9..98149616 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -22,4 +22,8 @@ <env name="REMOTE_URL" value=""/> <env name="REMOTE_PASSWORD" value=""/> </php> + + <logging> + <log type="coverage-clover" target="coverage.xml"/> + </logging> </phpunit> From 0af60ab572efae29ffc527f8410389ce2b3c1d7e Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 10 Jan 2021 17:14:05 +0700 Subject: [PATCH 21/73] Add information about the code coverage --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f730abdd..a5fcac86 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ ## PHP library for Plesk XML-RPC API -[![Build Status](https://travis-ci.com/plesk/api-php-lib.svg?branch=master)](https://travis-ci.com/plesk/api-php-lib) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/plesk/api-php-lib/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/plesk/api-php-lib/?branch=master) +[![Build Status](https://travis-ci.com/plesk/api-php-lib.svg?branch=master)](https://travis-ci.com/plesk/api-php-lib) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/plesk/api-php-lib/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/plesk/api-php-lib/?branch=master) [![StyleCI](https://styleci.io/repos/26514840/shield?branch=master)](https://styleci.io/repos/26514840) +[![codecov](https://codecov.io/gh/plesk/api-php-lib/branch/master/graph/badge.svg?token=5Kwbddpdeb)](https://codecov.io/gh/plesk/api-php-lib) PHP object-oriented library for Plesk XML-RPC API. From 7c79952e013f98c0a4739a36ca512544ccd342b6 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Tue, 12 Jan 2021 21:34:29 +0700 Subject: [PATCH 22/73] Add tests for site aliases --- src/Api/Operator/SiteAlias.php | 15 ++++++- tests/SiteAliasTest.php | 71 ++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 tests/SiteAliasTest.php diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index 65f48c76..be8f735c 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -38,7 +38,18 @@ public function create(array $properties, array $preferences = []) * @param string $field * @param int|string $value * - * @return Struct\Info + * @return bool + */ + public function delete($field, $value) + { + return $this->_delete($field, $value, 'delete'); + } + + /** + * @param string $field + * @param int|string $value + * + * @return Struct\GeneralInfo */ public function get($field, $value) { @@ -51,7 +62,7 @@ public function get($field, $value) * @param string $field * @param int|string $value * - * @return Struct\Info[] + * @return Struct\GeneralInfo[] */ public function getAll($field = null, $value = null) { diff --git a/tests/SiteAliasTest.php b/tests/SiteAliasTest.php new file mode 100644 index 00000000..645fc861 --- /dev/null +++ b/tests/SiteAliasTest.php @@ -0,0 +1,71 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskXTest; + +class SiteAliasTest extends TestCase +{ + /** @var \PleskX\Api\Struct\Webspace\Info */ + private static $webspace; + + public static function setUpBeforeClass(): void + { + parent::setUpBeforeClass(); + static::$webspace = static::_createWebspace(); + } + + private function _createSiteAlias($name, array $properties = []) + { + $properties = array_merge([ + 'name' => $name, + 'site-id' => static::$webspace->id, + ], $properties); + + return static::$_client->siteAlias()->create($properties); + } + + public function testCreate() + { + $siteAlias = $this->_createSiteAlias('alias.dom'); + + $this->assertIsNumeric($siteAlias->id); + $this->assertGreaterThan(0, $siteAlias->id); + + static::$_client->siteAlias()->delete('id', $siteAlias->id); + } + + public function testDelete() + { + $siteAlias = $this->_createSiteAlias('alias.dom'); + + $result = static::$_client->siteAlias()->delete('id', $siteAlias->id); + $this->assertTrue($result); + } + + public function testGet() + { + $siteAlias = $this->_createSiteAlias('alias.dom'); + + $siteAliasInfo = static::$_client->siteAlias()->get('id', $siteAlias->id); + $this->assertEquals('alias.dom', $siteAliasInfo->name); + + static::$_client->siteAlias()->delete('id', $siteAlias->id); + } + + public function testGetAll() + { + $siteAlias = $this->_createSiteAlias('alias.dom'); + $siteAlias2 = $this->_createSiteAlias('alias2.dom'); + + $siteAliasInfo = static::$_client->siteAlias()->get('id', $siteAlias->id); + $this->assertEquals('alias.dom', $siteAliasInfo->name); + + $siteAliasesInfo = static::$_client->siteAlias()->getAll('site-id', self::$webspace->id); + $this->assertCount(2, $siteAliasesInfo); + $this->assertEquals('alias.dom', $siteAliasesInfo[0]->name); + $this->assertEquals('alias.dom', $siteAliasesInfo[0]->asciiName); + + static::$_client->siteAlias()->delete('id', $siteAlias->id); + static::$_client->siteAlias()->delete('id', $siteAlias2->id); + } +} From 2188d010651b5ec9466e022d8f9b5daee58b3801 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 17 Jan 2021 16:44:37 +0700 Subject: [PATCH 23/73] Issue #82: fix the wrapping if dataset is empty --- src/Api/Operator.php | 3 +++ tests/SiteTest.php | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/Api/Operator.php b/src/Api/Operator.php index f355c2ef..bab9b2b3 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -93,6 +93,9 @@ protected function _getItems($structClass, $infoTag, $field = null, $value = nul if (!is_null($filter) && !$filter($xmlResult->data->$infoTag)) { continue; } + if (!isset($xmlResult->data) || !isset($xmlResult->data->$infoTag)) { + continue; + } $items[] = new $structClass($xmlResult->data->$infoTag); } diff --git a/tests/SiteTest.php b/tests/SiteTest.php index 56c9282d..80c84138 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -104,4 +104,10 @@ public function testGetAll() static::$_client->site()->delete('id', $site->id); static::$_client->site()->delete('id', $site2->id); } + + public function testGetAllWithoutSites() + { + $sitesInfo = static::$_client->site()->getAll(); + $this->assertEmpty($sitesInfo); + } } From a5e0adc10347108c1c6508212cebabbecf6031a7 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 17 Jan 2021 17:51:34 +0700 Subject: [PATCH 24/73] Issue #11: implement mailnames fetching operations --- src/Api/Operator/Mail.php | 43 +++++++++++++++++++++++++++++ src/Api/Struct/Mail/GeneralInfo.php | 25 +++++++++++++++++ tests/MailTest.php | 27 ++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 src/Api/Struct/Mail/GeneralInfo.php diff --git a/src/Api/Operator/Mail.php b/src/Api/Operator/Mail.php index bf9be11f..5d5b7fb4 100644 --- a/src/Api/Operator/Mail.php +++ b/src/Api/Operator/Mail.php @@ -53,4 +53,47 @@ public function delete($field, $value, $siteId) return 'ok' === (string) $response->status; } + + /** + * @param string $name + * @param int $siteId + * + * @return Struct\GeneralInfo + */ + public function get($name, $siteId) + { + $items = $this->getAll($siteId, $name); + + return reset($items); + } + + /** + * @param int $siteId + * @param string|null $name + * + * @return Struct\GeneralInfo[] + */ + public function getAll($siteId, $name = null) + { + $packet = $this->_client->getPacket(); + $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_info'); + + $filterTag = $getTag->addChild('filter'); + $filterTag->addChild('site-id', $siteId); + if (!is_null($name)) { + $filterTag->addChild('name', $name); + } + + $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $items = []; + foreach ($response->xpath('//result') as $xmlResult) { + if (!isset($xmlResult->mailname)) { + continue; + } + $item = new Struct\GeneralInfo($xmlResult->mailname); + $items[] = $item; + } + + return $items; + } } diff --git a/src/Api/Struct/Mail/GeneralInfo.php b/src/Api/Struct/Mail/GeneralInfo.php new file mode 100644 index 00000000..798aca95 --- /dev/null +++ b/src/Api/Struct/Mail/GeneralInfo.php @@ -0,0 +1,25 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskX\Api\Struct\Mail; + +class GeneralInfo extends \PleskX\Api\Struct +{ + /** @var int */ + public $id; + + /** @var string */ + public $name; + + /** @var string */ + public $description; + + public function __construct($apiResponse) + { + $this->_initScalarProperties($apiResponse, [ + 'id', + 'name', + 'description', + ]); + } +} diff --git a/tests/MailTest.php b/tests/MailTest.php index 90f8bd91..54f5804a 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -54,4 +54,31 @@ public function testDelete() $result = static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); $this->assertTrue($result); } + + public function testGet() + { + $mailname = static::$_client->mail()->create('test', static::$webspace->id); + + $mailnameInfo = static::$_client->mail()->get('test', static::$webspace->id); + $this->assertEquals('test', $mailnameInfo->name); + + static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); + } + + public function testGetAll() + { + $mailname = static::$_client->mail()->create('test', static::$webspace->id); + + $mailnamesInfo = static::$_client->mail()->getAll(static::$webspace->id); + $this->assertCount(1, $mailnamesInfo); + $this->assertEquals('test', $mailnamesInfo[0]->name); + + static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); + } + + public function testGetAllWithoutMailnames() + { + $mailnamesInfo = static::$_client->mail()->getAll(static::$webspace->id); + $this->assertCount(0, $mailnamesInfo); + } } From 92a2b6e4301e79078b86259cec1d627f689f2674 Mon Sep 17 00:00:00 2001 From: rene-gates <development@lazybox.de> Date: Sun, 31 Jan 2021 01:03:17 +0100 Subject: [PATCH 25/73] Make additional parameters available as property of class --- src/Api/Struct/Server/Statistics/Version.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Api/Struct/Server/Statistics/Version.php b/src/Api/Struct/Server/Statistics/Version.php index 198495c1..9fca7c0a 100644 --- a/src/Api/Struct/Server/Statistics/Version.php +++ b/src/Api/Struct/Server/Statistics/Version.php @@ -11,11 +11,27 @@ class Version extends \PleskX\Api\Struct /** @var string */ public $version; + /** @var string */ + public $build; + + /** @var string */ + public $osName; + + /** @var string */ + public $osVersion; + + /** @var string */ + public $osRelease; + public function __construct($apiResponse) { $this->_initScalarProperties($apiResponse, [ ['plesk_name' => 'internalName'], ['plesk_version' => 'version'], + ['plesk_build' => 'build'], + ['plesk_os' => 'osName'], + ['plesk_os_version' => 'osVersion'], + ['os_release' => 'osRelease'], ]); } } From caeb83cb1026581b6d2f2cecf189a2ac2060b3b3 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 31 Jan 2021 16:45:52 +0700 Subject: [PATCH 26/73] Add assertions for new properties --- tests/ServerTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 9f0c2a23..4408a948 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -93,6 +93,8 @@ public function testGetStatistics() $stats = static::$_client->server()->getStatistics(); $this->assertIsNumeric($stats->objects->clients); $this->assertEquals('psa', $stats->version->internalName); + $this->assertNotEmpty($stats->version->osName); + $this->assertNotEmpty($stats->version->osVersion); } public function testGetSiteIsolationConfig() From b07aa1755b0e5e3d0d5a76a9e497193c2da9f961 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 31 Jan 2021 18:56:26 +0700 Subject: [PATCH 27/73] Issue #89: compatibility with PHP 8 --- composer.json | 2 +- composer.lock | 1315 +++++++++++++++++++++++++++++++++---------------- 2 files changed, 905 insertions(+), 412 deletions(-) diff --git a/composer.json b/composer.json index 9ca7bacc..3142565c 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "ext-curl": "*", "ext-xml": "*", "ext-simplexml": "*" diff --git a/composer.lock b/composer.lock index f5f3cb85..1c6fbd7f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "554cb70d6a29bd690fd9e966b98003d0", + "content-hash": "330651d827abd67d78e7962e9cd539d5", "packages": [], "packages-dev": [ { "name": "clue/stdio-react", - "version": "v2.3.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/clue/reactphp-stdio.git", - "reference": "5f42a3a5a29f52432f0f68b57890353e8ca65069" + "reference": "5722686d3cc0cdf2ccedb6079bfd066220611f00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-stdio/zipball/5f42a3a5a29f52432f0f68b57890353e8ca65069", - "reference": "5f42a3a5a29f52432f0f68b57890353e8ca65069", + "url": "https://api.github.com/repos/clue/reactphp-stdio/zipball/5722686d3cc0cdf2ccedb6079bfd066220611f00", + "reference": "5722686d3cc0cdf2ccedb6079bfd066220611f00", "shasum": "" }, "require": { @@ -31,7 +31,7 @@ "require-dev": { "clue/arguments": "^2.0", "clue/commander": "^1.2", - "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "suggest": { "ext-mbstring": "Using ext-mbstring should provide slightly better performance for handling I/O" @@ -49,7 +49,7 @@ "authors": [ { "name": "Christian Lück", - "email": "christian@lueck.tv" + "email": "christian@clue.engineering" } ], "description": "Async, event-driven console input & output (STDIN, STDOUT) for truly interactive CLI applications, built on top of ReactPHP", @@ -67,20 +67,30 @@ "stdio", "stdout" ], - "time": "2019-08-28T12:01:30+00:00" + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-11-20T14:28:39+00:00" }, { "name": "clue/term-react", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/clue/reactphp-term.git", - "reference": "3cec1164073455a85a3f2b3c3fe6db2170d21c2a" + "reference": "eb6eb063eda04a714ef89f066586a2c49588f7ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-term/zipball/3cec1164073455a85a3f2b3c3fe6db2170d21c2a", - "reference": "3cec1164073455a85a3f2b3c3fe6db2170d21c2a", + "url": "https://api.github.com/repos/clue/reactphp-term/zipball/eb6eb063eda04a714ef89f066586a2c49588f7ca", + "reference": "eb6eb063eda04a714ef89f066586a2c49588f7ca", "shasum": "" }, "require": { @@ -88,7 +98,7 @@ "react/stream": "^1.0 || ^0.7" }, "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8", "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3" }, "type": "library", @@ -104,10 +114,10 @@ "authors": [ { "name": "Christian Lück", - "email": "christian@lueck.tv" + "email": "christian@clue.engineering" } ], - "description": "Streaming terminal emulator, built on top of ReactPHP", + "description": "Streaming terminal emulator, built on top of ReactPHP.", "homepage": "https://github.com/clue/reactphp-term", "keywords": [ "C0", @@ -126,20 +136,30 @@ "vt100", "xterm" ], - "time": "2018-07-09T08:20:33+00:00" + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-11-06T11:50:12+00:00" }, { "name": "clue/utf8-react", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/clue/php-utf8-react.git", - "reference": "c6111a22e1056627c119233ff5effe00f5d3cc1d" + "url": "https://github.com/clue/reactphp-utf8.git", + "reference": "8bc3f8c874cdf642c8f10f9ae93aadb8cd63da96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/php-utf8-react/zipball/c6111a22e1056627c119233ff5effe00f5d3cc1d", - "reference": "c6111a22e1056627c119233ff5effe00f5d3cc1d", + "url": "https://api.github.com/repos/clue/reactphp-utf8/zipball/8bc3f8c874cdf642c8f10f9ae93aadb8cd63da96", + "reference": "8bc3f8c874cdf642c8f10f9ae93aadb8cd63da96", "shasum": "" }, "require": { @@ -147,7 +167,7 @@ "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4 || ^0.3" }, "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8", + "phpunit/phpunit": "^9.3 ||^5.7 || ^4.8", "react/stream": "^1.0 || ^0.7" }, "type": "library", @@ -163,11 +183,11 @@ "authors": [ { "name": "Christian Lück", - "email": "christian@lueck.tv" + "email": "christian@clue.engineering" } ], - "description": "Streaming UTF-8 parser, built on top of ReactPHP", - "homepage": "https://github.com/clue/php-utf8-react", + "description": "Streaming UTF-8 parser, built on top of ReactPHP.", + "homepage": "https://github.com/clue/reactphp-utf8", "keywords": [ "reactphp", "streaming", @@ -175,40 +195,45 @@ "utf-8", "utf8" ], - "time": "2017-07-06T07:43:22+00:00" + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-11-06T11:48:09+00:00" }, { "name": "doctrine/instantiator", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "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", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -222,7 +247,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -231,7 +256,21 @@ "constructor", "instantiate" ], - "time": "2020-05-29T17:27:14+00:00" + "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": "evenement/evenement", @@ -335,16 +374,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { @@ -379,32 +418,91 @@ "object", "object graph" ], - "time": "2020-06-29T13:22:24+00:00" + "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.10.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "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" + ], + "time": "2020-12-20T10:01:03+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -434,24 +532,24 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" + "time": "2020-06-27T14:33:11+00:00" }, { "name": "phar-io/version", - "version": "2.0.1", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", + "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -481,7 +579,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" + "time": "2020-12-13T23:18:30+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -534,16 +632,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.0", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/3170448f5769fe19f456173d833734e0ff1b84df", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { @@ -582,20 +680,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-07-20T20:05:34+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { @@ -627,32 +725,32 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-27T10:12:23+00:00" + "time": "2020-09-17T18:55:26+00:00" }, { "name": "phpspec/prophecy", - "version": "1.11.1", + "version": "1.12.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" + "reference": "245710e971a030f42e08f4912863805570f23d39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", + "reference": "245710e971a030f42e08f4912863805570f23d39", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { @@ -690,36 +788,39 @@ "spy", "stub" ], - "time": "2020-07-08T12:44:21+00:00" + "time": "2020-12-19T10:15:11+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "8.0.2", + "version": "9.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc" + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca6647ffddd2add025ab3f21644a441d7c146cdc", - "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", - "php": "^7.3", - "phpunit/php-file-iterator": "^3.0", - "phpunit/php-text-template": "^2.0", - "phpunit/php-token-stream": "^4.0", - "sebastian/code-unit-reverse-lookup": "^2.0", - "sebastian/environment": "^5.0", - "sebastian/version": "^3.0", - "theseer/tokenizer": "^1.1.3" + "nikic/php-parser": "^4.10.2", + "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.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcov": "*", @@ -728,7 +829,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.0-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -754,27 +855,33 @@ "testing", "xunit" ], - "time": "2020-05-23T08:02:54+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:44:49+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.4", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/25fefc5b19835ca653877fe081644a3f8c1d915e", - "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -804,28 +911,34 @@ "filesystem", "iterator" ], - "time": "2020-07-11T05:18:21+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.0.2", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "f6eedfed1085dd1f4c599629459a0277d25f9a66" + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f6eedfed1085dd1f4c599629459a0277d25f9a66", - "reference": "f6eedfed1085dd1f4c599629459a0277d25f9a66", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcntl": "*" @@ -833,7 +946,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -857,27 +970,33 @@ "keywords": [ "process" ], - "time": "2020-06-26T11:53:53+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324" + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", - "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -906,27 +1025,33 @@ "keywords": [ "template" ], - "time": "2020-06-26T11:55:37+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.1", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7" + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/cc49734779cbb302bf51a44297dab8c4bbf941e7", - "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -955,69 +1080,26 @@ "keywords": [ "timer" ], - "time": "2020-06-26T11:58:13+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "4.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5672711b6b07b14d5ab694e700c62eeb82fcf374", - "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + "funding": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2020-06-27T06:36:25+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/phpunit", - "version": "9.2.6", + "version": "9.5.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6" + "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1c6a9e4312e209e659f1fce3ce88dd197c2448f6", - "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7bdf4085de85a825f4424eae52c99a1cec2f360", + "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360", "shasum": "" }, "require": { @@ -1028,30 +1110,31 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.5", - "phar-io/manifest": "^1.0.3", - "phar-io/version": "^2.0.1", - "php": "^7.3", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^8.0.2", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-invoker": "^3.0.2", - "phpunit/php-text-template": "^2.0.2", - "phpunit/php-timer": "^5.0.1", - "sebastian/code-unit": "^1.0.5", - "sebastian/comparator": "^4.0.3", - "sebastian/diff": "^4.0.1", - "sebastian/environment": "^5.1.2", - "sebastian/exporter": "^4.0.2", - "sebastian/global-state": "^4.0", - "sebastian/object-enumerator": "^4.0.2", - "sebastian/resource-operations": "^3.0.2", - "sebastian/type": "^2.1.1", - "sebastian/version": "^3.0.1" + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", + "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", + "sebastian/version": "^3.0.2" }, "require-dev": { "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0" + "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { "ext-soap": "*", @@ -1063,7 +1146,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-master": "9.5-dev" } }, "autoload": { @@ -1092,7 +1175,17 @@ "testing", "xunit" ], - "time": "2020-07-13T17:55:55+00:00" + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-01-17T07:42:25+00:00" }, { "name": "psr/container", @@ -1231,25 +1324,77 @@ ], "time": "2020-05-04T10:17:57+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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, { "name": "sebastian/code-unit", - "version": "1.0.5", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "c1e2df332c905079980b119c4db103117e5e5c90" + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/c1e2df332c905079980b119c4db103117e5e5c90", - "reference": "c1e2df332c905079980b119c4db103117e5e5c90", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1275,27 +1420,33 @@ ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", - "time": "2020-06-26T12:50:45+00:00" + "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.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ee51f9bb0c6d8a43337055db3120829fa14da819", - "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1320,29 +1471,35 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2020-06-26T12:04:00+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.3", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f" + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f", - "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0", + "php": ">=7.3", "sebastian/diff": "^4.0", "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1384,27 +1541,86 @@ "compare", "equality" ], - "time": "2020-06-26T12:05:46+00:00" + "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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" }, { "name": "sebastian/diff", - "version": "4.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113" + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113", - "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^9.3", "symfony/process": "^4.2 || ^5" }, "type": "library", @@ -1440,27 +1656,33 @@ "unidiff", "unified diff" ], - "time": "2020-06-30T04:46:02+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" }, { "name": "sebastian/environment", - "version": "5.1.2", + "version": "5.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2" + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2", - "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-posix": "*" @@ -1468,7 +1690,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1493,29 +1715,35 @@ "environment", "hhvm" ], - "time": "2020-06-26T12:07:24+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "571d721db4aec847a0e59690b954af33ebf9f023" + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/571d721db4aec847a0e59690b954af33ebf9f023", - "reference": "571d721db4aec847a0e59690b954af33ebf9f023", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0", + "php": ">=7.3", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^9.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1560,30 +1788,36 @@ "export", "exporter" ], - "time": "2020-06-26T12:08:55+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:24:23+00:00" }, { "name": "sebastian/global-state", - "version": "4.0.0", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72" + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bdb1e7c79e592b8c82cb1699be3c8743119b8a72", - "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", "shasum": "" }, "require": { - "php": "^7.3", + "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -1591,7 +1825,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1614,29 +1848,88 @@ "keywords": [ "global state" ], - "time": "2020-02-07T06:11:37+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:55:19+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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/074fed2d0a6d08e1677dd8ce9d32aecb384917b8", - "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0", + "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1661,27 +1954,33 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2020-06-26T12:11:32+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "127a46f6b057441b201253526f81d5406d6c7840" + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/127a46f6b057441b201253526f81d5406d6c7840", - "reference": "127a46f6b057441b201253526f81d5406d6c7840", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1706,27 +2005,33 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2020-06-26T12:12:55+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63" + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/062231bf61d2b9448c4fa5a7643b5e1829c11d63", - "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1759,24 +2064,30 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2020-06-26T12:14:17+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" }, { "name": "sebastian/resource-operations", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0653718a5a629b065e91f774595267f8dc32e213" + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0653718a5a629b065e91f774595267f8dc32e213", - "reference": "0653718a5a629b065e91f774595267f8dc32e213", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.0" @@ -1804,32 +2115,38 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2020-06-26T12:16:22+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" }, { "name": "sebastian/type", - "version": "2.2.1", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a" + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/86991e2b33446cd96e648c18bcdb1e95afb2c05a", - "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -1850,24 +2167,30 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", - "time": "2020-07-05T08:31:53+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:18:59+00:00" }, { "name": "sebastian/version", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "626586115d0ed31cb71483be55beb759b5af5a3c" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/626586115d0ed31cb71483be55beb759b5af5a3c", - "reference": "626586115d0ed31cb71483be55beb759b5af5a3c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "type": "library", "extra": { @@ -1893,36 +2216,42 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2020-06-26T12:18:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "spatie/phpunit-watcher", - "version": "1.22.0", + "version": "1.23.1", "source": { "type": "git", "url": "https://github.com/spatie/phpunit-watcher.git", - "reference": "dee58ae54d3bc4eccc2b3d7006444f535a693f18" + "reference": "0c70d569658a1cad9a6869716a4351d2ccfec4d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/dee58ae54d3bc4eccc2b3d7006444f535a693f18", - "reference": "dee58ae54d3bc4eccc2b3d7006444f535a693f18", + "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/0c70d569658a1cad9a6869716a4351d2ccfec4d1", + "reference": "0c70d569658a1cad9a6869716a4351d2ccfec4d1", "shasum": "" }, "require": { "clue/stdio-react": "^2.0", "jolicode/jolinotif": "^2.0", - "php": "^7.2", - "symfony/console": "^4.0|^5.0", - "symfony/process": "^4.0|^5.0", - "symfony/yaml": "^4.0|^5.0", + "php": "^7.2 | ^8.0", + "symfony/console": "^5.0", + "symfony/process": "^5.0", + "symfony/yaml": "^5.0", "yosymfony/resource-watcher": "^2.0" }, "conflict": { "yosymfony/resource-watcher": "<2.0" }, "require-dev": { - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.0 | ^9.0" }, "bin": [ "phpunit-watcher" @@ -1951,20 +2280,20 @@ "phpunit-watcher", "spatie" ], - "time": "2020-01-04T22:46:42+00:00" + "time": "2020-10-31T17:47:29+00:00" }, { "name": "symfony/console", - "version": "v5.1.3", + "version": "v5.2.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2226c68009627934b8cfc01260b4d287eab070df" + "reference": "d62ec79478b55036f65e2602e282822b8eaaff0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2226c68009627934b8cfc01260b4d287eab070df", - "reference": "2226c68009627934b8cfc01260b4d287eab070df", + "url": "https://api.github.com/repos/symfony/console/zipball/d62ec79478b55036f65e2602e282822b8eaaff0a", + "reference": "d62ec79478b55036f65e2602e282822b8eaaff0a", "shasum": "" }, "require": { @@ -2001,11 +2330,6 @@ "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -2028,22 +2352,42 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", - "time": "2020-07-06T13:23:11+00:00" + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "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-01-27T10:15:41+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.1.3", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14" + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5e20b83385a77593259c9f8beb2c43cd03b2ac14", - "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", "shasum": "" }, "require": { @@ -2052,7 +2396,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" }, "thanks": { "name": "symfony/contracts", @@ -2080,31 +2424,40 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "time": "2020-06-06T08:49:21+00:00" + "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": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/finder", - "version": "v5.1.3", + "version": "v5.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187" + "reference": "196f45723b5e618bf0e23b97e96d11652696ea9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4298870062bfc667cb78d2b379be4bf5dec5f187", - "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187", + "url": "https://api.github.com/repos/symfony/finder/zipball/196f45723b5e618bf0e23b97e96d11652696ea9e", + "reference": "196f45723b5e618bf0e23b97e96d11652696ea9e", "shasum": "" }, "require": { "php": ">=7.2.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -2127,26 +2480,40 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "time": "2020-05-20T17:43:50+00:00" + "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-01-27T10:01:46+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.18.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-ctype": "For best performance" @@ -2154,7 +2521,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2191,24 +2558,38 @@ "polyfill", "portable" ], - "time": "2020-07-14T12:35:20+00:00" + "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-01-07T16:49:33+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.18.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5" + "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b740103edbdcc39602239ee8860f0f45a8eb9aa5", - "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", + "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-intl": "For best performance" @@ -2216,7 +2597,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2255,24 +2636,38 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "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-01-07T16:49:33+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.18.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + "reference": "6e971c891537eb617a00bb07a43d182a6915faba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", - "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba", + "reference": "6e971c891537eb617a00bb07a43d182a6915faba", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-intl": "For best performance" @@ -2280,7 +2675,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2322,24 +2717,38 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "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-01-07T17:09:11+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.18.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -2347,7 +2756,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2385,29 +2794,43 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "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-01-07T16:49:33+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.18.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca" + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fffa1a52a023e782cdcc221d781fe1ec8f87fcca", - "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2447,29 +2870,43 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "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-01-07T16:49:33+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.18.0", + "version": "v1.22.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", "shasum": "" }, "require": { - "php": ">=7.0.8" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2513,20 +2950,34 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "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-01-07T16:49:33+00:00" }, { "name": "symfony/process", - "version": "v5.1.3", + "version": "v5.2.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1864216226af21eb76d9477f691e7cbf198e0402" + "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1864216226af21eb76d9477f691e7cbf198e0402", - "reference": "1864216226af21eb76d9477f691e7cbf198e0402", + "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", "shasum": "" }, "require": { @@ -2534,11 +2985,6 @@ "symfony/polyfill-php80": "^1.15" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" @@ -2561,22 +3007,36 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", - "time": "2020-07-23T08:36:24+00:00" + "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-01-27T10:15:41+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.1.3", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442" + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442", - "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", "shasum": "" }, "require": { @@ -2589,7 +3049,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" }, "thanks": { "name": "symfony/contracts", @@ -2625,20 +3085,34 @@ "interoperability", "standards" ], - "time": "2020-07-06T13:23:11+00:00" + "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": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/string", - "version": "v5.1.3", + "version": "v5.2.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b" + "reference": "c95468897f408dd0aca2ff582074423dd0455122" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f629ba9b611c76224feb21fe2bcbf0b6f992300b", - "reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b", + "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122", + "reference": "c95468897f408dd0aca2ff582074423dd0455122", "shasum": "" }, "require": { @@ -2656,11 +3130,6 @@ "symfony/var-exporter": "^4.4|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\String\\": "" @@ -2686,7 +3155,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony String component", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", "homepage": "https://symfony.com", "keywords": [ "grapheme", @@ -2696,20 +3165,34 @@ "utf-8", "utf8" ], - "time": "2020-07-08T08:27:49+00:00" + "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-01-25T15:14:59+00:00" }, { "name": "symfony/yaml", - "version": "v5.1.3", + "version": "v5.2.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ea342353a3ef4f453809acc4ebc55382231d4d23" + "reference": "6bb8b36c6dea8100268512bf46e858c8eb5c545e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ea342353a3ef4f453809acc4ebc55382231d4d23", - "reference": "ea342353a3ef4f453809acc4ebc55382231d4d23", + "url": "https://api.github.com/repos/symfony/yaml/zipball/6bb8b36c6dea8100268512bf46e858c8eb5c545e", + "reference": "6bb8b36c6dea8100268512bf46e858c8eb5c545e", "shasum": "" }, "require": { @@ -2730,11 +3213,6 @@ "Resources/bin/yaml-lint" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -2757,9 +3235,23 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", - "time": "2020-05-20T17:43:50+00:00" + "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-01-27T10:01:46+00:00" }, { "name": "theseer/tokenizer", @@ -2806,12 +3298,12 @@ "version": "1.9.1", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", + "url": "https://github.com/webmozarts/assert.git", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, @@ -2910,10 +3402,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "ext-curl": "*", "ext-xml": "*", "ext-simplexml": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } From 40990d5b7c7e8d6c9132962f968e3713b3dbbea2 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 31 Jan 2021 19:02:45 +0700 Subject: [PATCH 28/73] Use new format of XML configuration for PHPUnit --- phpunit.xml.dist | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 98149616..40244388 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 1999-2021. Plesk International GmbH. --> -<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" - bootstrap="vendor/autoload.php" - verbose="true" - colors="true"> - <testsuites> - <testsuite name="E2E"> - <directory>./tests</directory> - </testsuite> - </testsuites> - - <filter> - <whitelist processUncoveredFilesFromWhitelist="true"> - <directory suffix=".php">./src</directory> - </whitelist> - </filter> - - <php> - <ini name="error_reporting" value="-1"/> - <env name="REMOTE_URL" value=""/> - <env name="REMOTE_PASSWORD" value=""/> - </php> - - <logging> - <log type="coverage-clover" target="coverage.xml"/> - </logging> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" verbose="true" colors="true"> + <coverage processUncoveredFiles="true"> + <include> + <directory suffix=".php">./src</directory> + </include> + <report> + <clover outputFile="coverage.xml"/> + </report> + </coverage> + <testsuites> + <testsuite name="E2E"> + <directory>./tests</directory> + </testsuite> + </testsuites> + <php> + <ini name="error_reporting" value="-1"/> + <env name="REMOTE_URL" value=""/> + <env name="REMOTE_PASSWORD" value=""/> + </php> + <logging/> </phpunit> From 9be3148b14307d48d397075b1a734215824a4b81 Mon Sep 17 00:00:00 2001 From: Simon Solutions <development@lazybox.de> Date: Sat, 20 Feb 2021 17:18:17 +0100 Subject: [PATCH 29/73] Update SecretKey.php Make IP address optional. If not provided don't add the ip_address child to the request. This will make Plesk take the IP of the sender. ("If this node is not specified, the IP address of the request sender will be used.") --- src/Api/Operator/SecretKey.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index 677de824..f005806a 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -11,13 +11,20 @@ class SecretKey extends \PleskX\Api\Operator /** * @param string $ipAddress + * @param string $keyDescription * * @return string */ - public function create($ipAddress) + public function create($ipAddress = '', $keyDescription = '') { $packet = $this->_client->getPacket(); - $packet->addChild($this->_wrapperTag)->addChild('create')->addChild('ip_address', $ipAddress); + $creator = $packet->addChild($this->_wrapperTag)->addChild('create'); + + if ($ipAddress != '') { + $creator->addChild('ip_address', $ipAddress); + } + $creator->addChild('description', $keyDescription); + $response = $this->_client->request($packet); return (string) $response->key; From c9de9a6819bd8b0e998e5f1068f1038ad4a41c48 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 25 Feb 2021 11:26:57 +0700 Subject: [PATCH 30/73] Style fixes --- src/Api/Operator/SecretKey.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index f005806a..5b739f10 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -11,19 +11,22 @@ class SecretKey extends \PleskX\Api\Operator /** * @param string $ipAddress - * @param string $keyDescription + * @param string $description * * @return string */ - public function create($ipAddress = '', $keyDescription = '') + public function create($ipAddress = '', $description = '') { $packet = $this->_client->getPacket(); - $creator = $packet->addChild($this->_wrapperTag)->addChild('create'); + $createTag = $packet->addChild($this->_wrapperTag)->addChild('create'); - if ($ipAddress != '') { - $creator->addChild('ip_address', $ipAddress); + if ('' !== $ipAddress) { + $createTag->addChild('ip_address', $ipAddress); + } + + if ('' !== $description) { + $createTag->addChild('description', $description); } - $creator->addChild('description', $keyDescription); $response = $this->_client->request($packet); From 3933ee1b3afc1652dc20ebe786fa34720999d272 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 25 Feb 2021 11:27:30 +0700 Subject: [PATCH 31/73] Cover new secret key options with unit tests --- tests/SecretKeyTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php index 6d56293f..e8ec4222 100644 --- a/tests/SecretKeyTest.php +++ b/tests/SecretKeyTest.php @@ -14,6 +14,23 @@ public function testCreate() static::$_client->secretKey()->delete($keyId); } + public function testCreateAutoIp() + { + $keyId = static::$_client->secretKey()->create(); + $this->assertNotEmpty($keyId); + static::$_client->secretKey()->delete($keyId); + } + + public function testCreateWithDescription() + { + $keyId = static::$_client->secretKey()->create('192.168.0.1', 'test key'); + $keyInfo = static::$_client->secretKey()->get($keyId); + + $this->assertEquals('test key', $keyInfo->description); + + static::$_client->secretKey()->delete($keyId); + } + public function testGet() { $keyId = static::$_client->secretKey()->create('192.168.0.1'); From f4aa65ea093ff6ee9d9432a007955fdbff959f15 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Fri, 26 Feb 2021 22:00:29 +0700 Subject: [PATCH 32/73] Add missed stat details (based on rene-gates <development@lazybox.de> work) --- src/Api/Struct/Server/Statistics.php | 24 ++++++++++++ .../Struct/Server/Statistics/DiskSpace.php | 25 +++++++++++++ .../Struct/Server/Statistics/LoadAverage.php | 23 ++++++++++++ src/Api/Struct/Server/Statistics/Memory.php | 37 +++++++++++++++++++ src/Api/Struct/Server/Statistics/Objects.php | 36 ++++++++++++++++++ src/Api/Struct/Server/Statistics/Other.php | 25 +++++++++++++ src/Api/Struct/Server/Statistics/Swap.php | 25 +++++++++++++ tests/ServerTest.php | 10 +++++ 8 files changed, 205 insertions(+) create mode 100644 src/Api/Struct/Server/Statistics/DiskSpace.php create mode 100644 src/Api/Struct/Server/Statistics/LoadAverage.php create mode 100644 src/Api/Struct/Server/Statistics/Memory.php create mode 100644 src/Api/Struct/Server/Statistics/Other.php create mode 100644 src/Api/Struct/Server/Statistics/Swap.php diff --git a/src/Api/Struct/Server/Statistics.php b/src/Api/Struct/Server/Statistics.php index e15b5c22..2630ddcc 100644 --- a/src/Api/Struct/Server/Statistics.php +++ b/src/Api/Struct/Server/Statistics.php @@ -11,9 +11,33 @@ class Statistics extends \PleskX\Api\Struct /** @var Statistics\Version */ public $version; + /** @var Statistics\Other */ + public $other; + + /** @var Statistics\LoadAverage */ + public $loadAverage; + + /** @var Statistics\Memory */ + public $memory; + + /** @var Statistics\Swap */ + public $swap; + + /** @var Statistics\DiskSpace[] */ + public $diskSpace; + public function __construct($apiResponse) { $this->objects = new Statistics\Objects($apiResponse->objects); $this->version = new Statistics\Version($apiResponse->version); + $this->other = new Statistics\Other($apiResponse->other); + $this->loadAverage = new Statistics\LoadAverage($apiResponse->load_avg); + $this->memory = new Statistics\Memory($apiResponse->mem); + $this->swap = new Statistics\Swap($apiResponse->swap); + + $this->diskSpace = []; + foreach ($apiResponse->diskspace as $disk) { + $this->diskSpace[(string) $disk->device->name] = new Statistics\DiskSpace($disk->device); + } } } diff --git a/src/Api/Struct/Server/Statistics/DiskSpace.php b/src/Api/Struct/Server/Statistics/DiskSpace.php new file mode 100644 index 00000000..1f21655f --- /dev/null +++ b/src/Api/Struct/Server/Statistics/DiskSpace.php @@ -0,0 +1,25 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskX\Api\Struct\Server\Statistics; + +class DiskSpace extends \PleskX\Api\Struct +{ + /** @var int */ + public $total; + + /** @var int */ + public $used; + + /** @var int */ + public $free; + + public function __construct($apiResponse) + { + $this->_initScalarProperties($apiResponse, [ + 'total', + 'used', + 'free', + ]); + } +} diff --git a/src/Api/Struct/Server/Statistics/LoadAverage.php b/src/Api/Struct/Server/Statistics/LoadAverage.php new file mode 100644 index 00000000..266bde88 --- /dev/null +++ b/src/Api/Struct/Server/Statistics/LoadAverage.php @@ -0,0 +1,23 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskX\Api\Struct\Server\Statistics; + +class LoadAverage extends \PleskX\Api\Struct +{ + /** @var float */ + public $load1min; + + /** @var float */ + public $load5min; + + /** @var float */ + public $load15min; + + public function __construct($apiResponse) + { + $this->load1min = $apiResponse->l1 / 100.0; + $this->load5min = $apiResponse->l5 / 100.0; + $this->load15min = $apiResponse->l15 / 100.0; + } +} diff --git a/src/Api/Struct/Server/Statistics/Memory.php b/src/Api/Struct/Server/Statistics/Memory.php new file mode 100644 index 00000000..7177f9ca --- /dev/null +++ b/src/Api/Struct/Server/Statistics/Memory.php @@ -0,0 +1,37 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskX\Api\Struct\Server\Statistics; + +class Memory extends \PleskX\Api\Struct +{ + /** @var int */ + public $total; + + /** @var int */ + public $used; + + /** @var int */ + public $free; + + /** @var int */ + public $shared; + + /** @var int */ + public $buffer; + + /** @var int */ + public $cached; + + public function __construct($apiResponse) + { + $this->_initScalarProperties($apiResponse, [ + 'total', + 'used', + 'free', + 'shared', + 'buffer', + 'cached', + ]); + } +} diff --git a/src/Api/Struct/Server/Statistics/Objects.php b/src/Api/Struct/Server/Statistics/Objects.php index 7428b1ae..2abb72e6 100644 --- a/src/Api/Struct/Server/Statistics/Objects.php +++ b/src/Api/Struct/Server/Statistics/Objects.php @@ -11,11 +11,47 @@ class Objects extends \PleskX\Api\Struct /** @var int */ public $domains; + /** @var int */ + public $databases; + + /** @var int */ + public $activeDomains; + + /** @var int */ + public $mailBoxes; + + /** @var int */ + public $mailRedirects; + + /** @var int */ + public $mailGroups; + + /** @var int */ + public $mailResponders; + + /** @var int */ + public $databaseUsers; + + /** @var int */ + public $problemClients; + + /** @var int */ + public $problemDomains; + public function __construct($apiResponse) { $this->_initScalarProperties($apiResponse, [ 'clients', 'domains', + 'databases', + ['active_domains' => 'activeDomains'], + ['mail_boxes' => 'mailBoxes'], + ['mail_redirects' => 'mailRedirects'], + ['mail_groups' => 'mailGroups'], + ['mail_responders' => 'mailResponders'], + ['database_users' => 'databaseUsers'], + ['problem_clients' => 'problemClients'], + ['problem_domains' => 'problemDomains'], ]); } } diff --git a/src/Api/Struct/Server/Statistics/Other.php b/src/Api/Struct/Server/Statistics/Other.php new file mode 100644 index 00000000..548fface --- /dev/null +++ b/src/Api/Struct/Server/Statistics/Other.php @@ -0,0 +1,25 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskX\Api\Struct\Server\Statistics; + +class Other extends \PleskX\Api\Struct +{ + /** @var string */ + public $cpu; + + /** @var int */ + public $uptime; + + /** @var bool */ + public $insideVz; + + public function __construct($apiResponse) + { + $this->_initScalarProperties($apiResponse, [ + 'cpu', + 'uptime', + ['inside_vz' => 'insideVz'], + ]); + } +} diff --git a/src/Api/Struct/Server/Statistics/Swap.php b/src/Api/Struct/Server/Statistics/Swap.php new file mode 100644 index 00000000..8e03168f --- /dev/null +++ b/src/Api/Struct/Server/Statistics/Swap.php @@ -0,0 +1,25 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskX\Api\Struct\Server\Statistics; + +class Swap extends \PleskX\Api\Struct +{ + /** @var int */ + public $total; + + /** @var int */ + public $used; + + /** @var int */ + public $free; + + public function __construct($apiResponse) + { + $this->_initScalarProperties($apiResponse, [ + 'total', + 'used', + 'free', + ]); + } +} diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 4408a948..29be9d6c 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -92,9 +92,19 @@ public function testGetStatistics() { $stats = static::$_client->server()->getStatistics(); $this->assertIsNumeric($stats->objects->clients); + $this->assertIsNumeric($stats->objects->domains); + $this->assertIsNumeric($stats->objects->databases); $this->assertEquals('psa', $stats->version->internalName); $this->assertNotEmpty($stats->version->osName); $this->assertNotEmpty($stats->version->osVersion); + $this->assertGreaterThan(0, $stats->other->uptime); + $this->assertGreaterThan(0, strlen($stats->other->cpu)); + $this->assertIsFloat($stats->loadAverage->load1min); + $this->assertGreaterThan(0, $stats->memory->total); + $this->assertGreaterThan($stats->memory->free, $stats->memory->total); + $this->assertIsNumeric($stats->swap->total); + $this->assertIsArray($stats->diskSpace); + $this->assertGreaterThan(0, array_pop($stats->diskSpace)->total); } public function testGetSiteIsolationConfig() From 859c16fc33808b05fbb874edbc6444c2d7d9bf65 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 28 Mar 2021 17:39:44 +0700 Subject: [PATCH 33/73] Add additional fields for webspace (based on Etmolf work) --- src/Api/Struct/Webspace/GeneralInfo.php | 39 +++++++++++++++++++++++-- tests/WebspaceTest.php | 3 ++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index f5736538..0b66e59d 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -5,21 +5,56 @@ class GeneralInfo extends \PleskX\Api\Struct { + /** @var string */ + public $creationDate; + /** @var string */ public $name; /** @var string */ - public $guid; + public $asciiName; + + /** @var string */ + public $status; /** @var int */ public $realSize; + /** @var int */ + public $ownerId; + + /** @var array */ + public $ipAddresses = []; + + /** @var string */ + public $guid; + + /** @var string */ + public $vendorGuid; + + /** @var string */ + public $description; + + /** @var string */ + public $adminDescription; + public function __construct($apiResponse) { $this->_initScalarProperties($apiResponse, [ + ['cr_date' => 'creationDate'], 'name', - 'guid', + 'ascii-name', + 'status', 'real_size', + 'owner-id', + 'guid', + 'vendor-guid', + 'description', + 'admin-description', ]); + + foreach ($apiResponse->dns_ip_address as $ip) { + $this->ipAddresses[] = (string) $ip; + } } } diff --git a/tests/WebspaceTest.php b/tests/WebspaceTest.php index b8444537..efcb5a9c 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceTest.php @@ -179,6 +179,9 @@ public function testGet() $this->assertNotEmpty($webspaceInfo->name); $this->assertEquals(0, $webspaceInfo->realSize); + $this->assertEquals($webspaceInfo->name, $webspaceInfo->asciiName); + $this->assertIsArray($webspaceInfo->ipAddresses); + $this->assertEquals(36, strlen($webspaceInfo->guid)); static::$_client->webspace()->delete('id', $webspace->id); } From e0bc21b23463e9675238f692fdab4811927dde42 Mon Sep 17 00:00:00 2001 From: Nikolay Vizovitin <nvizovitin@plesk.com> Date: Fri, 4 Jun 2021 17:18:40 +0700 Subject: [PATCH 34/73] Switch to new Plesk image for tests in docker. The new image contains real systemd and is required for Plesk >= 18.0.36. It already contains all components required by tests. --- docker-compose.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 501c85a2..0a2e35bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,17 @@ version: '2' services: plesk: - image: plesk/plesk:tests + image: plesk/plesk:latest logging: driver: none ports: ["8443:8443"] + tmpfs: + - /tmp + - /run + - /run/lock + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro tests: build: . environment: @@ -18,4 +24,3 @@ services: - plesk volumes: - .:/opt/api-php-lib - From 9d36db668bbc9074e71d35668f9930ec3179f825 Mon Sep 17 00:00:00 2001 From: Simon Solutions <development@lazybox.de> Date: Thu, 2 Sep 2021 10:08:51 +0200 Subject: [PATCH 35/73] Add additional fields for site --- src/Api/Struct/Site/GeneralInfo.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index 481ea626..7058b7f5 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -5,6 +5,9 @@ class GeneralInfo extends \PleskX\Api\Struct { + /** @var string */ + public $crDate; + /** @var string */ public $name; @@ -17,17 +20,37 @@ class GeneralInfo extends \PleskX\Api\Struct /** @var string */ public $status; + /** @var int */ + public $realSize; + + /** @var array */ + public $ipAddresses = []; + /** @var string */ public $description; + /** @var string */ + public $webspaceGuid; + + /** @var int */ + public $webspaceId; + public function __construct($apiResponse) { $this->_initScalarProperties($apiResponse, [ + 'cr_date', 'name', 'ascii-name', 'status', + 'real_size', 'guid', 'description', + 'webspace-guid', + 'webspace-id', ]); + + foreach ($apiResponse->dns_ip_address as $ip) { + $this->ipAddresses[] = (string) $ip; + } } } From fd74ae25625660f2433224c6d73bc224adb0b422 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Mon, 13 Sep 2021 22:44:01 +0700 Subject: [PATCH 36/73] Test additional properties for sites --- src/Api/Struct/Site/GeneralInfo.php | 4 ++-- tests/SiteTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index 7058b7f5..94b1b4c1 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -6,7 +6,7 @@ class GeneralInfo extends \PleskX\Api\Struct { /** @var string */ - public $crDate; + public $creationDate; /** @var string */ public $name; @@ -38,7 +38,7 @@ class GeneralInfo extends \PleskX\Api\Struct public function __construct($apiResponse) { $this->_initScalarProperties($apiResponse, [ - 'cr_date', + ['cr_date' => 'creationDate'], 'name', 'ascii-name', 'status', diff --git a/tests/SiteTest.php b/tests/SiteTest.php index 80c84138..5ad2ca4c 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -61,6 +61,8 @@ public function testGet() $siteInfo = static::$_client->site()->get('id', $site->id); $this->assertEquals('addon.dom', $siteInfo->name); + $this->assertMatchesRegularExpression("/^\d{4}-\d{2}-\d{2}$/", $siteInfo->creationDate); + $this->assertEquals(36, strlen($siteInfo->guid)); static::$_client->site()->delete('id', $site->id); } From 8f4f9f4da21b9a9482b68ae5363a93e9d025075f Mon Sep 17 00:00:00 2001 From: Simon Solutions <development@lazybox.de> Date: Wed, 8 Sep 2021 20:32:03 +0200 Subject: [PATCH 37/73] Add create session for automatic login with token Add create session tokens for automatic login with token according to: https://docs.plesk.com/en-US/obsidian/api-rpc/about-xml-api/reference/managing-plesk-server/creating-session-tokens.73865/ --- src/Api/Operator/Session.php | 23 +++++++++++++++++++++++ tests/SessionTest.php | 8 ++++++++ 2 files changed, 31 insertions(+) diff --git a/src/Api/Operator/Session.php b/src/Api/Operator/Session.php index eb2970bd..af2b7c68 100644 --- a/src/Api/Operator/Session.php +++ b/src/Api/Operator/Session.php @@ -7,6 +7,29 @@ class Session extends \PleskX\Api\Operator { + /** + * @param string $username + * @param string $userIp + * @param string $sourceServer + * + * @return string + */ + public function create($username, $userIp, $sourceServer = '') + { + $packet = $this->_client->getPacket(); + $creator = $packet->addChild('server')->addChild('create_session'); + + $creator->addChild('login', $username); + $loginData = $creator->addChild('data'); + + $loginData->addChild('user_ip', base64_encode($userIp)); + $loginData->addChild('source_server', base64_encode($sourceServer)); + + $response = $this->_client->request($packet); + + return (string) $response->id; + } + /** * @return Struct\Info[] */ diff --git a/tests/SessionTest.php b/tests/SessionTest.php index 8c97c5b9..dba80779 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -5,6 +5,14 @@ class SessionTest extends TestCase { + + public function testCreate() + { + $sessionToken = static::$_client->session()->create('admin', '127.0.0.1', ''); + + $this->assertIsString($sessionToken); + } + public function testGet() { $sessionId = static::$_client->server()->createSession('admin', '127.0.0.1'); From b0aba3010fedf0fda016653c20b6c6e6500f42cc Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 15 Sep 2021 16:55:42 +0700 Subject: [PATCH 38/73] Fix style issue --- src/Api/Operator/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Operator/Session.php b/src/Api/Operator/Session.php index af2b7c68..c587a490 100644 --- a/src/Api/Operator/Session.php +++ b/src/Api/Operator/Session.php @@ -29,7 +29,7 @@ public function create($username, $userIp, $sourceServer = '') return (string) $response->id; } - + /** * @return Struct\Info[] */ From f2df92b812ee18b9147abc8ea9099c31cb0aa61c Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 15 Sep 2021 16:59:37 +0700 Subject: [PATCH 39/73] Remove deprecated parameter --- src/Api/Operator/Session.php | 5 ++--- tests/SessionTest.php | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Api/Operator/Session.php b/src/Api/Operator/Session.php index c587a490..71d1cc36 100644 --- a/src/Api/Operator/Session.php +++ b/src/Api/Operator/Session.php @@ -10,11 +10,10 @@ class Session extends \PleskX\Api\Operator /** * @param string $username * @param string $userIp - * @param string $sourceServer * * @return string */ - public function create($username, $userIp, $sourceServer = '') + public function create($username, $userIp) { $packet = $this->_client->getPacket(); $creator = $packet->addChild('server')->addChild('create_session'); @@ -23,7 +22,7 @@ public function create($username, $userIp, $sourceServer = '') $loginData = $creator->addChild('data'); $loginData->addChild('user_ip', base64_encode($userIp)); - $loginData->addChild('source_server', base64_encode($sourceServer)); + $loginData->addChild('source_server', ''); $response = $this->_client->request($packet); diff --git a/tests/SessionTest.php b/tests/SessionTest.php index dba80779..ff60b731 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -8,9 +8,10 @@ class SessionTest extends TestCase public function testCreate() { - $sessionToken = static::$_client->session()->create('admin', '127.0.0.1', ''); + $sessionToken = static::$_client->session()->create('admin', '127.0.0.1'); $this->assertIsString($sessionToken); + $this->assertGreaterThan(10, strlen($sessionToken)); } public function testGet() From ecd3f5c70746b4771c0ce27119886d596b9f5085 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 15 Sep 2021 17:51:31 +0700 Subject: [PATCH 40/73] Remove redundant new line --- tests/SessionTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/SessionTest.php b/tests/SessionTest.php index ff60b731..4486103f 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -5,7 +5,6 @@ class SessionTest extends TestCase { - public function testCreate() { $sessionToken = static::$_client->session()->create('admin', '127.0.0.1'); From c8a200eaddc8c7f89ad594cdca1e4a9e5fc5e2f2 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 15 Sep 2021 18:08:32 +0700 Subject: [PATCH 41/73] Demonstrate how to create a secret key for multiple IP addresses --- tests/SecretKeyTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php index e8ec4222..0e04ccaa 100644 --- a/tests/SecretKeyTest.php +++ b/tests/SecretKeyTest.php @@ -21,6 +21,13 @@ public function testCreateAutoIp() static::$_client->secretKey()->delete($keyId); } + public function testCreateMultiIps() + { + $keyId = static::$_client->secretKey()->create(join(',', ['192.168.0.1', '192.168.0.2'])); + $this->assertMatchesRegularExpression('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $keyId); + static::$_client->secretKey()->delete($keyId); + } + public function testCreateWithDescription() { $keyId = static::$_client->secretKey()->create('192.168.0.1', 'test key'); From ca9bbac31ceb6346bbfdca809f206f34a18133a2 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 16 Sep 2021 11:12:56 +0700 Subject: [PATCH 42/73] Introduce GitHub Action for CI --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..622691cd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,11 @@ +name: test + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: docker-compose run tests + - run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file From 9fb853c8d2eb3f484e4aa7cd245ef2cbd14af808 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 16 Sep 2021 11:36:06 +0700 Subject: [PATCH 43/73] Get rid of TravisCI integration --- .travis.yml | 8 -------- README.md | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e866c8b9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: docker - -script: - - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - - docker-compose run tests - -after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/README.md b/README.md index a5fcac86..ac6c2e9d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## PHP library for Plesk XML-RPC API -[![Build Status](https://travis-ci.com/plesk/api-php-lib.svg?branch=master)](https://travis-ci.com/plesk/api-php-lib) +[![Test Status](https://github.com/plesk/api-php-lib/actions/workflows/test.yml/badge.svg)](https://github.com/plesk/api-php-lib/actions/workflows/test.yml) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/plesk/api-php-lib/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/plesk/api-php-lib/?branch=master) [![StyleCI](https://styleci.io/repos/26514840/shield?branch=master)](https://styleci.io/repos/26514840) [![codecov](https://codecov.io/gh/plesk/api-php-lib/branch/master/graph/badge.svg?token=5Kwbddpdeb)](https://codecov.io/gh/plesk/api-php-lib) From a665af5ebf853f6fedf83b010c7c32d5744d94ee Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Fri, 17 Sep 2021 22:53:04 +0700 Subject: [PATCH 44/73] Prefill object id for fetch operations --- src/Api/Operator.php | 6 +++++- src/Api/Struct/Customer/GeneralInfo.php | 3 +++ src/Api/Struct/Site/GeneralInfo.php | 3 +++ src/Api/Struct/Webspace/GeneralInfo.php | 3 +++ tests/CustomerTest.php | 1 + tests/MailTest.php | 1 + tests/ResellerTest.php | 1 + tests/SiteTest.php | 5 +++++ tests/SubdomainTest.php | 1 + tests/WebspaceTest.php | 2 ++ 10 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Api/Operator.php b/src/Api/Operator.php index bab9b2b3..1179d1e7 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -96,7 +96,11 @@ protected function _getItems($structClass, $infoTag, $field = null, $value = nul if (!isset($xmlResult->data) || !isset($xmlResult->data->$infoTag)) { continue; } - $items[] = new $structClass($xmlResult->data->$infoTag); + $item = new $structClass($xmlResult->data->$infoTag); + if (isset($xmlResult->id) && property_exists($item, 'id')) { + $item->id = (int) $xmlResult->id; + } + $items[] = $item; } return $items; diff --git a/src/Api/Struct/Customer/GeneralInfo.php b/src/Api/Struct/Customer/GeneralInfo.php index efa1f411..345d35af 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -5,6 +5,9 @@ class GeneralInfo extends \PleskX\Api\Struct { + /** @var int */ + public $id; + /** @var string */ public $company; diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index 94b1b4c1..99c65154 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -5,6 +5,9 @@ class GeneralInfo extends \PleskX\Api\Struct { + /** @var int */ + public $id; + /** @var string */ public $creationDate; diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index 0b66e59d..fab75043 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -5,6 +5,9 @@ class GeneralInfo extends \PleskX\Api\Struct { + /** @var int */ + public $id; + /** @var string */ public $creationDate; diff --git a/tests/CustomerTest.php b/tests/CustomerTest.php index f33c9241..895162cc 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerTest.php @@ -49,6 +49,7 @@ public function testGet() $this->assertEquals('john@smith.com', $customerInfo->email); $this->assertEquals('Good guy', $customerInfo->description); $this->assertEquals('link:12345', $customerInfo->externalId); + $this->assertEquals($customer->id, $customerInfo->id); static::$_client->customer()->delete('id', $customer->id); } diff --git a/tests/MailTest.php b/tests/MailTest.php index 54f5804a..948c26c5 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -61,6 +61,7 @@ public function testGet() $mailnameInfo = static::$_client->mail()->get('test', static::$webspace->id); $this->assertEquals('test', $mailnameInfo->name); + $this->assertEquals($mailname->id, $mailnameInfo->id); static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); } diff --git a/tests/ResellerTest.php b/tests/ResellerTest.php index d27d9893..3d1c0831 100644 --- a/tests/ResellerTest.php +++ b/tests/ResellerTest.php @@ -42,6 +42,7 @@ public function testGet() $this->assertEquals('John Reseller', $resellerInfo->personalName); $this->assertEquals('reseller-unit-test', $resellerInfo->login); $this->assertGreaterThan(0, count($resellerInfo->permissions)); + $this->assertEquals($reseller->id, $resellerInfo->id); static::$_client->reseller()->delete('id', $reseller->id); } diff --git a/tests/SiteTest.php b/tests/SiteTest.php index 5ad2ca4c..c1f2703b 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -64,6 +64,10 @@ public function testGet() $this->assertMatchesRegularExpression("/^\d{4}-\d{2}-\d{2}$/", $siteInfo->creationDate); $this->assertEquals(36, strlen($siteInfo->guid)); + $siteGuid = $siteInfo->guid; + $siteInfo = static::$_client->site()->get('guid', $siteGuid); + $this->assertEquals($site->id, $siteInfo->id); + static::$_client->site()->delete('id', $site->id); } @@ -102,6 +106,7 @@ public function testGetAll() $this->assertCount(2, $sitesInfo); $this->assertEquals('addon.dom', $sitesInfo[0]->name); $this->assertEquals('addon.dom', $sitesInfo[0]->asciiName); + $this->assertEquals($site->id, $sitesInfo[0]->id); static::$_client->site()->delete('id', $site->id); static::$_client->site()->delete('id', $site2->id); diff --git a/tests/SubdomainTest.php b/tests/SubdomainTest.php index c6624919..bd75f9e9 100644 --- a/tests/SubdomainTest.php +++ b/tests/SubdomainTest.php @@ -61,6 +61,7 @@ public function testGet() $subdomainInfo = static::$_client->subdomain()->get('id', $subdomain->id); $this->assertEquals($name.'.'.$subdomainInfo->parent, $subdomainInfo->name); $this->assertTrue(false !== strpos($subdomainInfo->properties['www_root'], $name)); + $this->assertEquals($subdomain->id, $subdomainInfo->id); static::$_client->subdomain()->delete('id', $subdomain->id); } diff --git a/tests/WebspaceTest.php b/tests/WebspaceTest.php index efcb5a9c..0288c525 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceTest.php @@ -182,6 +182,8 @@ public function testGet() $this->assertEquals($webspaceInfo->name, $webspaceInfo->asciiName); $this->assertIsArray($webspaceInfo->ipAddresses); $this->assertEquals(36, strlen($webspaceInfo->guid)); + $this->assertMatchesRegularExpression("/^\d{4}-\d{2}-\d{2}$/", $webspaceInfo->creationDate); + $this->assertEquals($webspace->id, $webspaceInfo->id); static::$_client->webspace()->delete('id', $webspace->id); } From a7e1c46b3e12322a2a2313a7d49a7f16be62a8c5 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Fri, 1 Oct 2021 11:48:40 +0700 Subject: [PATCH 45/73] Bump min PHP version to 7.4 --- Dockerfile | 2 +- composer.json | 2 +- composer.lock | 670 ++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 483 insertions(+), 191 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6d754473..b114ff79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.3-cli +FROM php:7.4-cli RUN apt-get update \ && apt-get install -y unzip \ diff --git a/composer.json b/composer.json index 3142565c..7e338eb9 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "ext-curl": "*", "ext-xml": "*", "ext-simplexml": "*" diff --git a/composer.lock b/composer.lock index 1c6fbd7f..b3c5da1a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "330651d827abd67d78e7962e9cd539d5", + "content-hash": "8433bb66b607b76ea1c1e4d9255eabaa", "packages": [], "packages-dev": [ { @@ -67,6 +67,10 @@ "stdio", "stdout" ], + "support": { + "issues": "https://github.com/clue/reactphp-stdio/issues", + "source": "https://github.com/clue/reactphp-stdio/tree/v2.4.0" + }, "funding": [ { "url": "https://clue.engineering/support", @@ -136,6 +140,10 @@ "vt100", "xterm" ], + "support": { + "issues": "https://github.com/clue/reactphp-term/issues", + "source": "https://github.com/clue/reactphp-term/tree/v1.3.0" + }, "funding": [ { "url": "https://clue.engineering/support", @@ -195,6 +203,10 @@ "utf-8", "utf8" ], + "support": { + "issues": "https://github.com/clue/reactphp-utf8/issues", + "source": "https://github.com/clue/reactphp-utf8/tree/v1.2.0" + }, "funding": [ { "url": "https://clue.engineering/support", @@ -256,6 +268,10 @@ "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", @@ -313,20 +329,24 @@ "event-dispatcher", "event-emitter" ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/master" + }, "time": "2017-07-23T21:35:13+00:00" }, { "name": "jolicode/jolinotif", - "version": "v2.2.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/jolicode/JoliNotif.git", - "reference": "52f5b98f964f6009b8ec4c0e951edcd0862e2ac7" + "reference": "9cca717bbc47aa2ffeca51d77daa13b824a489ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/52f5b98f964f6009b8ec4c0e951edcd0862e2ac7", - "reference": "52f5b98f964f6009b8ec4c0e951edcd0862e2ac7", + "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/9cca717bbc47aa2ffeca51d77daa13b824a489ee", + "reference": "9cca717bbc47aa2ffeca51d77daa13b824a489ee", "shasum": "" }, "require": { @@ -344,7 +364,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "2.3.x-dev" } }, "autoload": { @@ -370,7 +390,17 @@ "notification", "windows" ], - "time": "2020-06-17T08:25:38+00:00" + "support": { + "issues": "https://github.com/jolicode/JoliNotif/issues", + "source": "https://github.com/jolicode/JoliNotif/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/jolicode/jolinotif", + "type": "tidelift" + } + ], + "time": "2021-03-07T12:30:00+00:00" }, { "name": "myclabs/deep-copy", @@ -418,6 +448,10 @@ "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", @@ -428,16 +462,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.10.4", + "version": "v4.13.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" + "reference": "50953a2691a922aa1769461637869a0a2faa3f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", + "reference": "50953a2691a922aa1769461637869a0a2faa3f53", "shasum": "" }, "require": { @@ -476,20 +510,24 @@ "parser", "php" ], - "time": "2020-12-20T10:01:03+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" + }, + "time": "2021-09-20T12:20:58+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { @@ -532,20 +570,24 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2020-06-27T14:33:11+00:00" + "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.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { @@ -579,7 +621,11 @@ } ], "description": "Library for handling version information and constraints", - "time": "2020-12-13T23:18:30+00:00" + "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", @@ -628,6 +674,10 @@ "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" }, { @@ -680,20 +730,24 @@ } ], "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/master" + }, "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", "shasum": "" }, "require": { @@ -701,7 +755,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -725,37 +780,41 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-09-17T18:55:26+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0" + }, + "time": "2021-09-17T15:28:14+00:00" }, { "name": "phpspec/prophecy", - "version": "1.12.2", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "245710e971a030f42e08f4912863805570f23d39" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", - "reference": "245710e971a030f42e08f4912863805570f23d39", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "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", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -788,27 +847,31 @@ "spy", "stub" ], - "time": "2020-12-19T10:15:11+00:00" + "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.5", + "version": "9.2.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.12.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -855,13 +918,17 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2020-11-28T06:44:49+00:00" + "time": "2021-09-17T05:39:03+00:00" }, { "name": "phpunit/php-file-iterator", @@ -911,6 +978,10 @@ "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", @@ -970,6 +1041,10 @@ "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", @@ -1025,6 +1100,10 @@ "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", @@ -1080,6 +1159,10 @@ "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", @@ -1090,16 +1173,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.1", + "version": "9.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7bdf4085de85a825f4424eae52c99a1cec2f360", - "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { @@ -1111,11 +1194,11 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.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.3", + "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", @@ -1129,7 +1212,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3", + "sebastian/type": "^2.3.4", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -1175,6 +1258,10 @@ "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", @@ -1185,31 +1272,26 @@ "type": "github" } ], - "time": "2021-01-17T07:42:25+00:00" + "time": "2021-09-25T07:38:51+00:00" }, { "name": "psr/container", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -1222,7 +1304,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -1234,27 +1316,31 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" }, { "name": "react/event-loop", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/reactphp/event-loop.git", - "reference": "6d24de090cd59cfc830263cfba965be77b563c13" + "reference": "be6dee480fc4692cec0504e65eb486e3be1aa6f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/6d24de090cd59cfc830263cfba965be77b563c13", - "reference": "6d24de090cd59cfc830263cfba965be77b563c13", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/be6dee480fc4692cec0504e65eb486e3be1aa6f2", + "reference": "be6dee480fc4692cec0504e65eb486e3be1aa6f2", "shasum": "" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "suggest": { "ext-event": "~1.0 for ExtEventLoop", @@ -1271,35 +1357,71 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", "keywords": [ "asynchronous", "event-loop" ], - "time": "2020-01-01T18:39:52+00:00" + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-07-11T12:31:24+00:00" }, { "name": "react/stream", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/reactphp/stream.git", - "reference": "7c02b510ee3f582c810aeccd3a197b9c2f52ff1a" + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/7c02b510ee3f582c810aeccd3a197b9c2f52ff1a", - "reference": "7c02b510ee3f582c810aeccd3a197b9c2f52ff1a", + "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.8", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5" + "react/event-loop": "^1.2" }, "require-dev": { "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { @@ -1311,6 +1433,28 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ "event-driven", @@ -1322,7 +1466,21 @@ "stream", "writable" ], - "time": "2020-05-04T10:17:57+00:00" + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-07-11T12:37:55+00:00" }, { "name": "sebastian/cli-parser", @@ -1368,6 +1526,10 @@ ], "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", @@ -1420,6 +1582,10 @@ ], "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", @@ -1471,6 +1637,10 @@ ], "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", @@ -1541,6 +1711,10 @@ "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", @@ -1594,6 +1768,10 @@ ], "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", @@ -1656,6 +1834,10 @@ "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", @@ -1715,6 +1897,10 @@ "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", @@ -1788,6 +1974,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -1798,16 +1988,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.2", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { @@ -1848,13 +2038,17 @@ "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": "2020-10-26T15:55:19+00:00" + "time": "2021-06-11T13:31:12+00:00" }, { "name": "sebastian/lines-of-code", @@ -1901,6 +2095,10 @@ ], "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", @@ -1954,6 +2152,10 @@ ], "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", @@ -2005,6 +2207,10 @@ ], "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", @@ -2064,6 +2270,10 @@ ], "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", @@ -2115,6 +2325,10 @@ ], "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", @@ -2125,16 +2339,16 @@ }, { "name": "sebastian/type", - "version": "2.3.1", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { @@ -2167,13 +2381,17 @@ ], "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": "2020-10-26T13:18:59+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", @@ -2216,6 +2434,10 @@ ], "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", @@ -2226,25 +2448,26 @@ }, { "name": "spatie/phpunit-watcher", - "version": "1.23.1", + "version": "1.23.2", "source": { "type": "git", "url": "https://github.com/spatie/phpunit-watcher.git", - "reference": "0c70d569658a1cad9a6869716a4351d2ccfec4d1" + "reference": "548be41abab87336ef95cef5bf5cbd564bce5c26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/0c70d569658a1cad9a6869716a4351d2ccfec4d1", - "reference": "0c70d569658a1cad9a6869716a4351d2ccfec4d1", + "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/548be41abab87336ef95cef5bf5cbd564bce5c26", + "reference": "548be41abab87336ef95cef5bf5cbd564bce5c26", "shasum": "" }, "require": { - "clue/stdio-react": "^2.0", - "jolicode/jolinotif": "^2.0", + "clue/stdio-react": "^2.4", + "jolicode/jolinotif": "^2.2", "php": "^7.2 | ^8.0", - "symfony/console": "^5.0", - "symfony/process": "^5.0", - "symfony/yaml": "^5.0", + "symfony/console": "^5.2", + "symfony/finder": "^5.2", + "symfony/process": "^5.2", + "symfony/yaml": "^5.2", "yosymfony/resource-watcher": "^2.0" }, "conflict": { @@ -2280,31 +2503,37 @@ "phpunit-watcher", "spatie" ], - "time": "2020-10-31T17:47:29+00:00" + "support": { + "issues": "https://github.com/spatie/phpunit-watcher/issues", + "source": "https://github.com/spatie/phpunit-watcher/tree/1.23.2" + }, + "time": "2021-02-26T08:00:42+00:00" }, { "name": "symfony/console", - "version": "v5.2.2", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d62ec79478b55036f65e2602e282822b8eaaff0a" + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d62ec79478b55036f65e2602e282822b8eaaff0a", - "reference": "d62ec79478b55036f65e2602e282822b8eaaff0a", + "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2", "symfony/string": "^5.1" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -2312,10 +2541,10 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/event-dispatcher": "^4.4|^5.0", @@ -2360,6 +2589,9 @@ "console", "terminal" ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.3.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2374,20 +2606,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-08-25T20:02:16+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.2.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", "shasum": "" }, "require": { @@ -2396,7 +2628,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -2424,6 +2656,9 @@ ], "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", @@ -2438,24 +2673,25 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/finder", - "version": "v5.2.2", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "196f45723b5e618bf0e23b97e96d11652696ea9e" + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/196f45723b5e618bf0e23b97e96d11652696ea9e", - "reference": "196f45723b5e618bf0e23b97e96d11652696ea9e", + "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -2482,6 +2718,9 @@ ], "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.3.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2496,20 +2735,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -2521,7 +2760,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2558,6 +2797,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2572,20 +2814,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af" + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/267a9adeb8ecb8071040a740930e077cdfb987af", - "reference": "267a9adeb8ecb8071040a740930e077cdfb987af", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "" }, "require": { @@ -2597,7 +2839,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2636,6 +2878,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2650,20 +2895,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba" + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/6e971c891537eb617a00bb07a43d182a6915faba", - "reference": "6e971c891537eb617a00bb07a43d182a6915faba", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { @@ -2675,7 +2920,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2717,6 +2962,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2731,20 +2979,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T17:09:11+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -2756,7 +3004,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2794,6 +3042,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2808,20 +3059,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.22.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { @@ -2830,7 +3081,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2870,6 +3121,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2884,20 +3138,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.22.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -2906,7 +3160,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2950,6 +3204,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2964,25 +3221,25 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/process", - "version": "v5.2.2", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -3009,6 +3266,9 @@ ], "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.3.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3023,25 +3283,25 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.2.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.0" + "psr/container": "^1.1" }, "suggest": { "symfony/service-implementation": "" @@ -3049,7 +3309,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -3085,6 +3345,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3099,20 +3362,20 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-04-01T10:43:52+00:00" }, { "name": "symfony/string", - "version": "v5.2.2", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "c95468897f408dd0aca2ff582074423dd0455122" + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c95468897f408dd0aca2ff582074423dd0455122", - "reference": "c95468897f408dd0aca2ff582074423dd0455122", + "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", "shasum": "" }, "require": { @@ -3165,6 +3428,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.3.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3179,20 +3445,20 @@ "type": "tidelift" } ], - "time": "2021-01-25T15:14:59+00:00" + "time": "2021-08-26T08:00:08+00:00" }, { "name": "symfony/yaml", - "version": "v5.2.2", + "version": "v5.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "6bb8b36c6dea8100268512bf46e858c8eb5c545e" + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/6bb8b36c6dea8100268512bf46e858c8eb5c545e", - "reference": "6bb8b36c6dea8100268512bf46e858c8eb5c545e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", "shasum": "" }, "require": { @@ -3237,6 +3503,9 @@ ], "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.3.6" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -3251,20 +3520,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-07-29T06:20:01+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -3291,34 +3560,49 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2020-07-12T23:59:07+00:00" + "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.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -3340,7 +3624,11 @@ "check", "validate" ], - "time": "2020-07-08T17:02:28+00:00" + "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" }, { "name": "yosymfony/resource-watcher", @@ -3393,6 +3681,10 @@ "symfony", "watcher" ], + "support": { + "issues": "https://github.com/yosymfony/resource-watcher/issues", + "source": "https://github.com/yosymfony/resource-watcher/tree/master" + }, "time": "2020-01-04T15:36:55+00:00" } ], @@ -3402,11 +3694,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "ext-curl": "*", "ext-xml": "*", "ext-simplexml": "*" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } From 15837e8a4501936a526fdadfb6ef88755ce3b667 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Fri, 1 Oct 2021 12:11:17 +0700 Subject: [PATCH 46/73] Introduce code linting using Psalm --- composer.json | 6 +- composer.lock | 833 ++++++++++++++++++++++++++++++++++++++++++++- psalm.xml | 15 + src/Api/Client.php | 1 + 4 files changed, 852 insertions(+), 3 deletions(-) create mode 100644 psalm.xml diff --git a/composer.json b/composer.json index 7e338eb9..29246498 100644 --- a/composer.json +++ b/composer.json @@ -21,14 +21,16 @@ }, "require-dev": { "phpunit/phpunit": "^9", - "spatie/phpunit-watcher": "^1.22" + "spatie/phpunit-watcher": "^1.22", + "vimeo/psalm": "^4.10" }, "config": { "process-timeout": 0 }, "scripts": { "test": "phpunit", - "test:watch": "phpunit-watcher watch" + "test:watch": "phpunit-watcher watch", + "lint": "psalm" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index b3c5da1a..0c022bf2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,175 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8433bb66b607b76ea1c1e4d9255eabaa", + "content-hash": "29ddab81b559997ef3ca40b6a2c85d56", "packages": [], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.6.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", + "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^7 | ^8 | ^9", + "psalm/phar": "^3.11@dev", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/v2.6.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-09-23T18:43:08+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.8.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.4", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "psalm/phar": "^3.11.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-03-30T17:13:30+00:00" + }, { "name": "clue/stdio-react", "version": "v2.4.0", @@ -219,6 +385,261 @@ ], "time": "2020-11-06T11:48:09+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.4", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b174585d1fe49ceed21928a945138948cb394600" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", + "reference": "b174585d1fe49ceed21928a945138948cb394600", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-09-13T08:41:34+00:00" + }, + { + "name": "composer/semver", + "version": "3.2.5", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-05-24T12:41:47+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-07-31T17:03:58+00:00" + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, + "time": "2019-12-04T15:06:13+00:00" + }, { "name": "doctrine/instantiator", "version": "1.4.0", @@ -335,6 +756,107 @@ }, "time": "2017-07-23T21:35:13+00:00" }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + }, + "time": "2021-06-11T22:34:44+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "support": { + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/1.5.1" + }, + "time": "2021-02-22T14:02:09+00:00" + }, { "name": "jolicode/jolinotif", "version": "v2.3.0", @@ -460,6 +982,57 @@ ], "time": "2020-11-13T09:40:50+00:00" }, + { + "name": "netresearch/jsonmapper", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + }, + "time": "2020-12-01T19:48:11+00:00" + }, { "name": "nikic/php-parser", "version": "v4.13.0", @@ -516,6 +1089,59 @@ }, "time": "2021-09-20T12:20:58+00:00" }, + { + "name": "openlss/lib-array2xml", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "support": { + "issues": "https://github.com/nullivex/lib-array2xml/issues", + "source": "https://github.com/nullivex/lib-array2xml/tree/master" + }, + "time": "2019-03-29T20:06:56+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -1322,6 +1948,56 @@ }, "time": "2021-03-05T17:36:06+00:00" }, + { + "name": "psr/log", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "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/2.0.0" + }, + "time": "2021-07-14T16:41:46+00:00" + }, { "name": "react/event-loop", "version": "v1.2.0", @@ -3572,6 +4248,111 @@ ], "time": "2021-07-28T10:34:58+00:00" }, + { + "name": "vimeo/psalm", + "version": "4.10.0", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "916b098b008f6de4543892b1e0651c1c3b92cbfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/916b098b008f6de4543892b1e0651c1c3b92cbfa", + "reference": "916b098b008f6de4543892b1e0651c1c3b92cbfa", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.4.2", + "amphp/byte-stream": "^1.5", + "composer/package-versions-deprecated": "^1.8.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.1 || ^2.0", + "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.12", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0||^6.0", + "ext-curl": "*", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0||dev-master", + "phpspec/prophecy": ">=1.9.0", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.16", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3 || ^5.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" + }, + "suggest": { + "ext-igbinary": "^2.0.5" + }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\": "src/Psalm/" + }, + "files": [ + "src/functions.php", + "src/spl_object_id.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "support": { + "issues": "https://github.com/vimeo/psalm/issues", + "source": "https://github.com/vimeo/psalm/tree/4.10.0" + }, + "time": "2021-09-04T21:00:09+00:00" + }, { "name": "webmozart/assert", "version": "1.10.0", @@ -3630,6 +4411,56 @@ }, "time": "2021-03-09T10:59:23+00:00" }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "support": { + "issues": "https://github.com/webmozart/path-util/issues", + "source": "https://github.com/webmozart/path-util/tree/2.3.0" + }, + "time": "2015-12-17T08:42:14+00:00" + }, { "name": "yosymfony/resource-watcher", "version": "v2.0.1", diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 00000000..7c0333df --- /dev/null +++ b/psalm.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<psalm + errorLevel="7" + resolveFromConfigFile="true" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="https://getpsalm.org/schema/config" + xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" +> + <projectFiles> + <directory name="src" /> + <ignoreFiles> + <directory name="vendor" /> + </ignoreFiles> + </projectFiles> +</psalm> diff --git a/src/Api/Client.php b/src/Api/Client.php index 3f79d3f1..85094041 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -166,6 +166,7 @@ public function request($request, $mode = self::RESPONSE_SHORT) if ('sdk' == $this->_protocol) { $version = ('' == $this->_version) ? null : $this->_version; $requestXml = new SimpleXMLElement((string) $request); + /** @psalm-suppress UndefinedClass */ $xml = \pm_ApiRpc::getService($version)->call($requestXml->children()[0]->asXml(), $this->_login); } else { $xml = $this->_performHttpRequest($request); From 0fdd640872971a78378cd0efe17a87df8e40b409 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Fri, 1 Oct 2021 13:20:14 +0700 Subject: [PATCH 47/73] Fix psr/log dependecy conflict instroduced due to PHP 8 usage --- composer.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index 0c022bf2..8e37f4e7 100644 --- a/composer.lock +++ b/composer.lock @@ -1950,30 +1950,30 @@ }, { "name": "psr/log", - "version": "2.0.0", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1994,9 +1994,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2021-07-14T16:41:46+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "react/event-loop", From 8ad734553e67e90ffdebdef296e6a25287f5ce10 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Fri, 1 Oct 2021 20:00:04 +0700 Subject: [PATCH 48/73] Use type hints instead of doc blocks --- psalm.xml | 5 ++ src/Api/Client.php | 42 ++++++------ src/Api/InternalClient.php | 4 +- src/Api/Operator.php | 9 +-- src/Api/Operator/DatabaseServer.php | 2 +- src/Api/Operator/DnsTemplate.php | 2 +- src/Api/Operator/EventLog.php | 2 +- src/Api/Operator/ProtectedDirectory.php | 2 +- src/Api/Operator/SecretKey.php | 2 +- src/Api/Operator/Server.php | 57 +++++----------- src/Api/Operator/VirtualDirectory.php | 2 +- src/Api/Operator/Webspace.php | 27 ++++---- src/Api/Struct.php | 24 +++++-- src/Api/Struct/Certificate/Info.php | 14 ++-- src/Api/Struct/Customer/GeneralInfo.php | 68 ++++++------------- src/Api/Struct/Customer/Info.php | 14 ++-- src/Api/Struct/Database/Info.php | 32 ++++----- src/Api/Struct/Database/UserInfo.php | 18 +++-- src/Api/Struct/DatabaseServer/Info.php | 22 +++--- src/Api/Struct/Dns/Info.php | 36 ++++------ src/Api/Struct/EventLog/DetailedEvent.php | 36 ++++------ src/Api/Struct/EventLog/Event.php | 22 +++--- src/Api/Struct/Ip/Info.php | 22 +++--- src/Api/Struct/Locale/Info.php | 18 +++-- src/Api/Struct/Mail/GeneralInfo.php | 18 +++-- src/Api/Struct/Mail/Info.php | 14 ++-- src/Api/Struct/PhpHandler/Info.php | 44 ++++-------- .../Struct/ProtectedDirectory/DataInfo.php | 10 ++- src/Api/Struct/ProtectedDirectory/Info.php | 6 +- .../Struct/ProtectedDirectory/UserInfo.php | 10 +-- src/Api/Struct/Reseller/GeneralInfo.php | 22 +++--- src/Api/Struct/Reseller/Info.php | 14 ++-- src/Api/Struct/SecretKey/Info.php | 22 +++--- src/Api/Struct/Server/Admin.php | 18 +++-- src/Api/Struct/Server/GeneralInfo.php | 18 +++-- src/Api/Struct/Server/Preferences.php | 18 +++-- src/Api/Struct/Server/SessionPreferences.php | 10 +-- src/Api/Struct/Server/Statistics.php | 7 +- .../Struct/Server/Statistics/DiskSpace.php | 18 +++-- .../Struct/Server/Statistics/LoadAverage.php | 18 +++-- src/Api/Struct/Server/Statistics/Memory.php | 32 ++++----- src/Api/Struct/Server/Statistics/Objects.php | 52 +++++--------- src/Api/Struct/Server/Statistics/Other.php | 18 +++-- src/Api/Struct/Server/Statistics/Swap.php | 18 +++-- src/Api/Struct/Server/Statistics/Version.php | 32 ++++----- src/Api/Struct/Server/UpdatesInfo.php | 14 ++-- src/Api/Struct/ServicePlan/Info.php | 22 +++--- src/Api/Struct/Session/Info.php | 32 ++++----- src/Api/Struct/Site/GeneralInfo.php | 52 +++++--------- src/Api/Struct/Site/HostingInfo.php | 14 ++-- src/Api/Struct/Site/Info.php | 14 ++-- src/Api/Struct/SiteAlias/GeneralInfo.php | 18 +++-- src/Api/Struct/SiteAlias/Info.php | 14 ++-- src/Api/Struct/Subdomain/Info.php | 22 +++--- src/Api/Struct/Ui/CustomButton.php | 40 ++++------- src/Api/Struct/Webspace/DiskUsage.php | 53 +++++---------- src/Api/Struct/Webspace/GeneralInfo.php | 58 ++++++---------- .../Struct/Webspace/HostingPropertyInfo.php | 18 +++-- src/Api/Struct/Webspace/Info.php | 18 +++-- src/Api/Struct/Webspace/Limit.php | 14 ++-- src/Api/Struct/Webspace/LimitDescriptor.php | 10 +-- src/Api/Struct/Webspace/LimitInfo.php | 18 +++-- src/Api/Struct/Webspace/Limits.php | 14 ++-- .../Struct/Webspace/PermissionDescriptor.php | 10 +-- src/Api/Struct/Webspace/PermissionInfo.php | 18 +++-- src/Api/Struct/Webspace/PhpSettings.php | 10 +-- .../Webspace/PhysicalHostingDescriptor.php | 10 +-- 67 files changed, 579 insertions(+), 815 deletions(-) diff --git a/psalm.xml b/psalm.xml index 7c0333df..ab2b5f01 100644 --- a/psalm.xml +++ b/psalm.xml @@ -12,4 +12,9 @@ <directory name="vendor" /> </ignoreFiles> </projectFiles> + + <issueHandlers> + <PropertyNotSetInConstructor errorLevel="suppress" /> + <UndefinedPropertyFetch errorLevel="suppress" /> + </issueHandlers> </psalm> diff --git a/src/Api/Client.php b/src/Api/Client.php index 85094041..4b7fa38e 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -13,16 +13,16 @@ class Client const RESPONSE_SHORT = 1; const RESPONSE_FULL = 2; - protected $_host; - protected $_port; - protected $_protocol; - protected $_login; - protected $_password; - protected $_proxy = ''; - protected $_secretKey; - protected $_version = ''; + protected string $_host; + protected int $_port; + protected string $_protocol; + protected string $_login = ''; + protected string $_password = ''; + protected string $_proxy = ''; + protected string $_secretKey = ''; + protected string $_version = ''; - protected $_operatorsCache = []; + protected array $_operatorsCache = []; /** * @var callable @@ -36,7 +36,7 @@ class Client * @param int $port * @param string $protocol */ - public function __construct($host, $port = 8443, $protocol = 'https') + public function __construct(string $host, int $port = 8443, string $protocol = 'https') { $this->_host = $host; $this->_port = $port; @@ -49,7 +49,7 @@ public function __construct($host, $port = 8443, $protocol = 'https') * @param string $login * @param string $password */ - public function setCredentials($login, $password) + public function setCredentials(string $login, string $password): void { $this->_login = $login; $this->_password = $password; @@ -60,7 +60,7 @@ public function setCredentials($login, $password) * * @param string $secretKey */ - public function setSecretKey($secretKey) + public function setSecretKey(string $secretKey): void { $this->_secretKey = $secretKey; } @@ -70,7 +70,7 @@ public function setSecretKey($secretKey) * * @param string $proxy */ - public function setProxy($proxy) + public function setProxy(string $proxy): void { $this->_proxy = $proxy; } @@ -80,7 +80,7 @@ public function setProxy($proxy) * * @param string $version */ - public function setVersion($version) + public function setVersion(string $version): void { $this->_version = $version; } @@ -90,7 +90,7 @@ public function setVersion($version) * * @param callable|null $function */ - public function setVerifyResponse(callable $function = null) + public function setVerifyResponse(callable $function = null): void { $this->_verifyResponseCallback = $function; } @@ -100,7 +100,7 @@ public function setVerifyResponse(callable $function = null) * * @return string */ - public function getHost() + public function getHost(): string { return $this->_host; } @@ -110,7 +110,7 @@ public function getHost() * * @return int */ - public function getPort() + public function getPort(): int { return $this->_port; } @@ -120,7 +120,7 @@ public function getPort() * * @return string */ - public function getProtocol() + public function getProtocol(): string { return $this->_protocol; } @@ -132,7 +132,7 @@ public function getProtocol() * * @return SimpleXMLElement */ - public function getPacket($version = null) + public function getPacket($version = null): SimpleXMLElement { $protocolVersion = !is_null($version) ? $version : $this->_version; $content = "<?xml version='1.0' encoding='UTF-8' ?>"; @@ -295,7 +295,7 @@ protected function _getHeaders() * * @throws Exception */ - protected function _verifyResponse($xml) + protected function _verifyResponse($xml): void { if ($xml->system && $xml->system->status && 'error' == (string) $xml->system->status) { throw new Exception((string) $xml->system->errtext, (int) $xml->system->errcode); @@ -315,7 +315,7 @@ protected function _verifyResponse($xml) * @param string $request * @param SimpleXMLElement $xml * - * @return string + * @return false|string */ protected function _expandRequestShortSyntax($request, SimpleXMLElement $xml) { diff --git a/src/Api/InternalClient.php b/src/Api/InternalClient.php index 6ec687f2..e399c965 100644 --- a/src/Api/InternalClient.php +++ b/src/Api/InternalClient.php @@ -16,9 +16,9 @@ public function __construct() /** * Setup login to execute requests under certain user. * - * @param $login + * @param string $login */ - public function setLogin($login) + public function setLogin(string $login): void { $this->_login = $login; } diff --git a/src/Api/Operator.php b/src/Api/Operator.php index 1179d1e7..2e617b8a 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -5,17 +5,14 @@ class Operator { - /** @var string|null */ - protected $_wrapperTag = null; - - /** @var \PleskX\Api\Client */ - protected $_client; + protected string $_wrapperTag = ''; + protected Client $_client; public function __construct($client) { $this->_client = $client; - if (is_null($this->_wrapperTag)) { + if ('' === $this->_wrapperTag) { $classNameParts = explode('\\', get_class($this)); $this->_wrapperTag = end($classNameParts); $this->_wrapperTag = strtolower(preg_replace('/([a-z])([A-Z])/', '\1-\2', $this->_wrapperTag)); diff --git a/src/Api/Operator/DatabaseServer.php b/src/Api/Operator/DatabaseServer.php index 482d1d81..ba70c38f 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -7,7 +7,7 @@ class DatabaseServer extends \PleskX\Api\Operator { - protected $_wrapperTag = 'db_server'; + protected string $_wrapperTag = 'db_server'; /** * @return array diff --git a/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index 4b79df77..bbf21b44 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -7,7 +7,7 @@ class DnsTemplate extends \PleskX\Api\Operator { - protected $_wrapperTag = 'dns'; + protected string $_wrapperTag = 'dns'; /** * @param array $properties diff --git a/src/Api/Operator/EventLog.php b/src/Api/Operator/EventLog.php index 6b7325a7..ae319bab 100644 --- a/src/Api/Operator/EventLog.php +++ b/src/Api/Operator/EventLog.php @@ -7,7 +7,7 @@ class EventLog extends \PleskX\Api\Operator { - protected $_wrapperTag = 'event_log'; + protected string $_wrapperTag = 'event_log'; /** * @return Struct\Event[] diff --git a/src/Api/Operator/ProtectedDirectory.php b/src/Api/Operator/ProtectedDirectory.php index af643b0a..cf43903a 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -7,7 +7,7 @@ class ProtectedDirectory extends \PleskX\Api\Operator { - protected $_wrapperTag = 'protected-dir'; + protected string $_wrapperTag = 'protected-dir'; /** * @param string $name diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index 5b739f10..a5f0ee2c 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -7,7 +7,7 @@ class SecretKey extends \PleskX\Api\Operator { - protected $_wrapperTag = 'secret_key'; + protected string $_wrapperTag = 'secret_key'; /** * @param string $ipAddress diff --git a/src/Api/Operator/Server.php b/src/Api/Operator/Server.php index 65cbae61..38342b7a 100644 --- a/src/Api/Operator/Server.php +++ b/src/Api/Operator/Server.php @@ -4,13 +4,11 @@ namespace PleskX\Api\Operator; use PleskX\Api\Struct\Server as Struct; +use PleskX\Api\XmlResponse; class Server extends \PleskX\Api\Operator { - /** - * @return array - */ - public function getProtos() + public function getProtos(): array { $packet = $this->_client->getPacket(); $packet->addChild($this->_wrapperTag)->addChild('get_protos'); @@ -19,25 +17,22 @@ public function getProtos() return (array) $response->protos->proto; } - public function getGeneralInfo() + public function getGeneralInfo(): Struct\GeneralInfo { return new Struct\GeneralInfo($this->_getInfo('gen_info')); } - public function getPreferences() + public function getPreferences(): Struct\Preferences { return new Struct\Preferences($this->_getInfo('prefs')); } - public function getAdmin() + public function getAdmin(): Struct\Admin { return new Struct\Admin($this->_getInfo('admin')); } - /** - * @return array - */ - public function getKeyInfo() + public function getKeyInfo(): array { $keyInfo = []; $keyInfoXml = $this->_getInfo('key'); @@ -49,10 +44,7 @@ public function getKeyInfo() return $keyInfo; } - /** - * @return array - */ - public function getComponents() + public function getComponents(): array { $components = []; $componentsXml = $this->_getInfo('components'); @@ -64,10 +56,7 @@ public function getComponents() return $components; } - /** - * @return array - */ - public function getServiceStates() + public function getServiceStates(): array { $states = []; $statesXml = $this->_getInfo('services_state'); @@ -83,15 +72,12 @@ public function getServiceStates() return $states; } - public function getSessionPreferences() + public function getSessionPreferences(): Struct\SessionPreferences { return new Struct\SessionPreferences($this->_getInfo('session_setup')); } - /** - * @return array - */ - public function getShells() + public function getShells(): array { $shells = []; $shellsXml = $this->_getInfo('shells'); @@ -103,25 +89,19 @@ public function getShells() return $shells; } - /** - * @return array - */ - public function getNetworkInterfaces() + public function getNetworkInterfaces(): array { $interfacesXml = $this->_getInfo('interfaces'); return (array) $interfacesXml->interface; } - public function getStatistics() + public function getStatistics(): Struct\Statistics { return new Struct\Statistics($this->_getInfo('stat')); } - /** - * @return array - */ - public function getSiteIsolationConfig() + public function getSiteIsolationConfig(): array { $config = []; $configXml = $this->_getInfo('site-isolation-config'); @@ -133,7 +113,7 @@ public function getSiteIsolationConfig() return $config; } - public function getUpdatesInfo() + public function getUpdatesInfo(): Struct\UpdatesInfo { return new Struct\UpdatesInfo($this->_getInfo('updates')); } @@ -144,7 +124,7 @@ public function getUpdatesInfo() * * @return string */ - public function createSession($login, $clientIp) + public function createSession(string $login, string $clientIp): string { $packet = $this->_client->getPacket(); $sessionNode = $packet->addChild($this->_wrapperTag)->addChild('create_session'); @@ -157,12 +137,7 @@ public function createSession($login, $clientIp) return (string) $response->id; } - /** - * @param string $operation - * - * @return \SimpleXMLElement - */ - private function _getInfo($operation) + private function _getInfo(string $operation): XmlResponse { $packet = $this->_client->getPacket(); $packet->addChild($this->_wrapperTag)->addChild('get')->addChild($operation); diff --git a/src/Api/Operator/VirtualDirectory.php b/src/Api/Operator/VirtualDirectory.php index 1c2ae8b5..0b86149b 100644 --- a/src/Api/Operator/VirtualDirectory.php +++ b/src/Api/Operator/VirtualDirectory.php @@ -5,5 +5,5 @@ class VirtualDirectory extends \PleskX\Api\Operator { - protected $_wrapperTag = 'virtdir'; + protected string $_wrapperTag = 'virtdir'; } diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index e389c576..b8366646 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -3,25 +3,26 @@ namespace PleskX\Api\Operator; +use PleskX\Api\Operator; use PleskX\Api\Struct\Webspace as Struct; -class Webspace extends \PleskX\Api\Operator +class Webspace extends Operator { - public function getPermissionDescriptor() + public function getPermissionDescriptor(): Struct\PermissionDescriptor { $response = $this->request('get-permission-descriptor.filter'); return new Struct\PermissionDescriptor($response); } - public function getLimitDescriptor() + public function getLimitDescriptor(): Struct\LimitDescriptor { $response = $this->request('get-limit-descriptor.filter'); return new Struct\LimitDescriptor($response); } - public function getPhysicalHostingDescriptor() + public function getPhysicalHostingDescriptor(): Struct\PhysicalHostingDescriptor { $response = $this->request('get-physical-hosting-descriptor.filter'); @@ -34,7 +35,7 @@ public function getPhysicalHostingDescriptor() * * @return Struct\PhpSettings */ - public function getPhpSettings($field, $value) + public function getPhpSettings(string $field, $value): Struct\PhpSettings { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); @@ -53,7 +54,7 @@ public function getPhpSettings($field, $value) * * @return Struct\Limits */ - public function getLimits($field, $value) + public function getLimits(string $field, $value): Struct\Limits { $items = $this->_getItems(Struct\Limits::class, 'limits', $field, $value); @@ -63,11 +64,11 @@ public function getLimits($field, $value) /** * @param array $properties * @param array|null $hostingProperties - * @param $planName + * @param string $planName * * @return Struct\Info */ - public function create(array $properties, array $hostingProperties = null, $planName = null) + public function create(array $properties, array $hostingProperties = null, string $planName = ''): Struct\Info { $packet = $this->_client->getPacket(); $info = $packet->addChild($this->_wrapperTag)->addChild('add'); @@ -90,7 +91,7 @@ public function create(array $properties, array $hostingProperties = null, $plan } } - if ($planName) { + if ('' !== $planName) { $info->addChild('plan-name', $planName); } @@ -105,7 +106,7 @@ public function create(array $properties, array $hostingProperties = null, $plan * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->_delete($field, $value); } @@ -116,7 +117,7 @@ public function delete($field, $value) * * @return Struct\GeneralInfo */ - public function get($field, $value) + public function get(string $field, $value): Struct\GeneralInfo { $items = $this->_getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); @@ -126,7 +127,7 @@ public function get($field, $value) /** * @return Struct\GeneralInfo[] */ - public function getAll() + public function getAll(): array { return $this->_getItems(Struct\GeneralInfo::class, 'gen_info'); } @@ -137,7 +138,7 @@ public function getAll() * * @return Struct\DiskUsage */ - public function getDiskUsage($field, $value) + public function getDiskUsage(string $field, $value): Struct\DiskUsage { $items = $this->_getItems(Struct\DiskUsage::class, 'disk_usage', $field, $value); diff --git a/src/Api/Struct.php b/src/Api/Struct.php index 11d509f0..eb2a8ef4 100644 --- a/src/Api/Struct.php +++ b/src/Api/Struct.php @@ -5,7 +5,13 @@ abstract class Struct { - public function __set($property, $value) + /** + * @param string $property + * @param mixed $value + * + * @throws \Exception + */ + public function __set(string $property, $value) { throw new \Exception("Try to set an undeclared property '$property'."); } @@ -18,20 +24,26 @@ public function __set($property, $value) * * @throws \Exception */ - protected function _initScalarProperties($apiResponse, array $properties) + protected function _initScalarProperties($apiResponse, array $properties): void { foreach ($properties as $property) { if (is_array($property)) { $classPropertyName = current($property); $value = $apiResponse->{key($property)}; } else { - $classPropertyName = $this->_underToCamel(str_replace('-', '_', $property)); + $classPropertyName = $this->underToCamel(str_replace('-', '_', $property)); $value = $apiResponse->$property; } $reflectionProperty = new \ReflectionProperty($this, $classPropertyName); - $docBlock = $reflectionProperty->getDocComment(); - $propertyType = preg_replace('/^.+ @var ([a-z]+) .+$/', '\1', $docBlock); + $propertyType = $reflectionProperty->getType(); + if (is_null($propertyType)) { + $docBlock = $reflectionProperty->getDocComment(); + $propertyType = preg_replace('/^.+ @var ([a-z]+) .+$/', '\1', $docBlock); + } else { + /** @psalm-suppress UndefinedMethod */ + $propertyType = $propertyType->getName(); + } if ('string' == $propertyType) { $value = (string) $value; @@ -54,7 +66,7 @@ protected function _initScalarProperties($apiResponse, array $properties) * * @return string */ - private function _underToCamel($under) + private function underToCamel(string $under): string { $under = '_'.str_replace('_', ' ', strtolower($under)); diff --git a/src/Api/Struct/Certificate/Info.php b/src/Api/Struct/Certificate/Info.php index 7689bcbd..2185c110 100644 --- a/src/Api/Struct/Certificate/Info.php +++ b/src/Api/Struct/Certificate/Info.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Certificate; -class Info extends \PleskX\Api\Struct -{ - /** @var string */ - public $request; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $privateKey; +class Info extends Struct +{ + public string $request; + public string $privateKey; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['csr' => 'request'], diff --git a/src/Api/Struct/Customer/GeneralInfo.php b/src/Api/Struct/Customer/GeneralInfo.php index 345d35af..43f8ab20 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -3,54 +3,28 @@ namespace PleskX\Api\Struct\Customer; -class GeneralInfo extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $company; - - /** @var string */ - public $personalName; - - /** @var string */ - public $login; - - /** @var string */ - public $guid; - - /** @var string */ - public $email; - - /** @var string */ - public $phone; - - /** @var string */ - public $fax; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $address; - - /** @var string */ - public $postalCode; - - /** @var string */ - public $city; - - /** @var string */ - public $state; - - /** @var string */ - public $country; - - /** @var string */ - public $description; - - /** @var string */ - public $externalId; - - public function __construct($apiResponse) +class GeneralInfo extends Struct +{ + public int $id; + public string $company; + public string $personalName; + public string $login; + public string $guid; + public string $email; + public string $phone; + public string $fax; + public string $address; + public string $postalCode; + public string $city; + public string $state; + public string $country; + public string $description; + public string $externalId; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['cname' => 'company'], diff --git a/src/Api/Struct/Customer/Info.php b/src/Api/Struct/Customer/Info.php index 167b2097..926b5519 100644 --- a/src/Api/Struct/Customer/Info.php +++ b/src/Api/Struct/Customer/Info.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Customer; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $guid; +class Info extends Struct +{ + public int $id; + public string $guid; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Database/Info.php b/src/Api/Struct/Database/Info.php index 0066e4a9..9f705656 100644 --- a/src/Api/Struct/Database/Info.php +++ b/src/Api/Struct/Database/Info.php @@ -3,27 +3,19 @@ namespace PleskX\Api\Struct\Database; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $name; - - /** @var string */ - public $type; - - /** @var int */ - public $webspaceId; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $dbServerId; - - /** @var int */ - public $defaultUserId; - - public function __construct($apiResponse) +class Info extends Struct +{ + public int $id; + public string $name; + public string $type; + public int $webspaceId; + public int $dbServerId; + public int $defaultUserId; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Database/UserInfo.php b/src/Api/Struct/Database/UserInfo.php index f5cb166d..cf40013a 100644 --- a/src/Api/Struct/Database/UserInfo.php +++ b/src/Api/Struct/Database/UserInfo.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Database; -class UserInfo extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $login; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $dbId; +class UserInfo extends Struct +{ + public int $id; + public string $login; + public int $dbId; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/DatabaseServer/Info.php b/src/Api/Struct/DatabaseServer/Info.php index 57facc61..3f2dbd5a 100644 --- a/src/Api/Struct/DatabaseServer/Info.php +++ b/src/Api/Struct/DatabaseServer/Info.php @@ -3,21 +3,17 @@ namespace PleskX\Api\Struct\DatabaseServer; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $host; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $port; - - /** @var string */ - public $type; +class Info extends Struct +{ + public int $id; + public string $host; + public int $port; + public string $type; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Dns/Info.php b/src/Api/Struct/Dns/Info.php index 930c7201..161cbee9 100644 --- a/src/Api/Struct/Dns/Info.php +++ b/src/Api/Struct/Dns/Info.php @@ -3,30 +3,20 @@ namespace PleskX\Api\Struct\Dns; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var int */ - public $siteId; - - /** @var int */ - public $siteAliasId; - - /** @var string */ - public $type; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $host; - - /** @var string */ - public $value; - - /** @var string */ - public $opt; - - public function __construct($apiResponse) +class Info extends Struct +{ + public int $id; + public int $siteId; + public int $siteAliasId; + public string $type; + public string $host; + public string $value; + public string $opt; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/EventLog/DetailedEvent.php b/src/Api/Struct/EventLog/DetailedEvent.php index d009c08f..b1cb7c08 100644 --- a/src/Api/Struct/EventLog/DetailedEvent.php +++ b/src/Api/Struct/EventLog/DetailedEvent.php @@ -3,30 +3,20 @@ namespace PleskX\Api\Struct\EventLog; -class DetailedEvent extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $type; - - /** @var int */ - public $time; - - /** @var string */ - public $class; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $objectId; - - /** @var string */ - public $user; - - /** @var string */ - public $host; - - public function __construct($apiResponse) +class DetailedEvent extends Struct +{ + public int $id; + public string $type; + public int $time; + public string $class; + public string $objectId; + public string $user; + public string $host; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/EventLog/Event.php b/src/Api/Struct/EventLog/Event.php index 67fdff88..cc3be1cf 100644 --- a/src/Api/Struct/EventLog/Event.php +++ b/src/Api/Struct/EventLog/Event.php @@ -3,21 +3,17 @@ namespace PleskX\Api\Struct\EventLog; -class Event extends \PleskX\Api\Struct -{ - /** @var string */ - public $type; - - /** @var int */ - public $time; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $class; - - /** @var string */ - public $id; +class Event extends Struct +{ + public string $type; + public int $time; + public string $class; + public string $id; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'type', diff --git a/src/Api/Struct/Ip/Info.php b/src/Api/Struct/Ip/Info.php index ed79a6dc..17cffdd3 100644 --- a/src/Api/Struct/Ip/Info.php +++ b/src/Api/Struct/Ip/Info.php @@ -3,21 +3,17 @@ namespace PleskX\Api\Struct\Ip; -class Info extends \PleskX\Api\Struct -{ - /** @var string */ - public $ipAddress; - - /** @var string */ - public $netmask; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $type; - - /** @var string */ - public $interface; +class Info extends Struct +{ + public string $ipAddress; + public string $netmask; + public string $type; + public string $interface; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'ip_address', diff --git a/src/Api/Struct/Locale/Info.php b/src/Api/Struct/Locale/Info.php index 619e7a6a..4fbe4478 100644 --- a/src/Api/Struct/Locale/Info.php +++ b/src/Api/Struct/Locale/Info.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Locale; -class Info extends \PleskX\Api\Struct -{ - /** @var string */ - public $id; - - /** @var string */ - public $language; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $country; +class Info extends Struct +{ + public string $id; + public string $language; + public string $country; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Mail/GeneralInfo.php b/src/Api/Struct/Mail/GeneralInfo.php index 798aca95..dfa1615f 100644 --- a/src/Api/Struct/Mail/GeneralInfo.php +++ b/src/Api/Struct/Mail/GeneralInfo.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Mail; -class GeneralInfo extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $name; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $description; +class GeneralInfo extends Struct +{ + public int $id; + public string $name; + public string $description; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Mail/Info.php b/src/Api/Struct/Mail/Info.php index 566d00bc..63cc84e0 100644 --- a/src/Api/Struct/Mail/Info.php +++ b/src/Api/Struct/Mail/Info.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Mail; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $name; +class Info extends Struct +{ + public int $id; + public string $name; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/PhpHandler/Info.php b/src/Api/Struct/PhpHandler/Info.php index 5a14de6b..d95c3a92 100644 --- a/src/Api/Struct/PhpHandler/Info.php +++ b/src/Api/Struct/PhpHandler/Info.php @@ -4,40 +4,22 @@ namespace PleskX\Api\Struct\PhpHandler; use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; class Info extends Struct { - /** @var string */ - public $id; - - /** @var string */ - public $displayName; - - /** @var string */ - public $fullVersion; - - /** @var string */ - public $version; - - /** @var string */ - public $type; - - /** @var string */ - public $path; - - /** @var string */ - public $clipath; - - /** @var string */ - public $phpini; - - /** @var string */ - public $custom; - - /** @var string */ - public $handlerStatus; - - public function __construct($apiResponse) + public string $id; + public string $displayName; + public string $fullVersion; + public string $version; + public string $type; + public string $path; + public string $clipath; + public string $phpini; + public string $custom; + public string $handlerStatus; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/ProtectedDirectory/DataInfo.php b/src/Api/Struct/ProtectedDirectory/DataInfo.php index 5dfe5dd6..4a1216cb 100644 --- a/src/Api/Struct/ProtectedDirectory/DataInfo.php +++ b/src/Api/Struct/ProtectedDirectory/DataInfo.php @@ -4,16 +4,14 @@ namespace PleskX\Api\Struct\ProtectedDirectory; use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; class DataInfo extends Struct { - /** @var string */ - public $name; + public string $name; + public string $header; - /** @var string */ - public $header; - - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/ProtectedDirectory/Info.php b/src/Api/Struct/ProtectedDirectory/Info.php index af3c755c..90651336 100644 --- a/src/Api/Struct/ProtectedDirectory/Info.php +++ b/src/Api/Struct/ProtectedDirectory/Info.php @@ -4,13 +4,13 @@ namespace PleskX\Api\Struct\ProtectedDirectory; use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; class Info extends Struct { - /** @var int */ - public $id; + public int $id; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/ProtectedDirectory/UserInfo.php b/src/Api/Struct/ProtectedDirectory/UserInfo.php index 61f6040f..a6d4b74a 100644 --- a/src/Api/Struct/ProtectedDirectory/UserInfo.php +++ b/src/Api/Struct/ProtectedDirectory/UserInfo.php @@ -3,12 +3,14 @@ namespace PleskX\Api\Struct\ProtectedDirectory; -class UserInfo extends \PleskX\Api\Struct +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; + +class UserInfo extends Struct { - /** @var int */ - public $id; + public int $id; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Reseller/GeneralInfo.php b/src/Api/Struct/Reseller/GeneralInfo.php index 6c5ebd63..c946356d 100644 --- a/src/Api/Struct/Reseller/GeneralInfo.php +++ b/src/Api/Struct/Reseller/GeneralInfo.php @@ -3,21 +3,17 @@ namespace PleskX\Api\Struct\Reseller; -class GeneralInfo extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $personalName; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $login; - - /** @var array */ - public $permissions; +class GeneralInfo extends Struct +{ + public int $id; + public string $personalName; + public string $login; + public array $permissions; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse->{'gen-info'}, [ ['pname' => 'personalName'], diff --git a/src/Api/Struct/Reseller/Info.php b/src/Api/Struct/Reseller/Info.php index a1b6bf80..1ef61d2b 100644 --- a/src/Api/Struct/Reseller/Info.php +++ b/src/Api/Struct/Reseller/Info.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Reseller; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $guid; +class Info extends Struct +{ + public int $id; + public string $guid; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/SecretKey/Info.php b/src/Api/Struct/SecretKey/Info.php index 14d110f9..2b2eec03 100644 --- a/src/Api/Struct/SecretKey/Info.php +++ b/src/Api/Struct/SecretKey/Info.php @@ -3,21 +3,17 @@ namespace PleskX\Api\Struct\SecretKey; -class Info extends \PleskX\Api\Struct -{ - /** @var string */ - public $key; - - /** @var string */ - public $ipAddress; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $description; - - /** @var string */ - public $login; +class Info extends Struct +{ + public string $key; + public string $ipAddress; + public string $description; + public string $login; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'key', diff --git a/src/Api/Struct/Server/Admin.php b/src/Api/Struct/Server/Admin.php index dfd0d7ac..69bff6ea 100644 --- a/src/Api/Struct/Server/Admin.php +++ b/src/Api/Struct/Server/Admin.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Server; -class Admin extends \PleskX\Api\Struct -{ - /** @var string */ - public $companyName; - - /** @var string */ - public $name; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $email; +class Admin extends Struct +{ + public string $companyName; + public string $name; + public string $email; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['admin_cname' => 'companyName'], diff --git a/src/Api/Struct/Server/GeneralInfo.php b/src/Api/Struct/Server/GeneralInfo.php index 15fee92b..9c1f63d2 100644 --- a/src/Api/Struct/Server/GeneralInfo.php +++ b/src/Api/Struct/Server/GeneralInfo.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Server; -class GeneralInfo extends \PleskX\Api\Struct -{ - /** @var string */ - public $serverName; - - /** @var string */ - public $serverGuid; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $mode; +class GeneralInfo extends Struct +{ + public string $serverName; + public string $serverGuid; + public string $mode; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'server_name', diff --git a/src/Api/Struct/Server/Preferences.php b/src/Api/Struct/Server/Preferences.php index 905656c0..e6529bf3 100644 --- a/src/Api/Struct/Server/Preferences.php +++ b/src/Api/Struct/Server/Preferences.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Server; -class Preferences extends \PleskX\Api\Struct -{ - /** @var int */ - public $statTtl; - - /** @var int */ - public $trafficAccounting; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $restartApacheInterval; +class Preferences extends Struct +{ + public int $statTtl; + public int $trafficAccounting; + public int $restartApacheInterval; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'stat_ttl', diff --git a/src/Api/Struct/Server/SessionPreferences.php b/src/Api/Struct/Server/SessionPreferences.php index 654958fa..69a5c2aa 100644 --- a/src/Api/Struct/Server/SessionPreferences.php +++ b/src/Api/Struct/Server/SessionPreferences.php @@ -3,12 +3,14 @@ namespace PleskX\Api\Struct\Server; -class SessionPreferences extends \PleskX\Api\Struct +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; + +class SessionPreferences extends Struct { - /** @var int */ - public $loginTimeout; + public int $loginTimeout; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'login_timeout', diff --git a/src/Api/Struct/Server/Statistics.php b/src/Api/Struct/Server/Statistics.php index 2630ddcc..0894801e 100644 --- a/src/Api/Struct/Server/Statistics.php +++ b/src/Api/Struct/Server/Statistics.php @@ -3,7 +3,10 @@ namespace PleskX\Api\Struct\Server; -class Statistics extends \PleskX\Api\Struct +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; + +class Statistics extends Struct { /** @var Statistics\Objects */ public $objects; @@ -26,7 +29,7 @@ class Statistics extends \PleskX\Api\Struct /** @var Statistics\DiskSpace[] */ public $diskSpace; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->objects = new Statistics\Objects($apiResponse->objects); $this->version = new Statistics\Version($apiResponse->version); diff --git a/src/Api/Struct/Server/Statistics/DiskSpace.php b/src/Api/Struct/Server/Statistics/DiskSpace.php index 1f21655f..5fb6dca8 100644 --- a/src/Api/Struct/Server/Statistics/DiskSpace.php +++ b/src/Api/Struct/Server/Statistics/DiskSpace.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Server\Statistics; -class DiskSpace extends \PleskX\Api\Struct -{ - /** @var int */ - public $total; - - /** @var int */ - public $used; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $free; +class DiskSpace extends Struct +{ + public int $total; + public int $used; + public int $free; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'total', diff --git a/src/Api/Struct/Server/Statistics/LoadAverage.php b/src/Api/Struct/Server/Statistics/LoadAverage.php index 266bde88..69aefc22 100644 --- a/src/Api/Struct/Server/Statistics/LoadAverage.php +++ b/src/Api/Struct/Server/Statistics/LoadAverage.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Server\Statistics; -class LoadAverage extends \PleskX\Api\Struct -{ - /** @var float */ - public $load1min; - - /** @var float */ - public $load5min; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var float */ - public $load15min; +class LoadAverage extends Struct +{ + public float $load1min; + public float $load5min; + public float $load15min; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->load1min = $apiResponse->l1 / 100.0; $this->load5min = $apiResponse->l5 / 100.0; diff --git a/src/Api/Struct/Server/Statistics/Memory.php b/src/Api/Struct/Server/Statistics/Memory.php index 7177f9ca..44b12a38 100644 --- a/src/Api/Struct/Server/Statistics/Memory.php +++ b/src/Api/Struct/Server/Statistics/Memory.php @@ -3,27 +3,19 @@ namespace PleskX\Api\Struct\Server\Statistics; -class Memory extends \PleskX\Api\Struct -{ - /** @var int */ - public $total; - - /** @var int */ - public $used; - - /** @var int */ - public $free; - - /** @var int */ - public $shared; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $buffer; - - /** @var int */ - public $cached; - - public function __construct($apiResponse) +class Memory extends Struct +{ + public int $total; + public int $used; + public int $free; + public int $shared; + public int $buffer; + public int $cached; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'total', diff --git a/src/Api/Struct/Server/Statistics/Objects.php b/src/Api/Struct/Server/Statistics/Objects.php index 2abb72e6..00d119c5 100644 --- a/src/Api/Struct/Server/Statistics/Objects.php +++ b/src/Api/Struct/Server/Statistics/Objects.php @@ -3,42 +3,24 @@ namespace PleskX\Api\Struct\Server\Statistics; -class Objects extends \PleskX\Api\Struct -{ - /** @var int */ - public $clients; - - /** @var int */ - public $domains; - - /** @var int */ - public $databases; - - /** @var int */ - public $activeDomains; - - /** @var int */ - public $mailBoxes; - - /** @var int */ - public $mailRedirects; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $mailGroups; - - /** @var int */ - public $mailResponders; - - /** @var int */ - public $databaseUsers; - - /** @var int */ - public $problemClients; - - /** @var int */ - public $problemDomains; - - public function __construct($apiResponse) +class Objects extends Struct +{ + public int $clients; + public int $domains; + public int $databases; + public int $activeDomains; + public int $mailBoxes; + public int $mailRedirects; + public int $mailGroups; + public int $mailResponders; + public int $databaseUsers; + public int $problemClients; + public int $problemDomains; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'clients', diff --git a/src/Api/Struct/Server/Statistics/Other.php b/src/Api/Struct/Server/Statistics/Other.php index 548fface..e102fb5e 100644 --- a/src/Api/Struct/Server/Statistics/Other.php +++ b/src/Api/Struct/Server/Statistics/Other.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Server\Statistics; -class Other extends \PleskX\Api\Struct -{ - /** @var string */ - public $cpu; - - /** @var int */ - public $uptime; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var bool */ - public $insideVz; +class Other extends Struct +{ + public string $cpu; + public int $uptime; + public bool $insideVz; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'cpu', diff --git a/src/Api/Struct/Server/Statistics/Swap.php b/src/Api/Struct/Server/Statistics/Swap.php index 8e03168f..23154ee4 100644 --- a/src/Api/Struct/Server/Statistics/Swap.php +++ b/src/Api/Struct/Server/Statistics/Swap.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Server\Statistics; -class Swap extends \PleskX\Api\Struct -{ - /** @var int */ - public $total; - - /** @var int */ - public $used; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $free; +class Swap extends Struct +{ + public int $total; + public int $used; + public int $free; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'total', diff --git a/src/Api/Struct/Server/Statistics/Version.php b/src/Api/Struct/Server/Statistics/Version.php index 9fca7c0a..45fc541e 100644 --- a/src/Api/Struct/Server/Statistics/Version.php +++ b/src/Api/Struct/Server/Statistics/Version.php @@ -3,27 +3,19 @@ namespace PleskX\Api\Struct\Server\Statistics; -class Version extends \PleskX\Api\Struct -{ - /** @var string */ - public $internalName; - - /** @var string */ - public $version; - - /** @var string */ - public $build; - - /** @var string */ - public $osName; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $osVersion; - - /** @var string */ - public $osRelease; - - public function __construct($apiResponse) +class Version extends Struct +{ + public string $internalName; + public string $version; + public string $build; + public string $osName; + public string $osVersion; + public string $osRelease; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['plesk_name' => 'internalName'], diff --git a/src/Api/Struct/Server/UpdatesInfo.php b/src/Api/Struct/Server/UpdatesInfo.php index bdd2e7c7..34c7501d 100644 --- a/src/Api/Struct/Server/UpdatesInfo.php +++ b/src/Api/Struct/Server/UpdatesInfo.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Server; -class UpdatesInfo extends \PleskX\Api\Struct -{ - /** @var string */ - public $lastInstalledUpdate; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var bool */ - public $installUpdatesAutomatically; +class UpdatesInfo extends Struct +{ + public string $lastInstalledUpdate; + public bool $installUpdatesAutomatically; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'last_installed_update', diff --git a/src/Api/Struct/ServicePlan/Info.php b/src/Api/Struct/ServicePlan/Info.php index dd53595a..794c82af 100644 --- a/src/Api/Struct/ServicePlan/Info.php +++ b/src/Api/Struct/ServicePlan/Info.php @@ -3,21 +3,17 @@ namespace PleskX\Api\Struct\ServicePlan; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $name; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $guid; - - /** @var string */ - public $externalId; +class Info extends Struct +{ + public int $id; + public string $name; + public string $guid; + public string $externalId; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Session/Info.php b/src/Api/Struct/Session/Info.php index 51024cbc..70d2e866 100644 --- a/src/Api/Struct/Session/Info.php +++ b/src/Api/Struct/Session/Info.php @@ -3,27 +3,19 @@ namespace PleskX\Api\Struct\Session; -class Info extends \PleskX\Api\Struct -{ - /** @var string */ - public $id; - - /** @var string */ - public $type; - - /** @var string */ - public $ipAddress; - - /** @var string */ - public $login; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $loginTime; - - /** @var string */ - public $idle; - - public function __construct($apiResponse) +class Info extends Struct +{ + public string $id; + public string $type; + public string $ipAddress; + public string $login; + public string $loginTime; + public string $idle; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index 99c65154..f13913f3 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -3,42 +3,24 @@ namespace PleskX\Api\Struct\Site; -class GeneralInfo extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $creationDate; - - /** @var string */ - public $name; - - /** @var string */ - public $asciiName; - - /** @var string */ - public $guid; - - /** @var string */ - public $status; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $realSize; - - /** @var array */ - public $ipAddresses = []; - - /** @var string */ - public $description; - - /** @var string */ - public $webspaceGuid; - - /** @var int */ - public $webspaceId; - - public function __construct($apiResponse) +class GeneralInfo extends Struct +{ + public int $id; + public string $creationDate; + public string $name; + public string $asciiName; + public string $guid; + public string $status; + public int $realSize; + public array $ipAddresses = []; + public string $description; + public string $webspaceGuid; + public int $webspaceId; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['cr_date' => 'creationDate'], diff --git a/src/Api/Struct/Site/HostingInfo.php b/src/Api/Struct/Site/HostingInfo.php index c473d7b8..2cb08f17 100644 --- a/src/Api/Struct/Site/HostingInfo.php +++ b/src/Api/Struct/Site/HostingInfo.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Site; -class HostingInfo extends \PleskX\Api\Struct -{ - /** @var array */ - public $properties = []; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $ipAddress; +class HostingInfo extends Struct +{ + public array $properties = []; + public string $ipAddress; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { foreach ($apiResponse->vrt_hst->property as $property) { $this->properties[(string) $property->name] = (string) $property->value; diff --git a/src/Api/Struct/Site/Info.php b/src/Api/Struct/Site/Info.php index ea69dd94..5a12761e 100644 --- a/src/Api/Struct/Site/Info.php +++ b/src/Api/Struct/Site/Info.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Site; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $guid; +class Info extends Struct +{ + public int $id; + public string $guid; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/SiteAlias/GeneralInfo.php b/src/Api/Struct/SiteAlias/GeneralInfo.php index 256b5ca0..73c2c8fe 100644 --- a/src/Api/Struct/SiteAlias/GeneralInfo.php +++ b/src/Api/Struct/SiteAlias/GeneralInfo.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\SiteAlias; -class GeneralInfo extends \PleskX\Api\Struct -{ - /** @var string */ - public $name; - - /** @var string */ - public $asciiName; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $status; +class GeneralInfo extends Struct +{ + public string $name; + public string $asciiName; + public string $status; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/SiteAlias/Info.php b/src/Api/Struct/SiteAlias/Info.php index b60fce71..0950bcc9 100644 --- a/src/Api/Struct/SiteAlias/Info.php +++ b/src/Api/Struct/SiteAlias/Info.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\SiteAlias; -class Info extends \PleskX\Api\Struct -{ - /** @var string */ - public $status; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $id; +class Info extends Struct +{ + public string $status; + public int $id; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Subdomain/Info.php b/src/Api/Struct/Subdomain/Info.php index 9e43dafc..a766fc73 100644 --- a/src/Api/Struct/Subdomain/Info.php +++ b/src/Api/Struct/Subdomain/Info.php @@ -3,21 +3,17 @@ namespace PleskX\Api\Struct\Subdomain; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $parent; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $name; - - /** @var array */ - public $properties; +class Info extends Struct +{ + public int $id; + public string $parent; + public string $name; + public array $properties; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->properties = []; $this->_initScalarProperties($apiResponse, [ diff --git a/src/Api/Struct/Ui/CustomButton.php b/src/Api/Struct/Ui/CustomButton.php index ed7a712f..8b6622df 100644 --- a/src/Api/Struct/Ui/CustomButton.php +++ b/src/Api/Struct/Ui/CustomButton.php @@ -3,33 +3,21 @@ namespace PleskX\Api\Struct\Ui; -class CustomButton extends \PleskX\Api\Struct -{ - /** @var string */ - public $id; - - /** @var int */ - public $sortKey; - - /** @var bool */ - public $public; - - /** @var bool */ - public $internal; - - /** @var bool */ - public $noFrame; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $place; - - /** @var string */ - public $url; - - /** @var string */ - public $text; - - public function __construct($apiResponse) +class CustomButton extends Struct +{ + public int $id; + public int $sortKey; + public bool $public; + public bool $internal; + public bool $noFrame; + public string $place; + public string $url; + public string $text; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, ['id']); $this->_initScalarProperties($apiResponse->properties, [ diff --git a/src/Api/Struct/Webspace/DiskUsage.php b/src/Api/Struct/Webspace/DiskUsage.php index 320f105a..377700f5 100644 --- a/src/Api/Struct/Webspace/DiskUsage.php +++ b/src/Api/Struct/Webspace/DiskUsage.php @@ -1,45 +1,26 @@ <?php // Copyright 1999-2021. Plesk International GmbH. -// Author: Frederic Leclercq namespace PleskX\Api\Struct\Webspace; -class DiskUsage extends \PleskX\Api\Struct -{ - /** @var int */ - public $httpdocs; - - /** @var int */ - public $httpsdocs; - - /** @var int */ - public $subdomains; - - /** @var int */ - public $anonftp; - - /** @var int */ - public $logs; - - /** @var int */ - public $dbases; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var int */ - public $mailboxes; - - /** @var int */ - public $maillists; - - /** @var int */ - public $domaindumps; - - /** @var int */ - public $configs; - - /** @var int */ - public $chroot; - - public function __construct($apiResponse) +class DiskUsage extends Struct +{ + public int $httpdocs; + public int $httpsdocs; + public int $subdomains; + public int $anonftp; + public int $logs; + public int $dbases; + public int $mailboxes; + public int $maillists; + public int $domaindumps; + public int $configs; + public int $chroot; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'httpdocs', diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index fab75043..33d39802 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -3,45 +3,27 @@ namespace PleskX\Api\Struct\Webspace; -class GeneralInfo extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $creationDate; - - /** @var string */ - public $name; - - /** @var string */ - public $asciiName; - - /** @var string */ - public $status; - - /** @var int */ - public $realSize; - - /** @var int */ - public $ownerId; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var array */ - public $ipAddresses = []; - - /** @var string */ - public $guid; - - /** @var string */ - public $vendorGuid; - - /** @var string */ - public $description; - - /** @var string */ - public $adminDescription; - - public function __construct($apiResponse) +class GeneralInfo extends Struct +{ + public int $id; + public string $creationDate; + public string $name; + public string $asciiName; + public string $status; + public int $realSize; + public int $ownerId; + public array $ipAddresses = []; + public string $guid; + public string $vendorGuid; + public string $description; + + /** @var string */ + public string $adminDescription; + + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['cr_date' => 'creationDate'], diff --git a/src/Api/Struct/Webspace/HostingPropertyInfo.php b/src/Api/Struct/Webspace/HostingPropertyInfo.php index 7922d18c..c5f2f158 100644 --- a/src/Api/Struct/Webspace/HostingPropertyInfo.php +++ b/src/Api/Struct/Webspace/HostingPropertyInfo.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Webspace; -class HostingPropertyInfo extends \PleskX\Api\Struct -{ - /** @var string */ - public $name; - - /** @var string */ - public $type; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $label; +class HostingPropertyInfo extends Struct +{ + public string $name; + public string $type; + public string $label; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/Info.php b/src/Api/Struct/Webspace/Info.php index d71cef6d..8fac2be0 100644 --- a/src/Api/Struct/Webspace/Info.php +++ b/src/Api/Struct/Webspace/Info.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Webspace; -class Info extends \PleskX\Api\Struct -{ - /** @var int */ - public $id; - - /** @var string */ - public $guid; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $name; +class Info extends Struct +{ + public int $id; + public string $guid; + public string $name; - public function __construct($apiResponse, $name = '') + public function __construct(XmlResponse $apiResponse, string $name = '') { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Webspace/Limit.php b/src/Api/Struct/Webspace/Limit.php index 9faf882e..95d668d5 100644 --- a/src/Api/Struct/Webspace/Limit.php +++ b/src/Api/Struct/Webspace/Limit.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Webspace; -class Limit extends \PleskX\Api\Struct -{ - /** @var string */ - public $name; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $value; +class Limit extends Struct +{ + public string $name; + public string $value; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/LimitDescriptor.php b/src/Api/Struct/Webspace/LimitDescriptor.php index e1d383ba..6ceb0a74 100644 --- a/src/Api/Struct/Webspace/LimitDescriptor.php +++ b/src/Api/Struct/Webspace/LimitDescriptor.php @@ -3,12 +3,14 @@ namespace PleskX\Api\Struct\Webspace; -class LimitDescriptor extends \PleskX\Api\Struct +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; + +class LimitDescriptor extends Struct { - /** @var array */ - public $limits; + public array $limits; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->limits = []; diff --git a/src/Api/Struct/Webspace/LimitInfo.php b/src/Api/Struct/Webspace/LimitInfo.php index b8af3b67..c3f20ee5 100644 --- a/src/Api/Struct/Webspace/LimitInfo.php +++ b/src/Api/Struct/Webspace/LimitInfo.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Webspace; -class LimitInfo extends \PleskX\Api\Struct -{ - /** @var string */ - public $name; - - /** @var string */ - public $type; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $label; +class LimitInfo extends Struct +{ + public string $name; + public string $type; + public string $label; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/Limits.php b/src/Api/Struct/Webspace/Limits.php index e6313ea1..bdb970d6 100644 --- a/src/Api/Struct/Webspace/Limits.php +++ b/src/Api/Struct/Webspace/Limits.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Webspace; -class Limits extends \PleskX\Api\Struct -{ - /** @var string */ - public $overuse; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var array */ - public $limits; +class Limits extends Struct +{ + public string $overuse; + public array $limits; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, ['overuse']); $this->limits = []; diff --git a/src/Api/Struct/Webspace/PermissionDescriptor.php b/src/Api/Struct/Webspace/PermissionDescriptor.php index bc333ba0..3a56882e 100644 --- a/src/Api/Struct/Webspace/PermissionDescriptor.php +++ b/src/Api/Struct/Webspace/PermissionDescriptor.php @@ -3,12 +3,14 @@ namespace PleskX\Api\Struct\Webspace; -class PermissionDescriptor extends \PleskX\Api\Struct +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; + +class PermissionDescriptor extends Struct { - /** @var array */ - public $permissions; + public array $permissions; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->permissions = []; diff --git a/src/Api/Struct/Webspace/PermissionInfo.php b/src/Api/Struct/Webspace/PermissionInfo.php index 9414a31a..8de0c84a 100644 --- a/src/Api/Struct/Webspace/PermissionInfo.php +++ b/src/Api/Struct/Webspace/PermissionInfo.php @@ -3,18 +3,16 @@ namespace PleskX\Api\Struct\Webspace; -class PermissionInfo extends \PleskX\Api\Struct -{ - /** @var string */ - public $name; - - /** @var string */ - public $type; +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; - /** @var string */ - public $label; +class PermissionInfo extends Struct +{ + public string $name; + public string $type; + public string $label; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/PhpSettings.php b/src/Api/Struct/Webspace/PhpSettings.php index 464b2012..37dea7d5 100644 --- a/src/Api/Struct/Webspace/PhpSettings.php +++ b/src/Api/Struct/Webspace/PhpSettings.php @@ -3,12 +3,14 @@ namespace PleskX\Api\Struct\Webspace; -class PhpSettings extends \PleskX\Api\Struct +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; + +class PhpSettings extends Struct { - /** @var array */ - public $properties; + public array $properties; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->properties = []; diff --git a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php index 1aff2f7a..f49e615b 100644 --- a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php +++ b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php @@ -3,12 +3,14 @@ namespace PleskX\Api\Struct\Webspace; -class PhysicalHostingDescriptor extends \PleskX\Api\Struct +use PleskX\Api\Struct; +use PleskX\Api\XmlResponse; + +class PhysicalHostingDescriptor extends Struct { - /** @var array */ - public $properties; + public array $properties; - public function __construct($apiResponse) + public function __construct(XmlResponse $apiResponse) { $this->properties = []; From 21ecea04d96484e3c754f2e2773fabd2deab33a0 Mon Sep 17 00:00:00 2001 From: viacheslav diomidov <vdiomidov@plesk.com> Date: Tue, 5 Oct 2021 14:11:33 +0300 Subject: [PATCH 49/73] BUGFIX EXTREST-137 simpleXml fix for & in values. --- src/Api/Client.php | 9 +++++++-- src/Api/Operator.php | 2 +- src/Api/Operator/Certificate.php | 2 +- src/Api/Operator/Customer.php | 2 +- src/Api/Operator/Database.php | 4 ++-- src/Api/Operator/DatabaseServer.php | 2 +- src/Api/Operator/Dns.php | 4 ++-- src/Api/Operator/DnsTemplate.php | 4 ++-- src/Api/Operator/Mail.php | 4 ++-- src/Api/Operator/ProtectedDirectory.php | 8 ++++---- src/Api/Operator/Reseller.php | 2 +- src/Api/Operator/Site.php | 6 +++--- src/Api/Operator/SiteAlias.php | 2 +- src/Api/Operator/Subdomain.php | 6 +++--- src/Api/Operator/Ui.php | 2 +- src/Api/Operator/Webspace.php | 4 ++-- tests/Utility/PasswordProvider.php | 2 +- 17 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index 4b7fa38e..4132eaeb 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -321,10 +321,15 @@ protected function _expandRequestShortSyntax($request, SimpleXMLElement $xml) { $parts = explode('.', $request); $node = $xml; + $lastParts = end($parts); foreach ($parts as $part) { @list($name, $value) = explode('=', $part); - $node = $node->addChild($name, $value); + if ($part !== $lastParts) { + $node = $node->addChild($name); + } else { + $node->{$name} = (string) $value; + } } return $xml->asXML(); @@ -346,7 +351,7 @@ protected function _arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = if (is_array($value)) { $this->_arrayToXml($value, $this->_isAssocArray($value) ? $xml->addChild($el) : $xml, $el); } else { - $xml->addChild($el, $value); + $xml->{$el} = (string) $value; } } diff --git a/src/Api/Operator.php b/src/Api/Operator.php index 2e617b8a..60b5b541 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -78,7 +78,7 @@ protected function _getItems($structClass, $infoTag, $field = null, $value = nul $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->{$field} = $value; } $getTag->addChild('dataset')->addChild($infoTag); diff --git a/src/Api/Operator/Certificate.php b/src/Api/Operator/Certificate.php index d82969a6..9113e148 100644 --- a/src/Api/Operator/Certificate.php +++ b/src/Api/Operator/Certificate.php @@ -18,7 +18,7 @@ public function generate($properties) $info = $packet->addChild($this->_wrapperTag)->addChild('generate')->addChild('info'); foreach ($properties as $name => $value) { - $info->addChild($name, $value); + $info->{$name} = $value; } $response = $this->_client->request($packet); diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index 6fcaec0d..d974c559 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -18,7 +18,7 @@ public function create($properties) $info = $packet->addChild($this->_wrapperTag)->addChild('add')->addChild('gen_info'); foreach ($properties as $name => $value) { - $info->addChild($name, $value); + $info->{$name} = $value; } $response = $this->_client->request($packet); diff --git a/src/Api/Operator/Database.php b/src/Api/Operator/Database.php index 30e1458a..8e5696ae 100644 --- a/src/Api/Operator/Database.php +++ b/src/Api/Operator/Database.php @@ -43,7 +43,7 @@ private function _process($command, array $properties) $info->$name = $value; continue; } - $info->addChild($name, $value); + $info->{$name} = $value; } return $this->_client->request($packet); @@ -135,7 +135,7 @@ private function _get($command, $field, $value) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->{$field} = $value; } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/DatabaseServer.php b/src/Api/Operator/DatabaseServer.php index ba70c38f..8b830460 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -53,7 +53,7 @@ private function _get($field = null, $value = null) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->{$field} = $value; } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/Dns.php b/src/Api/Operator/Dns.php index 0c64980e..30920a71 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -18,7 +18,7 @@ public function create($properties) $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec'); foreach ($properties as $name => $value) { - $info->addChild($name, $value); + $info->{$name} = $value; } return new Struct\Info($this->_client->request($packet)); @@ -39,7 +39,7 @@ public function bulkCreate(array $records) $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec'); foreach ($properties as $name => $value) { - $info->addChild($name, $value); + $info->{$name} = $value; } } diff --git a/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index bbf21b44..b9b0af06 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -21,7 +21,7 @@ public function create(array $properties) unset($properties['site-id'], $properties['site-alias-id']); foreach ($properties as $name => $value) { - $info->addChild($name, $value); + $info->{$name} = $value; } return new Struct\Info($this->_client->request($packet)); @@ -53,7 +53,7 @@ public function getAll($field = null, $value = null) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->{$field} = $value; } $getTag->addChild('template'); diff --git a/src/Api/Operator/Mail.php b/src/Api/Operator/Mail.php index 5d5b7fb4..0fa01380 100644 --- a/src/Api/Operator/Mail.php +++ b/src/Api/Operator/Mail.php @@ -28,7 +28,7 @@ public function create($name, $siteId, $mailbox = false, $password = '') $mailname->addChild('mailbox')->addChild('enabled', 'true'); } if (!empty($password)) { - $mailname->addChild('password')->addChild('value', $password); + $mailname->addChild('password')->value = $password; } $response = $this->_client->request($packet); @@ -48,7 +48,7 @@ public function delete($field, $value, $siteId) $packet = $this->_client->getPacket(); $filter = $packet->addChild($this->_wrapperTag)->addChild('remove')->addChild('filter'); $filter->addChild('site-id', $siteId); - $filter->addChild($field, $value); + $filter->{$field} = $value; $response = $this->_client->request($packet); return 'ok' === (string) $response->status; diff --git a/src/Api/Operator/ProtectedDirectory.php b/src/Api/Operator/ProtectedDirectory.php index cf43903a..80fc3819 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -81,9 +81,9 @@ public function addUser($protectedDirectory, $login, $password) $packet = $this->_client->getPacket(); $info = $packet->addChild($this->_wrapperTag)->addChild('add-user'); - $info->addChild('pd-id', $protectedDirectory->id); - $info->addChild('login', $login); - $info->addChild('password', $password); + $info->{'pd-id'} = $protectedDirectory->id; + $info->login = $login; + $info->password = $password; return new Struct\UserInfo($this->_client->request($packet)); } @@ -113,7 +113,7 @@ private function _get($command, $field, $value) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->{$field} = $value; } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/Reseller.php b/src/Api/Operator/Reseller.php index 9ee8af0c..bcf76d32 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -18,7 +18,7 @@ public function create($properties) $info = $packet->addChild($this->_wrapperTag)->addChild('add')->addChild('gen-info'); foreach ($properties as $name => $value) { - $info->addChild($name, $value); + $info->{$name} = $value; } $response = $this->_client->request($packet); diff --git a/src/Api/Operator/Site.php b/src/Api/Operator/Site.php index 170f7e32..f92eae62 100644 --- a/src/Api/Operator/Site.php +++ b/src/Api/Operator/Site.php @@ -24,7 +24,7 @@ public function create(array $properties) if (!is_scalar($value)) { continue; } - $infoGeneral->addChild($name, $value); + $infoGeneral->{$name} = $value; } // set hosting properties @@ -32,8 +32,8 @@ public function create(array $properties) $hostingNode = $info->addChild('hosting')->addChild('vrt_hst'); foreach ($properties[static::PROPERTIES_HOSTING] as $name => $value) { $propertyNode = $hostingNode->addChild('property'); - $propertyNode->addChild('name', $name); - $propertyNode->addChild('value', $value); + $propertyNode->name = $name; + $propertyNode->value = $value; } } diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index be8f735c..5135e1cf 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -71,7 +71,7 @@ public function getAll($field = null, $value = null) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->{$field} = $value; } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/Subdomain.php b/src/Api/Operator/Subdomain.php index ece56e4b..de1eb3a7 100644 --- a/src/Api/Operator/Subdomain.php +++ b/src/Api/Operator/Subdomain.php @@ -21,12 +21,12 @@ public function create($properties) if (is_array($value)) { foreach ($value as $propertyName => $propertyValue) { $property = $info->addChild($name); - $property->addChild('name', $propertyName); - $property->addChild('value', $propertyValue); + $property->name = $propertyName; + $property->value = $propertyValue; } continue; } - $info->addChild($name, $value); + $info->{$name} = $value; } $response = $this->_client->request($packet); diff --git a/src/Api/Operator/Ui.php b/src/Api/Operator/Ui.php index b2ac6576..187fcd24 100644 --- a/src/Api/Operator/Ui.php +++ b/src/Api/Operator/Ui.php @@ -31,7 +31,7 @@ public function createCustomButton($owner, $properties) $propertiesNode = $buttonNode->addChild('properties'); foreach ($properties as $name => $value) { - $propertiesNode->addChild($name, $value); + $propertiesNode->{$name} = $value; } $response = $this->_client->request($packet); diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index b8366646..16f77651 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -82,8 +82,8 @@ public function create(array $properties, array $hostingProperties = null, strin $infoHosting = $info->addChild('hosting')->addChild('vrt_hst'); foreach ($hostingProperties as $name => $value) { $property = $infoHosting->addChild('property'); - $property->addChild('name', $name); - $property->addChild('value', $value); + $property->name = $name; + $property->value = $value; } if (isset($properties['ip_address'])) { diff --git a/tests/Utility/PasswordProvider.php b/tests/Utility/PasswordProvider.php index 2083642d..1c306aa2 100644 --- a/tests/Utility/PasswordProvider.php +++ b/tests/Utility/PasswordProvider.php @@ -5,5 +5,5 @@ class PasswordProvider { - const STRONG_PASSWORD = 'test-PWD*1@42!13#'; + const STRONG_PASSWORD = 'test-&PWD*1@42!13#'; } From bdaad89f315c86f01c19ddbdf126de855f5cfb34 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 7 Oct 2021 00:04:33 +0700 Subject: [PATCH 50/73] Fix issues reported by psalm --- psalm.xml | 2 +- src/Api/Client.php | 168 +++++------------- src/Api/Operator.php | 5 +- src/Api/Operator/Database.php | 10 +- src/Api/Operator/DatabaseServer.php | 6 +- src/Api/Operator/Dns.php | 18 +- src/Api/Operator/DnsTemplate.php | 8 +- src/Api/Operator/Mail.php | 18 +- src/Api/Operator/PhpHandler.php | 12 +- src/Api/Operator/ProtectedDirectory.php | 28 ++- src/Api/Operator/Reseller.php | 2 +- src/Api/Operator/ServicePlan.php | 4 +- src/Api/Operator/Site.php | 4 +- src/Api/Operator/SiteAlias.php | 6 +- src/Api/Operator/Subdomain.php | 4 +- src/Api/Operator/Webspace.php | 2 +- src/Api/Struct/Certificate/Info.php | 3 +- src/Api/Struct/Customer/GeneralInfo.php | 3 +- src/Api/Struct/Customer/Info.php | 3 +- src/Api/Struct/Database/Info.php | 3 +- src/Api/Struct/Database/UserInfo.php | 3 +- src/Api/Struct/DatabaseServer/Info.php | 3 +- src/Api/Struct/Dns/Info.php | 3 +- src/Api/Struct/EventLog/DetailedEvent.php | 3 +- src/Api/Struct/EventLog/Event.php | 3 +- src/Api/Struct/Ip/Info.php | 3 +- src/Api/Struct/Locale/Info.php | 3 +- src/Api/Struct/Mail/GeneralInfo.php | 3 +- src/Api/Struct/Mail/Info.php | 3 +- src/Api/Struct/PhpHandler/Info.php | 2 +- .../Struct/ProtectedDirectory/DataInfo.php | 3 +- src/Api/Struct/ProtectedDirectory/Info.php | 3 +- .../Struct/ProtectedDirectory/UserInfo.php | 3 +- src/Api/Struct/Reseller/GeneralInfo.php | 3 +- src/Api/Struct/Reseller/Info.php | 3 +- src/Api/Struct/SecretKey/Info.php | 3 +- src/Api/Struct/Server/Admin.php | 3 +- src/Api/Struct/Server/GeneralInfo.php | 3 +- src/Api/Struct/Server/Preferences.php | 3 +- src/Api/Struct/Server/SessionPreferences.php | 3 +- src/Api/Struct/Server/Statistics.php | 3 +- .../Struct/Server/Statistics/DiskSpace.php | 3 +- .../Struct/Server/Statistics/LoadAverage.php | 3 +- src/Api/Struct/Server/Statistics/Memory.php | 3 +- src/Api/Struct/Server/Statistics/Objects.php | 3 +- src/Api/Struct/Server/Statistics/Other.php | 3 +- src/Api/Struct/Server/Statistics/Swap.php | 3 +- src/Api/Struct/Server/Statistics/Version.php | 3 +- src/Api/Struct/Server/UpdatesInfo.php | 3 +- src/Api/Struct/ServicePlan/Info.php | 3 +- src/Api/Struct/Session/Info.php | 3 +- src/Api/Struct/Site/GeneralInfo.php | 3 +- src/Api/Struct/Site/HostingInfo.php | 3 +- src/Api/Struct/Site/Info.php | 3 +- src/Api/Struct/SiteAlias/GeneralInfo.php | 3 +- src/Api/Struct/SiteAlias/Info.php | 3 +- src/Api/Struct/Subdomain/Info.php | 3 +- src/Api/Struct/Ui/CustomButton.php | 3 +- src/Api/Struct/Webspace/DiskUsage.php | 3 +- src/Api/Struct/Webspace/GeneralInfo.php | 3 +- .../Struct/Webspace/HostingPropertyInfo.php | 3 +- src/Api/Struct/Webspace/Info.php | 3 +- src/Api/Struct/Webspace/Limit.php | 3 +- src/Api/Struct/Webspace/LimitDescriptor.php | 3 +- src/Api/Struct/Webspace/LimitInfo.php | 3 +- src/Api/Struct/Webspace/Limits.php | 3 +- .../Struct/Webspace/PermissionDescriptor.php | 3 +- src/Api/Struct/Webspace/PermissionInfo.php | 3 +- src/Api/Struct/Webspace/PhpSettings.php | 3 +- .../Webspace/PhysicalHostingDescriptor.php | 3 +- tests/PhpHandlerTest.php | 3 +- 71 files changed, 165 insertions(+), 296 deletions(-) diff --git a/psalm.xml b/psalm.xml index ab2b5f01..43b6fdac 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <psalm - errorLevel="7" + errorLevel="3" resolveFromConfigFile="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" diff --git a/src/Api/Client.php b/src/Api/Client.php index 4132eaeb..a270b2f7 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -25,7 +25,7 @@ class Client protected array $_operatorsCache = []; /** - * @var callable + * @var callable|null */ protected $_verifyResponseCallback; @@ -169,7 +169,7 @@ public function request($request, $mode = self::RESPONSE_SHORT) /** @psalm-suppress UndefinedClass */ $xml = \pm_ApiRpc::getService($version)->call($requestXml->children()[0]->asXml(), $this->_login); } else { - $xml = $this->_performHttpRequest($request); + $xml = $this->_performHttpRequest((string) $request); } $this->_verifyResponseCallback @@ -212,22 +212,19 @@ private function _performHttpRequest($request) curl_close($curl); - $xml = new XmlResponse($result); - - return $xml; + return new XmlResponse((string) $result); } /** * Perform multiple API requests using single HTTP request. * - * @param $requests + * @param array $requests * @param int $mode * - * @throws Client\Exception - * * @return array + * @throws Client\Exception */ - public function multiRequest($requests, $mode = self::RESPONSE_SHORT) + public function multiRequest(array $requests, $mode = self::RESPONSE_SHORT): array { $requestXml = $this->getPacket(); @@ -237,23 +234,32 @@ public function multiRequest($requests, $mode = self::RESPONSE_SHORT) } else { if (is_array($request)) { $request = $this->_arrayToXml($request, $requestXml)->asXML(); + if (!$request) { + throw new Client\Exception('Failed to create an XML string for request'); + } } elseif (preg_match('/^[a-z]/', $request)) { $this->_expandRequestShortSyntax($request, $requestXml); } } - $responses[] = $this->request($request); } if ('sdk' == $this->_protocol) { throw new Client\Exception('Multi requests are not supported via SDK.'); } else { - $responseXml = $this->_performHttpRequest($requestXml->asXML()); + $xmlString = $requestXml->asXML(); + if (!$xmlString) { + throw new Client\Exception('Failed to create an XML string for request'); + } + $responseXml = $this->_performHttpRequest($xmlString); } $responses = []; foreach ($responseXml->children() as $childNode) { $xml = $this->getPacket(); $dom = dom_import_simplexml($xml)->ownerDocument; + if (!$dom) { + continue; + } $childDomNode = dom_import_simplexml($childNode); $childDomNode = $dom->importNode($childDomNode, true); @@ -371,230 +377,150 @@ protected function _isAssocArray(array $array) /** * @param string $name * - * @return \PleskX\Api\Operator + * @return mixed */ - protected function _getOperator($name) + protected function _getOperator(string $name) { if (!isset($this->_operatorsCache[$name])) { $className = '\\PleskX\\Api\\Operator\\'.$name; + /** @psalm-suppress InvalidStringClass */ $this->_operatorsCache[$name] = new $className($this); } return $this->_operatorsCache[$name]; } - /** - * @return Operator\Server - */ - public function server() + public function server(): Operator\Server { return $this->_getOperator('Server'); } - /** - * @return Operator\Customer - */ - public function customer() + public function customer(): Operator\Customer { return $this->_getOperator('Customer'); } - /** - * @return Operator\Webspace - */ - public function webspace() + public function webspace(): Operator\Webspace { return $this->_getOperator('Webspace'); } - /** - * @return Operator\Subdomain - */ - public function subdomain() + public function subdomain(): Operator\Subdomain { return $this->_getOperator('Subdomain'); } - /** - * @return Operator\Dns - */ - public function dns() + public function dns(): Operator\Dns { return $this->_getOperator('Dns'); } - /** - * @return Operator\DnsTemplate - */ - public function dnsTemplate() + public function dnsTemplate(): Operator\DnsTemplate { return $this->_getOperator('DnsTemplate'); } - /** - * @return Operator\DatabaseServer - */ - public function databaseServer() + public function databaseServer(): Operator\DatabaseServer { return $this->_getOperator('DatabaseServer'); } - /** - * @return Operator\Mail - */ - public function mail() + public function mail(): Operator\Mail { return $this->_getOperator('Mail'); } - /** - * @return Operator\Certificate - */ - public function certificate() + public function certificate(): Operator\Certificate { return $this->_getOperator('Certificate'); } - /** - * @return Operator\SiteAlias - */ - public function siteAlias() + public function siteAlias(): Operator\SiteAlias { return $this->_getOperator('SiteAlias'); } - /** - * @return Operator\Ip - */ - public function ip() + public function ip(): Operator\Ip { return $this->_getOperator('Ip'); } - /** - * @return Operator\EventLog - */ - public function eventLog() + public function eventLog(): Operator\EventLog { return $this->_getOperator('EventLog'); } - /** - * @return Operator\SecretKey - */ - public function secretKey() + public function secretKey(): Operator\SecretKey { return $this->_getOperator('SecretKey'); } - /** - * @return Operator\Ui - */ - public function ui() + public function ui(): Operator\Ui { return $this->_getOperator('Ui'); } - /** - * @return Operator\ServicePlan - */ - public function servicePlan() + public function servicePlan(): Operator\ServicePlan { return $this->_getOperator('ServicePlan'); } - /** - * @return Operator\VirtualDirectory - */ - public function virtualDirectory() + public function virtualDirectory(): Operator\VirtualDirectory { return $this->_getOperator('VirtualDirectory'); } - /** - * @return Operator\Database - */ - public function database() + public function database(): Operator\Database { return $this->_getOperator('Database'); } - /** - * @return Operator\Session - */ - public function session() + public function session(): Operator\Session { return $this->_getOperator('Session'); } - /** - * @return Operator\Locale - */ - public function locale() + public function locale(): Operator\Locale { return $this->_getOperator('Locale'); } - /** - * @return Operator\LogRotation - */ - public function logRotation() + public function logRotation(): Operator\LogRotation { return $this->_getOperator('LogRotation'); } - /** - * @return Operator\ProtectedDirectory - */ - public function protectedDirectory() + public function protectedDirectory(): Operator\ProtectedDirectory { return $this->_getOperator('ProtectedDirectory'); } - /** - * @return Operator\Reseller - */ - public function reseller() + public function reseller(): Operator\Reseller { return $this->_getOperator('Reseller'); } - /** - * @return Operator\ResellerPlan - */ - public function resellerPlan() + public function resellerPlan(): Operator\ResellerPlan { return $this->_getOperator('ResellerPlan'); } - /** - * @return Operator\Aps - */ - public function aps() + public function aps(): Operator\Aps { return $this->_getOperator('Aps'); } - /** - * @return Operator\ServicePlanAddon - */ - public function servicePlanAddon() + public function servicePlanAddon(): Operator\ServicePlanAddon { return $this->_getOperator('ServicePlanAddon'); } - /** - * @return Operator\Site - */ - public function site() + public function site(): Operator\Site { return $this->_getOperator('Site'); } - /** - * @return Operator\PhpHandler - */ - public function phpHandler() + public function phpHandler(): Operator\PhpHandler { return $this->_getOperator('PhpHandler'); } diff --git a/src/Api/Operator.php b/src/Api/Operator.php index 60b5b541..c577e366 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -8,7 +8,7 @@ class Operator protected string $_wrapperTag = ''; protected Client $_client; - public function __construct($client) + public function __construct(Client $client) { $this->_client = $client; @@ -78,7 +78,7 @@ protected function _getItems($structClass, $infoTag, $field = null, $value = nul $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->{$field} = $value; + $filterTag->{$field} = (string) $value; } $getTag->addChild('dataset')->addChild($infoTag); @@ -93,6 +93,7 @@ protected function _getItems($structClass, $infoTag, $field = null, $value = nul if (!isset($xmlResult->data) || !isset($xmlResult->data->$infoTag)) { continue; } + /** @psalm-suppress InvalidStringClass */ $item = new $structClass($xmlResult->data->$infoTag); if (isset($xmlResult->id) && property_exists($item, 'id')) { $item->id = (int) $xmlResult->id; diff --git a/src/Api/Operator/Database.php b/src/Api/Operator/Database.php index 8e5696ae..048841b8 100644 --- a/src/Api/Operator/Database.php +++ b/src/Api/Operator/Database.php @@ -128,19 +128,15 @@ public function getAllUsers($field, $value) * * @return \PleskX\Api\XmlResponse */ - private function _get($command, $field, $value) + private function _get(string $command, string $field, $value) { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild($command); $filterTag = $getTag->addChild('filter'); - if (!is_null($field)) { - $filterTag->{$field} = $value; - } - - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $filterTag->{$field} = (string) $value; - return $response; + return $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); } /** diff --git a/src/Api/Operator/DatabaseServer.php b/src/Api/Operator/DatabaseServer.php index 8b830460..18cfbfa1 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -25,7 +25,7 @@ public function getSupportedTypes() * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value) { $items = $this->_get($field, $value); @@ -44,7 +44,7 @@ public function getAll() * @param string|null $field * @param int|string|null $value * - * @return Struct\Info|Struct\Info[] + * @return Struct\Info[] */ private function _get($field = null, $value = null) { @@ -53,7 +53,7 @@ private function _get($field = null, $value = null) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->{$field} = $value; + $filterTag->{$field} = (string) $value; } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/Dns.php b/src/Api/Operator/Dns.php index 30920a71..c57ffef4 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -29,9 +29,9 @@ public function create($properties) * * @param array $records * - * @return \PleskX\Api\XmlResponse[] + * @return \SimpleXMLElement[] */ - public function bulkCreate(array $records) + public function bulkCreate(array $records): array { $packet = $this->_client->getPacket(); @@ -58,7 +58,7 @@ public function bulkCreate(array $records) * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value) { $items = $this->getAll($field, $value); @@ -71,15 +71,13 @@ public function get($field, $value) * * @return Struct\Info[] */ - public function getAll($field, $value) + public function getAll(string $field, $value): array { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_rec'); $filterTag = $getTag->addChild('filter'); - if (!is_null($field)) { - $filterTag->addChild($field, $value); - } + $filterTag->addChild($field, (string) $value); $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; @@ -98,7 +96,7 @@ public function getAll($field, $value) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->_delete($field, $value, 'del_rec'); } @@ -108,9 +106,9 @@ public function delete($field, $value) * * @param array $recordIds * - * @return \PleskX\Api\XmlResponse[] + * @return \SimpleXMLElement[] */ - public function bulkDelete(array $recordIds) + public function bulkDelete(array $recordIds): array { $packet = $this->_client->getPacket(); diff --git a/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index b9b0af06..2e76ab9c 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -46,14 +46,14 @@ public function get($field, $value) * * @return Struct\Info[] */ - public function getAll($field = null, $value = null) + public function getAll($field = null, $value = null): array { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_rec'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->{$field} = $value; + $filterTag->{$field} = (string) $value; } $getTag->addChild('template'); @@ -74,11 +74,11 @@ public function getAll($field = null, $value = null) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { $packet = $this->_client->getPacket(); $delTag = $packet->addChild($this->_wrapperTag)->addChild('del_rec'); - $delTag->addChild('filter')->addChild($field, $value); + $delTag->addChild('filter')->addChild($field, (string) $value); $delTag->addChild('template'); $response = $this->_client->request($packet); diff --git a/src/Api/Operator/Mail.php b/src/Api/Operator/Mail.php index 0fa01380..da5a630d 100644 --- a/src/Api/Operator/Mail.php +++ b/src/Api/Operator/Mail.php @@ -3,9 +3,11 @@ namespace PleskX\Api\Operator; +use PleskX\Api\Client; +use PleskX\Api\Operator; use PleskX\Api\Struct\Mail as Struct; -class Mail extends \PleskX\Api\Operator +class Mail extends Operator { /** * @param string $name @@ -21,7 +23,7 @@ public function create($name, $siteId, $mailbox = false, $password = '') $info = $packet->addChild($this->_wrapperTag)->addChild('create'); $filter = $info->addChild('filter'); - $filter->addChild('site-id', $siteId); + $filter->addChild('site-id', (string) $siteId); $mailname = $filter->addChild('mailname'); $mailname->addChild('name', $name); if ($mailbox) { @@ -43,12 +45,14 @@ public function create($name, $siteId, $mailbox = false, $password = '') * * @return bool */ - public function delete($field, $value, $siteId) + public function delete(string $field, $value, $siteId): bool { $packet = $this->_client->getPacket(); $filter = $packet->addChild($this->_wrapperTag)->addChild('remove')->addChild('filter'); - $filter->addChild('site-id', $siteId); - $filter->{$field} = $value; + + $filter->addChild('site-id', (string) $siteId); + $filter->{$field} = (string) $value; + $response = $this->_client->request($packet); return 'ok' === (string) $response->status; @@ -79,12 +83,12 @@ public function getAll($siteId, $name = null) $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_info'); $filterTag = $getTag->addChild('filter'); - $filterTag->addChild('site-id', $siteId); + $filterTag->addChild('site-id', (string) $siteId); if (!is_null($name)) { $filterTag->addChild('name', $name); } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->_client->request($packet, Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { if (!isset($xmlResult->mailname)) { diff --git a/src/Api/Operator/PhpHandler.php b/src/Api/Operator/PhpHandler.php index 66f1ec1d..5adb1e8b 100644 --- a/src/Api/Operator/PhpHandler.php +++ b/src/Api/Operator/PhpHandler.php @@ -10,19 +10,19 @@ class PhpHandler extends Operator { /** - * @param string $field - * @param int|string $value + * @param string|null $field + * @param int|string|null $value * * @return Info */ - public function get($field, $value) + public function get($field = null, $value = null): Info { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->addChild($field, (string)$value); } $response = $this->_client->request($packet, Client::RESPONSE_FULL); @@ -37,14 +37,14 @@ public function get($field, $value) * * @return Info[] */ - public function getAll($field = null, $value = null) + public function getAll($field = null, $value = null): array { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->addChild($field, (string) $value); } $response = $this->_client->request($packet, Client::RESPONSE_FULL); diff --git a/src/Api/Operator/ProtectedDirectory.php b/src/Api/Operator/ProtectedDirectory.php index 80fc3819..29756d3a 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -3,9 +3,11 @@ namespace PleskX\Api\Operator; +use PleskX\Api\Client; +use PleskX\Api\Operator; use PleskX\Api\Struct\ProtectedDirectory as Struct; -class ProtectedDirectory extends \PleskX\Api\Operator +class ProtectedDirectory extends Operator { protected string $_wrapperTag = 'protected-dir'; @@ -21,7 +23,7 @@ public function add($name, $siteId, $header = '') $packet = $this->_client->getPacket(); $info = $packet->addChild($this->_wrapperTag)->addChild('add'); - $info->addChild('site-id', $siteId); + $info->addChild('site-id', (string) $siteId); $info->addChild('name', $name); $info->addChild('header', $header); @@ -45,7 +47,7 @@ public function delete($field, $value) * * @return Struct\DataInfo|false */ - public function get($field, $value) + public function get(string $field, $value) { $items = $this->getAll($field, $value); @@ -58,7 +60,7 @@ public function get($field, $value) * * @return Struct\DataInfo[] */ - public function getAll($field, $value) + public function getAll(string $field, $value): array { $response = $this->_get('get', $field, $value); $items = []; @@ -81,7 +83,7 @@ public function addUser($protectedDirectory, $login, $password) $packet = $this->_client->getPacket(); $info = $packet->addChild($this->_wrapperTag)->addChild('add-user'); - $info->{'pd-id'} = $protectedDirectory->id; + $info->{'pd-id'} = (string) $protectedDirectory->id; $info->login = $login; $info->password = $password; @@ -100,24 +102,20 @@ public function deleteUser($field, $value) } /** - * @param $command - * @param $field - * @param $value + * @param string $command + * @param string $field + * @param int|string $value * * @return \PleskX\Api\XmlResponse */ - private function _get($command, $field, $value) + private function _get(string $command, string $field, $value) { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild($command); $filterTag = $getTag->addChild('filter'); - if (!is_null($field)) { - $filterTag->{$field} = $value; - } - - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $filterTag->{$field} = (string) $value; - return $response; + return $this->_client->request($packet, Client::RESPONSE_FULL); } } diff --git a/src/Api/Operator/Reseller.php b/src/Api/Operator/Reseller.php index bcf76d32..f29391ff 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -63,7 +63,7 @@ public function getAll($field = null, $value = null) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->addChild($field, (string) $value); } $datasetTag = $getTag->addChild('dataset'); diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index 41fa075e..d4c14899 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -55,7 +55,7 @@ public function getAll() * @param string|null $field * @param int|string|null $value * - * @return Struct\Info|Struct\Info[] + * @return Struct\Info[] */ private function _get($field = null, $value = null) { @@ -64,7 +64,7 @@ private function _get($field = null, $value = null) $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->addChild($field, (string) $value); } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/Site.php b/src/Api/Operator/Site.php index f92eae62..4da17822 100644 --- a/src/Api/Operator/Site.php +++ b/src/Api/Operator/Site.php @@ -24,7 +24,7 @@ public function create(array $properties) if (!is_scalar($value)) { continue; } - $infoGeneral->{$name} = $value; + $infoGeneral->{$name} = (string) $value; } // set hosting properties @@ -74,7 +74,7 @@ public function get($field, $value) */ public function getHosting($field, $value) { - $items = $this->_getItems(Struct\HostingInfo::class, 'hosting', $field, $value, function ($node) { + $items = $this->_getItems(Struct\HostingInfo::class, 'hosting', $field, $value, function (\SimpleXMLElement $node) { return isset($node->vrt_hst); }); diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index 5135e1cf..c013c17d 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -22,7 +22,7 @@ public function create(array $properties, array $preferences = []) $prefs = $info->addChild('pref'); foreach ($preferences as $key => $value) { - $prefs->addChild($key, is_bool($value) ? ($value ? 1 : 0) : $value); + $prefs->addChild($key, is_bool($value) ? ($value ? "1" : "0") : $value); } } @@ -64,14 +64,14 @@ public function get($field, $value) * * @return Struct\GeneralInfo[] */ - public function getAll($field = null, $value = null) + public function getAll($field = null, $value = null): array { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->{$field} = $value; + $filterTag->{$field} = (string) $value; } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/Subdomain.php b/src/Api/Operator/Subdomain.php index de1eb3a7..b748dcad 100644 --- a/src/Api/Operator/Subdomain.php +++ b/src/Api/Operator/Subdomain.php @@ -64,14 +64,14 @@ public function get($field, $value) * * @return Struct\Info[] */ - public function getAll($field = null, $value = null) + public function getAll($field = null, $value = null): array { $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->addChild($field, (string) $value); } $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index 16f77651..2aab504b 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -40,7 +40,7 @@ public function getPhpSettings(string $field, $value): Struct\PhpSettings $packet = $this->_client->getPacket(); $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); - $getTag->addChild('filter')->addChild($field, $value); + $getTag->addChild('filter')->addChild($field, (string) $value); $getTag->addChild('dataset')->addChild('php-settings'); $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); diff --git a/src/Api/Struct/Certificate/Info.php b/src/Api/Struct/Certificate/Info.php index 2185c110..467defac 100644 --- a/src/Api/Struct/Certificate/Info.php +++ b/src/Api/Struct/Certificate/Info.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Certificate; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { public string $request; public string $privateKey; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['csr' => 'request'], diff --git a/src/Api/Struct/Customer/GeneralInfo.php b/src/Api/Struct/Customer/GeneralInfo.php index 43f8ab20..56b12bf1 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Customer; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class GeneralInfo extends Struct { @@ -24,7 +23,7 @@ class GeneralInfo extends Struct public string $description; public string $externalId; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['cname' => 'company'], diff --git a/src/Api/Struct/Customer/Info.php b/src/Api/Struct/Customer/Info.php index 926b5519..f9b4c514 100644 --- a/src/Api/Struct/Customer/Info.php +++ b/src/Api/Struct/Customer/Info.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Customer; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { public int $id; public string $guid; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Database/Info.php b/src/Api/Struct/Database/Info.php index 9f705656..d706984b 100644 --- a/src/Api/Struct/Database/Info.php +++ b/src/Api/Struct/Database/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Database; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -15,7 +14,7 @@ class Info extends Struct public int $dbServerId; public int $defaultUserId; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Database/UserInfo.php b/src/Api/Struct/Database/UserInfo.php index cf40013a..230f4f34 100644 --- a/src/Api/Struct/Database/UserInfo.php +++ b/src/Api/Struct/Database/UserInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Database; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class UserInfo extends Struct { @@ -12,7 +11,7 @@ class UserInfo extends Struct public string $login; public int $dbId; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/DatabaseServer/Info.php b/src/Api/Struct/DatabaseServer/Info.php index 3f2dbd5a..7db81f56 100644 --- a/src/Api/Struct/DatabaseServer/Info.php +++ b/src/Api/Struct/DatabaseServer/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\DatabaseServer; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -13,7 +12,7 @@ class Info extends Struct public int $port; public string $type; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Dns/Info.php b/src/Api/Struct/Dns/Info.php index 161cbee9..c3a2e1e4 100644 --- a/src/Api/Struct/Dns/Info.php +++ b/src/Api/Struct/Dns/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Dns; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -16,7 +15,7 @@ class Info extends Struct public string $value; public string $opt; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/EventLog/DetailedEvent.php b/src/Api/Struct/EventLog/DetailedEvent.php index b1cb7c08..1c35c713 100644 --- a/src/Api/Struct/EventLog/DetailedEvent.php +++ b/src/Api/Struct/EventLog/DetailedEvent.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\EventLog; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class DetailedEvent extends Struct { @@ -16,7 +15,7 @@ class DetailedEvent extends Struct public string $user; public string $host; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/EventLog/Event.php b/src/Api/Struct/EventLog/Event.php index cc3be1cf..01e965d9 100644 --- a/src/Api/Struct/EventLog/Event.php +++ b/src/Api/Struct/EventLog/Event.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\EventLog; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Event extends Struct { @@ -13,7 +12,7 @@ class Event extends Struct public string $class; public string $id; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'type', diff --git a/src/Api/Struct/Ip/Info.php b/src/Api/Struct/Ip/Info.php index 17cffdd3..41180166 100644 --- a/src/Api/Struct/Ip/Info.php +++ b/src/Api/Struct/Ip/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Ip; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -13,7 +12,7 @@ class Info extends Struct public string $type; public string $interface; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'ip_address', diff --git a/src/Api/Struct/Locale/Info.php b/src/Api/Struct/Locale/Info.php index 4fbe4478..2a7b9b6c 100644 --- a/src/Api/Struct/Locale/Info.php +++ b/src/Api/Struct/Locale/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Locale; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -12,7 +11,7 @@ class Info extends Struct public string $language; public string $country; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Mail/GeneralInfo.php b/src/Api/Struct/Mail/GeneralInfo.php index dfa1615f..a29c4f8b 100644 --- a/src/Api/Struct/Mail/GeneralInfo.php +++ b/src/Api/Struct/Mail/GeneralInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Mail; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class GeneralInfo extends Struct { @@ -12,7 +11,7 @@ class GeneralInfo extends Struct public string $name; public string $description; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Mail/Info.php b/src/Api/Struct/Mail/Info.php index 63cc84e0..13cb182d 100644 --- a/src/Api/Struct/Mail/Info.php +++ b/src/Api/Struct/Mail/Info.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Mail; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { public int $id; public string $name; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/PhpHandler/Info.php b/src/Api/Struct/PhpHandler/Info.php index d95c3a92..e4502314 100644 --- a/src/Api/Struct/PhpHandler/Info.php +++ b/src/Api/Struct/PhpHandler/Info.php @@ -19,7 +19,7 @@ class Info extends Struct public string $custom; public string $handlerStatus; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/ProtectedDirectory/DataInfo.php b/src/Api/Struct/ProtectedDirectory/DataInfo.php index 4a1216cb..673928f6 100644 --- a/src/Api/Struct/ProtectedDirectory/DataInfo.php +++ b/src/Api/Struct/ProtectedDirectory/DataInfo.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\ProtectedDirectory; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class DataInfo extends Struct { public string $name; public string $header; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/ProtectedDirectory/Info.php b/src/Api/Struct/ProtectedDirectory/Info.php index 90651336..19b5952f 100644 --- a/src/Api/Struct/ProtectedDirectory/Info.php +++ b/src/Api/Struct/ProtectedDirectory/Info.php @@ -4,13 +4,12 @@ namespace PleskX\Api\Struct\ProtectedDirectory; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { public int $id; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/ProtectedDirectory/UserInfo.php b/src/Api/Struct/ProtectedDirectory/UserInfo.php index a6d4b74a..0d0cc7eb 100644 --- a/src/Api/Struct/ProtectedDirectory/UserInfo.php +++ b/src/Api/Struct/ProtectedDirectory/UserInfo.php @@ -4,13 +4,12 @@ namespace PleskX\Api\Struct\ProtectedDirectory; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class UserInfo extends Struct { public int $id; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Reseller/GeneralInfo.php b/src/Api/Struct/Reseller/GeneralInfo.php index c946356d..39757165 100644 --- a/src/Api/Struct/Reseller/GeneralInfo.php +++ b/src/Api/Struct/Reseller/GeneralInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Reseller; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class GeneralInfo extends Struct { @@ -13,7 +12,7 @@ class GeneralInfo extends Struct public string $login; public array $permissions; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse->{'gen-info'}, [ ['pname' => 'personalName'], diff --git a/src/Api/Struct/Reseller/Info.php b/src/Api/Struct/Reseller/Info.php index 1ef61d2b..f257b3e3 100644 --- a/src/Api/Struct/Reseller/Info.php +++ b/src/Api/Struct/Reseller/Info.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Reseller; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { public int $id; public string $guid; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/SecretKey/Info.php b/src/Api/Struct/SecretKey/Info.php index 2b2eec03..bbebd82e 100644 --- a/src/Api/Struct/SecretKey/Info.php +++ b/src/Api/Struct/SecretKey/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\SecretKey; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -13,7 +12,7 @@ class Info extends Struct public string $description; public string $login; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'key', diff --git a/src/Api/Struct/Server/Admin.php b/src/Api/Struct/Server/Admin.php index 69bff6ea..4f08c399 100644 --- a/src/Api/Struct/Server/Admin.php +++ b/src/Api/Struct/Server/Admin.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Admin extends Struct { @@ -12,7 +11,7 @@ class Admin extends Struct public string $name; public string $email; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['admin_cname' => 'companyName'], diff --git a/src/Api/Struct/Server/GeneralInfo.php b/src/Api/Struct/Server/GeneralInfo.php index 9c1f63d2..2b28ab2d 100644 --- a/src/Api/Struct/Server/GeneralInfo.php +++ b/src/Api/Struct/Server/GeneralInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class GeneralInfo extends Struct { @@ -12,7 +11,7 @@ class GeneralInfo extends Struct public string $serverGuid; public string $mode; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'server_name', diff --git a/src/Api/Struct/Server/Preferences.php b/src/Api/Struct/Server/Preferences.php index e6529bf3..0f533c85 100644 --- a/src/Api/Struct/Server/Preferences.php +++ b/src/Api/Struct/Server/Preferences.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Preferences extends Struct { @@ -12,7 +11,7 @@ class Preferences extends Struct public int $trafficAccounting; public int $restartApacheInterval; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'stat_ttl', diff --git a/src/Api/Struct/Server/SessionPreferences.php b/src/Api/Struct/Server/SessionPreferences.php index 69a5c2aa..2feed452 100644 --- a/src/Api/Struct/Server/SessionPreferences.php +++ b/src/Api/Struct/Server/SessionPreferences.php @@ -4,13 +4,12 @@ namespace PleskX\Api\Struct\Server; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class SessionPreferences extends Struct { public int $loginTimeout; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'login_timeout', diff --git a/src/Api/Struct/Server/Statistics.php b/src/Api/Struct/Server/Statistics.php index 0894801e..aed4dd1f 100644 --- a/src/Api/Struct/Server/Statistics.php +++ b/src/Api/Struct/Server/Statistics.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Statistics extends Struct { @@ -29,7 +28,7 @@ class Statistics extends Struct /** @var Statistics\DiskSpace[] */ public $diskSpace; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->objects = new Statistics\Objects($apiResponse->objects); $this->version = new Statistics\Version($apiResponse->version); diff --git a/src/Api/Struct/Server/Statistics/DiskSpace.php b/src/Api/Struct/Server/Statistics/DiskSpace.php index 5fb6dca8..95ff3f1f 100644 --- a/src/Api/Struct/Server/Statistics/DiskSpace.php +++ b/src/Api/Struct/Server/Statistics/DiskSpace.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server\Statistics; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class DiskSpace extends Struct { @@ -12,7 +11,7 @@ class DiskSpace extends Struct public int $used; public int $free; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'total', diff --git a/src/Api/Struct/Server/Statistics/LoadAverage.php b/src/Api/Struct/Server/Statistics/LoadAverage.php index 69aefc22..005a0f32 100644 --- a/src/Api/Struct/Server/Statistics/LoadAverage.php +++ b/src/Api/Struct/Server/Statistics/LoadAverage.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server\Statistics; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class LoadAverage extends Struct { @@ -12,7 +11,7 @@ class LoadAverage extends Struct public float $load5min; public float $load15min; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->load1min = $apiResponse->l1 / 100.0; $this->load5min = $apiResponse->l5 / 100.0; diff --git a/src/Api/Struct/Server/Statistics/Memory.php b/src/Api/Struct/Server/Statistics/Memory.php index 44b12a38..a42b66c9 100644 --- a/src/Api/Struct/Server/Statistics/Memory.php +++ b/src/Api/Struct/Server/Statistics/Memory.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server\Statistics; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Memory extends Struct { @@ -15,7 +14,7 @@ class Memory extends Struct public int $buffer; public int $cached; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'total', diff --git a/src/Api/Struct/Server/Statistics/Objects.php b/src/Api/Struct/Server/Statistics/Objects.php index 00d119c5..4c128960 100644 --- a/src/Api/Struct/Server/Statistics/Objects.php +++ b/src/Api/Struct/Server/Statistics/Objects.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server\Statistics; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Objects extends Struct { @@ -20,7 +19,7 @@ class Objects extends Struct public int $problemClients; public int $problemDomains; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'clients', diff --git a/src/Api/Struct/Server/Statistics/Other.php b/src/Api/Struct/Server/Statistics/Other.php index e102fb5e..d65c4316 100644 --- a/src/Api/Struct/Server/Statistics/Other.php +++ b/src/Api/Struct/Server/Statistics/Other.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server\Statistics; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Other extends Struct { @@ -12,7 +11,7 @@ class Other extends Struct public int $uptime; public bool $insideVz; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'cpu', diff --git a/src/Api/Struct/Server/Statistics/Swap.php b/src/Api/Struct/Server/Statistics/Swap.php index 23154ee4..b61a4ad9 100644 --- a/src/Api/Struct/Server/Statistics/Swap.php +++ b/src/Api/Struct/Server/Statistics/Swap.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server\Statistics; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Swap extends Struct { @@ -12,7 +11,7 @@ class Swap extends Struct public int $used; public int $free; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'total', diff --git a/src/Api/Struct/Server/Statistics/Version.php b/src/Api/Struct/Server/Statistics/Version.php index 45fc541e..b3684ab3 100644 --- a/src/Api/Struct/Server/Statistics/Version.php +++ b/src/Api/Struct/Server/Statistics/Version.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Server\Statistics; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Version extends Struct { @@ -15,7 +14,7 @@ class Version extends Struct public string $osVersion; public string $osRelease; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['plesk_name' => 'internalName'], diff --git a/src/Api/Struct/Server/UpdatesInfo.php b/src/Api/Struct/Server/UpdatesInfo.php index 34c7501d..3a75d7b5 100644 --- a/src/Api/Struct/Server/UpdatesInfo.php +++ b/src/Api/Struct/Server/UpdatesInfo.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Server; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class UpdatesInfo extends Struct { public string $lastInstalledUpdate; public bool $installUpdatesAutomatically; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'last_installed_update', diff --git a/src/Api/Struct/ServicePlan/Info.php b/src/Api/Struct/ServicePlan/Info.php index 794c82af..8d1a3c12 100644 --- a/src/Api/Struct/ServicePlan/Info.php +++ b/src/Api/Struct/ServicePlan/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\ServicePlan; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -13,7 +12,7 @@ class Info extends Struct public string $guid; public string $externalId; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Session/Info.php b/src/Api/Struct/Session/Info.php index 70d2e866..e2060347 100644 --- a/src/Api/Struct/Session/Info.php +++ b/src/Api/Struct/Session/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Session; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -15,7 +14,7 @@ class Info extends Struct public string $loginTime; public string $idle; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index f13913f3..1bc0c9a5 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Site; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class GeneralInfo extends Struct { @@ -20,7 +19,7 @@ class GeneralInfo extends Struct public string $webspaceGuid; public int $webspaceId; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['cr_date' => 'creationDate'], diff --git a/src/Api/Struct/Site/HostingInfo.php b/src/Api/Struct/Site/HostingInfo.php index 2cb08f17..34a307f3 100644 --- a/src/Api/Struct/Site/HostingInfo.php +++ b/src/Api/Struct/Site/HostingInfo.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Site; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class HostingInfo extends Struct { public array $properties = []; public string $ipAddress; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { foreach ($apiResponse->vrt_hst->property as $property) { $this->properties[(string) $property->name] = (string) $property->value; diff --git a/src/Api/Struct/Site/Info.php b/src/Api/Struct/Site/Info.php index 5a12761e..99b57fe8 100644 --- a/src/Api/Struct/Site/Info.php +++ b/src/Api/Struct/Site/Info.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Site; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { public int $id; public string $guid; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/SiteAlias/GeneralInfo.php b/src/Api/Struct/SiteAlias/GeneralInfo.php index 73c2c8fe..0b77651b 100644 --- a/src/Api/Struct/SiteAlias/GeneralInfo.php +++ b/src/Api/Struct/SiteAlias/GeneralInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\SiteAlias; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class GeneralInfo extends Struct { @@ -12,7 +11,7 @@ class GeneralInfo extends Struct public string $asciiName; public string $status; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/SiteAlias/Info.php b/src/Api/Struct/SiteAlias/Info.php index 0950bcc9..a452ba96 100644 --- a/src/Api/Struct/SiteAlias/Info.php +++ b/src/Api/Struct/SiteAlias/Info.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\SiteAlias; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { public string $status; public int $id; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Subdomain/Info.php b/src/Api/Struct/Subdomain/Info.php index a766fc73..7c760433 100644 --- a/src/Api/Struct/Subdomain/Info.php +++ b/src/Api/Struct/Subdomain/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Subdomain; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -13,7 +12,7 @@ class Info extends Struct public string $name; public array $properties; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->properties = []; $this->_initScalarProperties($apiResponse, [ diff --git a/src/Api/Struct/Ui/CustomButton.php b/src/Api/Struct/Ui/CustomButton.php index 8b6622df..ccac0b26 100644 --- a/src/Api/Struct/Ui/CustomButton.php +++ b/src/Api/Struct/Ui/CustomButton.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Ui; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class CustomButton extends Struct { @@ -17,7 +16,7 @@ class CustomButton extends Struct public string $url; public string $text; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, ['id']); $this->_initScalarProperties($apiResponse->properties, [ diff --git a/src/Api/Struct/Webspace/DiskUsage.php b/src/Api/Struct/Webspace/DiskUsage.php index 377700f5..6369717c 100644 --- a/src/Api/Struct/Webspace/DiskUsage.php +++ b/src/Api/Struct/Webspace/DiskUsage.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class DiskUsage extends Struct { @@ -20,7 +19,7 @@ class DiskUsage extends Struct public int $configs; public int $chroot; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'httpdocs', diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index 33d39802..e77918b6 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class GeneralInfo extends Struct { @@ -23,7 +22,7 @@ class GeneralInfo extends Struct /** @var string */ public string $adminDescription; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ ['cr_date' => 'creationDate'], diff --git a/src/Api/Struct/Webspace/HostingPropertyInfo.php b/src/Api/Struct/Webspace/HostingPropertyInfo.php index c5f2f158..f761d36b 100644 --- a/src/Api/Struct/Webspace/HostingPropertyInfo.php +++ b/src/Api/Struct/Webspace/HostingPropertyInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class HostingPropertyInfo extends Struct { @@ -12,7 +11,7 @@ class HostingPropertyInfo extends Struct public string $type; public string $label; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/Info.php b/src/Api/Struct/Webspace/Info.php index 8fac2be0..cb6e4c2c 100644 --- a/src/Api/Struct/Webspace/Info.php +++ b/src/Api/Struct/Webspace/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { @@ -12,7 +11,7 @@ class Info extends Struct public string $guid; public string $name; - public function __construct(XmlResponse $apiResponse, string $name = '') + public function __construct(\SimpleXMLElement $apiResponse, string $name = '') { $this->_initScalarProperties($apiResponse, [ 'id', diff --git a/src/Api/Struct/Webspace/Limit.php b/src/Api/Struct/Webspace/Limit.php index 95d668d5..6d7b0a40 100644 --- a/src/Api/Struct/Webspace/Limit.php +++ b/src/Api/Struct/Webspace/Limit.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Limit extends Struct { public string $name; public string $value; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/LimitDescriptor.php b/src/Api/Struct/Webspace/LimitDescriptor.php index 6ceb0a74..0b4f7b7f 100644 --- a/src/Api/Struct/Webspace/LimitDescriptor.php +++ b/src/Api/Struct/Webspace/LimitDescriptor.php @@ -4,13 +4,12 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class LimitDescriptor extends Struct { public array $limits; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->limits = []; diff --git a/src/Api/Struct/Webspace/LimitInfo.php b/src/Api/Struct/Webspace/LimitInfo.php index c3f20ee5..e0ff03ae 100644 --- a/src/Api/Struct/Webspace/LimitInfo.php +++ b/src/Api/Struct/Webspace/LimitInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class LimitInfo extends Struct { @@ -12,7 +11,7 @@ class LimitInfo extends Struct public string $type; public string $label; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/Limits.php b/src/Api/Struct/Webspace/Limits.php index bdb970d6..7a317c79 100644 --- a/src/Api/Struct/Webspace/Limits.php +++ b/src/Api/Struct/Webspace/Limits.php @@ -4,14 +4,13 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Limits extends Struct { public string $overuse; public array $limits; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, ['overuse']); $this->limits = []; diff --git a/src/Api/Struct/Webspace/PermissionDescriptor.php b/src/Api/Struct/Webspace/PermissionDescriptor.php index 3a56882e..1f09931f 100644 --- a/src/Api/Struct/Webspace/PermissionDescriptor.php +++ b/src/Api/Struct/Webspace/PermissionDescriptor.php @@ -4,13 +4,12 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class PermissionDescriptor extends Struct { public array $permissions; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->permissions = []; diff --git a/src/Api/Struct/Webspace/PermissionInfo.php b/src/Api/Struct/Webspace/PermissionInfo.php index 8de0c84a..7cdfc4a0 100644 --- a/src/Api/Struct/Webspace/PermissionInfo.php +++ b/src/Api/Struct/Webspace/PermissionInfo.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class PermissionInfo extends Struct { @@ -12,7 +11,7 @@ class PermissionInfo extends Struct public string $type; public string $label; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->_initScalarProperties($apiResponse, [ 'name', diff --git a/src/Api/Struct/Webspace/PhpSettings.php b/src/Api/Struct/Webspace/PhpSettings.php index 37dea7d5..8067571e 100644 --- a/src/Api/Struct/Webspace/PhpSettings.php +++ b/src/Api/Struct/Webspace/PhpSettings.php @@ -4,13 +4,12 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class PhpSettings extends Struct { public array $properties; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->properties = []; diff --git a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php index f49e615b..987b10ee 100644 --- a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php +++ b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php @@ -4,13 +4,12 @@ namespace PleskX\Api\Struct\Webspace; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class PhysicalHostingDescriptor extends Struct { public array $properties; - public function __construct(XmlResponse $apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { $this->properties = []; diff --git a/tests/PhpHandlerTest.php b/tests/PhpHandlerTest.php index e622cfeb..47b0b67e 100644 --- a/tests/PhpHandlerTest.php +++ b/tests/PhpHandlerTest.php @@ -7,9 +7,8 @@ class PhpHandlerTest extends TestCase { public function testGet() { - $handler = static::$_client->phpHandler()->get(null, null); + $handler = static::$_client->phpHandler()->get(); - $this->assertIsObject($handler); $this->assertObjectHasAttribute('type', $handler); } From be8c4ab5aeb6737daf6e78d08fb9e7a17949f4b7 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 7 Oct 2021 11:13:58 +0700 Subject: [PATCH 51/73] Fix StyleCI issues --- src/Api/Client.php | 3 ++- src/Api/Operator/PhpHandler.php | 2 +- src/Api/Operator/SiteAlias.php | 2 +- src/Api/Struct/PhpHandler/Info.php | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index a270b2f7..c435c11d 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -221,8 +221,9 @@ private function _performHttpRequest($request) * @param array $requests * @param int $mode * - * @return array * @throws Client\Exception + * + * @return array */ public function multiRequest(array $requests, $mode = self::RESPONSE_SHORT): array { diff --git a/src/Api/Operator/PhpHandler.php b/src/Api/Operator/PhpHandler.php index 5adb1e8b..ad7f838d 100644 --- a/src/Api/Operator/PhpHandler.php +++ b/src/Api/Operator/PhpHandler.php @@ -22,7 +22,7 @@ public function get($field = null, $value = null): Info $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, (string)$value); + $filterTag->addChild($field, (string) $value); } $response = $this->_client->request($packet, Client::RESPONSE_FULL); diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index c013c17d..4c9e3900 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -22,7 +22,7 @@ public function create(array $properties, array $preferences = []) $prefs = $info->addChild('pref'); foreach ($preferences as $key => $value) { - $prefs->addChild($key, is_bool($value) ? ($value ? "1" : "0") : $value); + $prefs->addChild($key, is_bool($value) ? ($value ? '1' : '0') : $value); } } diff --git a/src/Api/Struct/PhpHandler/Info.php b/src/Api/Struct/PhpHandler/Info.php index e4502314..a98235af 100644 --- a/src/Api/Struct/PhpHandler/Info.php +++ b/src/Api/Struct/PhpHandler/Info.php @@ -4,7 +4,6 @@ namespace PleskX\Api\Struct\PhpHandler; use PleskX\Api\Struct; -use PleskX\Api\XmlResponse; class Info extends Struct { From 717cfd074daec70b8e4f04de555e82dcf033738e Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 7 Oct 2021 11:16:30 +0700 Subject: [PATCH 52/73] Make psalm as an essential part of testing phase --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 29246498..a91fecd0 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,10 @@ "process-timeout": 0 }, "scripts": { - "test": "phpunit", + "test": [ + "psalm", + "phpunit" + ], "test:watch": "phpunit-watcher watch", "lint": "psalm" }, From fe2cfd7040c208fa83fa21776d5f4d32606f39ee Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 7 Oct 2021 12:08:48 +0700 Subject: [PATCH 53/73] Keep the ability to provide additional options to PHPUnit --- composer.json | 5 +---- docker-compose.yml | 7 ++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index a91fecd0..29246498 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,7 @@ "process-timeout": 0 }, "scripts": { - "test": [ - "psalm", - "phpunit" - ], + "test": "phpunit", "test:watch": "phpunit-watcher watch", "lint": "psalm" }, diff --git a/docker-compose.yml b/docker-compose.yml index 0a2e35bb..a0332132 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,12 @@ services: environment: REMOTE_URL: https://plesk:8443 REMOTE_PASSWORD: changeme1Q** - command: bash -c "cd /opt/api-php-lib && composer install && ./wait-for-plesk.sh && composer test -- --testdox" + command: > + bash -c "cd /opt/api-php-lib + && composer install + && ./wait-for-plesk.sh + && composer lint + && composer test -- --testdox" depends_on: - plesk links: From 9d45052bc93b554cb6abefa8a3522c08b062da3d Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 13 Oct 2021 22:15:19 +0700 Subject: [PATCH 54/73] Use Plesk Docker container defaults to simplify tests execution --- tests/TestCase.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 259537ab..58670fa6 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,9 +15,9 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase public static function setUpBeforeClass(): void { - $login = getenv('REMOTE_LOGIN'); - $password = getenv('REMOTE_PASSWORD'); - $host = getenv('REMOTE_HOST'); + $login = getenv('REMOTE_LOGIN') ?: 'admin'; + $password = getenv('REMOTE_PASSWORD') ?: 'changeme1Q**'; + $host = getenv('REMOTE_HOST') ?: 'localhost'; $port = 8443; $scheme = 'https'; From 772b810773503cfc7aed4db1c13fd2f10e700ce2 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 13 Oct 2021 23:09:36 +0700 Subject: [PATCH 55/73] Add an ability to enable/disable customers --- src/Api/Operator/Customer.php | 44 +++++++++++++++++++++++++ src/Api/Struct/Customer/GeneralInfo.php | 3 ++ tests/CustomerTest.php | 21 ++++++++++++ 3 files changed, 68 insertions(+) diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index d974c559..93ac13a2 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -57,4 +57,48 @@ public function getAll() { return $this->_getItems(Struct\GeneralInfo::class, 'gen_info'); } + + /** + * @param string $field + * @param int|string $value + * + * @return bool + */ + public function enable(string $field, $value): bool + { + return $this->setProperty($field, $value, 'status', 0); + } + + /** + * @param string $field + * @param int|string $value + * + * @return bool + */ + public function disable(string $field, $value): bool + { + return $this->setProperty($field, $value, 'status', 1); + } + + /** + * @param string $field + * @param int|string $value + * @param string $property + * @param int|string $propertyValue + * + * @return bool + */ + public function setProperty(string $field, $value, string $property, $propertyValue): bool + { + $packet = $this->_client->getPacket(); + $setTag = $packet->addChild($this->_wrapperTag)->addChild('set'); + $setTag->addChild('filter')->addChild($field, (string) $value); + $genInfoTag = $setTag->addChild('values')->addChild('gen_info'); + $genInfoTag->addChild($property, (string) $propertyValue); + + $response = $this->_client->request($packet); + + return 'ok' === (string) $response->status; + } + } diff --git a/src/Api/Struct/Customer/GeneralInfo.php b/src/Api/Struct/Customer/GeneralInfo.php index 56b12bf1..9da9c6c2 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -22,6 +22,7 @@ class GeneralInfo extends Struct public string $country; public string $description; public string $externalId; + public bool $enabled; public function __construct(\SimpleXMLElement $apiResponse) { @@ -41,5 +42,7 @@ public function __construct(\SimpleXMLElement $apiResponse) 'external-id', 'description', ]); + + $this->enabled = '0' === (string) $apiResponse->status; } } diff --git a/tests/CustomerTest.php b/tests/CustomerTest.php index 895162cc..2607655f 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerTest.php @@ -84,4 +84,25 @@ public function testGetAll() static::$_client->customer()->delete('login', 'customer-a'); static::$_client->customer()->delete('login', 'customer-b'); } + + public function testEnable() + { + $customer = static::$_client->customer()->create($this->_customerProperties); + static::$_client->customer()->disable('id', $customer->id); + static::$_client->customer()->enable('id', $customer->id); + $customerInfo = static::$_client->customer()->get('id', $customer->id); + $this->assertTrue($customerInfo->enabled); + + static::$_client->customer()->delete('id', $customer->id); + } + + public function testDisable() + { + $customer = static::$_client->customer()->create($this->_customerProperties); + static::$_client->customer()->disable('id', $customer->id); + $customerInfo = static::$_client->customer()->get('id', $customer->id); + $this->assertFalse($customerInfo->enabled); + + static::$_client->customer()->delete('id', $customer->id); + } } From f0b3481cc8269e80c6cd63bc6726837e9c5de876 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 13 Oct 2021 23:11:00 +0700 Subject: [PATCH 56/73] Fix StyleCI issue --- src/Api/Operator/Customer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index 93ac13a2..a68500fa 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -100,5 +100,4 @@ public function setProperty(string $field, $value, string $property, $propertyVa return 'ok' === (string) $response->status; } - } From 8d459555c5dde889cc9361db4a9645bfd13dd422 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 17 Oct 2021 19:51:34 +0700 Subject: [PATCH 57/73] Add an ability to update customer's properties --- src/Api/Operator/Customer.php | 13 +++++++------ tests/CustomerTest.php | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index a68500fa..05bea9d9 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -66,7 +66,7 @@ public function getAll() */ public function enable(string $field, $value): bool { - return $this->setProperty($field, $value, 'status', 0); + return $this->setProperties($field, $value, ['status' => 0]); } /** @@ -77,24 +77,25 @@ public function enable(string $field, $value): bool */ public function disable(string $field, $value): bool { - return $this->setProperty($field, $value, 'status', 1); + return $this->setProperties($field, $value, ['status' => 1]); } /** * @param string $field * @param int|string $value - * @param string $property - * @param int|string $propertyValue + * @param array $properties * * @return bool */ - public function setProperty(string $field, $value, string $property, $propertyValue): bool + public function setProperties(string $field, $value, array $properties): bool { $packet = $this->_client->getPacket(); $setTag = $packet->addChild($this->_wrapperTag)->addChild('set'); $setTag->addChild('filter')->addChild($field, (string) $value); $genInfoTag = $setTag->addChild('values')->addChild('gen_info'); - $genInfoTag->addChild($property, (string) $propertyValue); + foreach ($properties as $property => $propertyValue) { + $genInfoTag->addChild($property, (string) $propertyValue); + } $response = $this->_client->request($packet); diff --git a/tests/CustomerTest.php b/tests/CustomerTest.php index 2607655f..cb69f5e5 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerTest.php @@ -105,4 +105,18 @@ public function testDisable() static::$_client->customer()->delete('id', $customer->id); } + + public function testSetProperties() + { + $customer = static::$_client->customer()->create($this->_customerProperties); + static::$_client->customer()->setProperties('id', $customer->id, [ + 'pname' => 'Mike Black', + 'email' => 'mike@black.com', + ]); + $customerInfo = static::$_client->customer()->get('id', $customer->id); + $this->assertEquals('Mike Black', $customerInfo->personalName); + $this->assertEquals('mike@black.com', $customerInfo->email); + + static::$_client->customer()->delete('id', $customer->id); + } } From 115511abf3df8b218b0c3409d11963af0a7ad081 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 17 Oct 2021 20:43:40 +0700 Subject: [PATCH 58/73] Add an ability to enable/disable webspace and set other properties --- src/Api/Operator/Webspace.php | 44 +++++++++++++++++++++++++ src/Api/Struct/Webspace/GeneralInfo.php | 5 +-- tests/WebspaceTest.php | 35 ++++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index 2aab504b..82267bf8 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -144,4 +144,48 @@ public function getDiskUsage(string $field, $value): Struct\DiskUsage return reset($items); } + + /** + * @param string $field + * @param int|string $value + * + * @return bool + */ + public function enable(string $field, $value): bool + { + return $this->setProperties($field, $value, ['status' => 0]); + } + + /** + * @param string $field + * @param int|string $value + * + * @return bool + */ + public function disable(string $field, $value): bool + { + return $this->setProperties($field, $value, ['status' => 1]); + } + + /** + * @param string $field + * @param int|string $value + * @param array $properties + * + * @return bool + */ + public function setProperties(string $field, $value, array $properties): bool + { + $packet = $this->_client->getPacket(); + $setTag = $packet->addChild($this->_wrapperTag)->addChild('set'); + $setTag->addChild('filter')->addChild($field, (string) $value); + $genInfoTag = $setTag->addChild('values')->addChild('gen_setup'); + foreach ($properties as $property => $propertyValue) { + $genInfoTag->addChild($property, (string) $propertyValue); + } + + $response = $this->_client->request($packet); + + return 'ok' === (string) $response->status; + } } diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index e77918b6..53ab423a 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -18,9 +18,8 @@ class GeneralInfo extends Struct public string $guid; public string $vendorGuid; public string $description; - - /** @var string */ public string $adminDescription; + public bool $enabled; public function __construct(\SimpleXMLElement $apiResponse) { @@ -40,5 +39,7 @@ public function __construct(\SimpleXMLElement $apiResponse) foreach ($apiResponse->dns_ip_address as $ip) { $this->ipAddresses[] = (string) $ip; } + + $this->enabled = '0' === (string) $apiResponse->status; } } diff --git a/tests/WebspaceTest.php b/tests/WebspaceTest.php index 0288c525..af04b3e4 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceTest.php @@ -187,4 +187,39 @@ public function testGet() static::$_client->webspace()->delete('id', $webspace->id); } + + public function testEnable() + { + $webspace = static::_createWebspace(); + + static::$_client->webspace()->disable('id', $webspace->id); + static::$_client->webspace()->enable('id', $webspace->id); + $webspaceInfo = static::$_client->webspace()->get('id', $webspace->id); + $this->assertTrue($webspaceInfo->enabled); + + static::$_client->webspace()->delete('id', $webspace->id); + } + + public function testDisable() + { + $webspace = static::_createWebspace(); + + static::$_client->webspace()->disable('id', $webspace->id); + $webspaceInfo = static::$_client->webspace()->get('id', $webspace->id); + $this->assertFalse($webspaceInfo->enabled); + + static::$_client->webspace()->delete('id', $webspace->id); + } + + public function testSetProperties() + { + $webspace = static::_createWebspace(); + static::$_client->webspace()->setProperties('id', $webspace->id, [ + 'description' => 'Test Description', + ]); + $webspaceInfo = static::$_client->webspace()->get('id', $webspace->id); + $this->assertEquals('Test Description', $webspaceInfo->description); + + static::$_client->webspace()->delete('id', $webspace->id); + } } From f0e4ac36a38f1e31526cff8671e229cea8cbfc43 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <sibprogrammer@gmail.com> Date: Sun, 24 Oct 2021 13:21:57 +0700 Subject: [PATCH 59/73] Introduce PHPCS for style checks (future replacement of StyleCI) --- composer.json | 3 ++- composer.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++-- phpcs.xml.dist | 27 +++++++++++++++++++++++ 3 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 phpcs.xml.dist diff --git a/composer.json b/composer.json index 29246498..6bc965b5 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ "require-dev": { "phpunit/phpunit": "^9", "spatie/phpunit-watcher": "^1.22", - "vimeo/psalm": "^4.10" + "vimeo/psalm": "^4.10", + "squizlabs/php_codesniffer": "^3.6" }, "config": { "process-timeout": 0 diff --git a/composer.lock b/composer.lock index 8e37f4e7..b6695290 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "29ddab81b559997ef3ca40b6a2c85d56", + "content-hash": "d10c51a90b73fb910cfb5516625446f8", "packages": [], "packages-dev": [ { @@ -3185,6 +3185,62 @@ }, "time": "2021-02-26T08:00:42+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.6.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-10-11T04:00:11+00:00" + }, { "name": "symfony/console", "version": "v5.3.7", @@ -4531,5 +4587,5 @@ "ext-simplexml": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 00000000..b6263f5b --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,27 @@ +<?xml version="1.0"?> +<ruleset name="PHP library for Plesk XML-RPC API"> + <file>src</file> + <file>tests</file> + <rule ref="Generic"> + <exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/> + <exclude name="Generic.Files.EndFileNoNewline"/> + <exclude name="Generic.Files.LowercasedFilename.NotFound"/> + <exclude name="Generic.PHP.RequireStrictTypes"/> + <exclude name="Generic.PHP.ClosingPHPTag"/> + <exclude name="Generic.PHP.UpperCaseConstant"/> + <exclude name="Generic.Arrays.DisallowShortArraySyntax"/> + <exclude name="Generic.Classes.OpeningBraceSameLine"/> + <exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/> + <exclude name="Generic.Formatting.MultipleStatementAlignment"/> + <exclude name="Generic.Formatting.NoSpaceAfterCast"/> + <exclude name="Generic.Formatting.SpaceBeforeCast"/> + <exclude name="Generic.Formatting.SpaceAfterNot"/> + <exclude name="Generic.Commenting.DocComment"/> + <exclude name="Generic.ControlStructures.DisallowYodaConditions"/> + </rule> + <rule ref="PSR1"/> + <rule ref="PSR2"/> + <rule ref="PSR12"> + <exclude name="PSR12.Files.FileHeader"/> + </rule> +</ruleset> From 2c111ff13dd7d7e540cba57e9cadd45899104332 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <sibprogrammer@gmail.com> Date: Sun, 24 Oct 2021 14:33:19 +0700 Subject: [PATCH 60/73] Fix code style violations found by phpcs --- src/Api/{Struct.php => AbstractStruct.php} | 8 +- src/Api/Client.php | 176 +++++++++--------- src/Api/InternalClient.php | 2 +- src/Api/Operator.php | 26 +-- src/Api/Operator/Certificate.php | 6 +- src/Api/Operator/Customer.php | 18 +- src/Api/Operator/Database.php | 30 +-- src/Api/Operator/DatabaseServer.php | 14 +- src/Api/Operator/Dns.php | 26 +-- src/Api/Operator/DnsTemplate.php | 20 +- src/Api/Operator/EventLog.php | 2 +- src/Api/Operator/Ip.php | 6 +- src/Api/Operator/Locale.php | 6 +- src/Api/Operator/Mail.php | 18 +- src/Api/Operator/PhpHandler.php | 12 +- src/Api/Operator/ProtectedDirectory.php | 28 +-- src/Api/Operator/Reseller.php | 14 +- src/Api/Operator/SecretKey.php | 22 +-- src/Api/Operator/Server.php | 44 ++--- src/Api/Operator/ServicePlan.php | 14 +- src/Api/Operator/Session.php | 4 +- src/Api/Operator/Site.php | 26 ++- src/Api/Operator/SiteAlias.php | 14 +- src/Api/Operator/Subdomain.php | 14 +- src/Api/Operator/Ui.php | 8 +- src/Api/Operator/VirtualDirectory.php | 2 +- src/Api/Operator/Webspace.php | 28 +-- src/Api/Struct/Certificate/Info.php | 6 +- src/Api/Struct/Customer/GeneralInfo.php | 6 +- src/Api/Struct/Customer/Info.php | 6 +- src/Api/Struct/Database/Info.php | 6 +- src/Api/Struct/Database/UserInfo.php | 6 +- src/Api/Struct/DatabaseServer/Info.php | 6 +- src/Api/Struct/Dns/Info.php | 6 +- src/Api/Struct/EventLog/DetailedEvent.php | 6 +- src/Api/Struct/EventLog/Event.php | 6 +- src/Api/Struct/Ip/Info.php | 6 +- src/Api/Struct/Locale/Info.php | 6 +- src/Api/Struct/Mail/GeneralInfo.php | 6 +- src/Api/Struct/Mail/Info.php | 6 +- src/Api/Struct/PhpHandler/Info.php | 6 +- .../Struct/ProtectedDirectory/DataInfo.php | 6 +- src/Api/Struct/ProtectedDirectory/Info.php | 6 +- .../Struct/ProtectedDirectory/UserInfo.php | 6 +- src/Api/Struct/Reseller/GeneralInfo.php | 6 +- src/Api/Struct/Reseller/Info.php | 6 +- src/Api/Struct/SecretKey/Info.php | 6 +- src/Api/Struct/Server/Admin.php | 6 +- src/Api/Struct/Server/GeneralInfo.php | 6 +- src/Api/Struct/Server/Preferences.php | 6 +- src/Api/Struct/Server/SessionPreferences.php | 6 +- src/Api/Struct/Server/Statistics.php | 4 +- .../Struct/Server/Statistics/DiskSpace.php | 6 +- .../Struct/Server/Statistics/LoadAverage.php | 4 +- src/Api/Struct/Server/Statistics/Memory.php | 6 +- src/Api/Struct/Server/Statistics/Objects.php | 6 +- src/Api/Struct/Server/Statistics/Other.php | 6 +- src/Api/Struct/Server/Statistics/Swap.php | 6 +- src/Api/Struct/Server/Statistics/Version.php | 6 +- src/Api/Struct/Server/UpdatesInfo.php | 6 +- src/Api/Struct/ServicePlan/Info.php | 6 +- src/Api/Struct/Session/Info.php | 6 +- src/Api/Struct/Site/GeneralInfo.php | 6 +- src/Api/Struct/Site/HostingInfo.php | 6 +- src/Api/Struct/Site/Info.php | 6 +- src/Api/Struct/SiteAlias/GeneralInfo.php | 6 +- src/Api/Struct/SiteAlias/Info.php | 6 +- src/Api/Struct/Subdomain/Info.php | 6 +- src/Api/Struct/Ui/CustomButton.php | 8 +- src/Api/Struct/Webspace/DiskUsage.php | 6 +- src/Api/Struct/Webspace/GeneralInfo.php | 6 +- .../Struct/Webspace/HostingPropertyInfo.php | 6 +- src/Api/Struct/Webspace/Info.php | 6 +- src/Api/Struct/Webspace/Limit.php | 6 +- src/Api/Struct/Webspace/LimitDescriptor.php | 4 +- src/Api/Struct/Webspace/LimitInfo.php | 6 +- src/Api/Struct/Webspace/Limits.php | 6 +- .../Struct/Webspace/PermissionDescriptor.php | 4 +- src/Api/Struct/Webspace/PermissionInfo.php | 6 +- src/Api/Struct/Webspace/PhpSettings.php | 4 +- .../Webspace/PhysicalHostingDescriptor.php | 4 +- src/Api/XmlResponse.php | 2 +- tests/{TestCase.php => AbstractTestCase.php} | 36 ++-- ...ientTest.php => ApiClientAbstractTest.php} | 52 +++--- ...teTest.php => CertificateAbstractTest.php} | 4 +- ...tomerTest.php => CustomerAbstractTest.php} | 58 +++--- ...abaseTest.php => DatabaseAbstractTest.php} | 94 +++++----- ...est.php => DatabaseServerAbstractTest.php} | 8 +- tests/{DnsTest.php => DnsAbstractTest.php} | 34 ++-- ...teTest.php => DnsTemplateAbstractTest.php} | 37 ++-- ...ntLogTest.php => EventLogAbstractTest.php} | 8 +- tests/{IpTest.php => IpAbstractTest.php} | 4 +- ...{LocaleTest.php => LocaleAbstractTest.php} | 6 +- tests/{MailTest.php => MailAbstractTest.php} | 33 ++-- ...lerTest.php => PhpHandlerAbstractTest.php} | 8 +- tests/ProtectedDirectoryAbstractTest.php | 92 +++++++++ tests/ProtectedDirectoryTest.php | 84 --------- ...ellerTest.php => ResellerAbstractTest.php} | 32 ++-- tests/SecretKeyAbstractTest.php | 102 ++++++++++ tests/SecretKeyTest.php | 96 ---------- ...{ServerTest.php => ServerAbstractTest.php} | 33 ++-- ...anTest.php => ServicePlanAbstractTest.php} | 28 +-- ...essionTest.php => SessionAbstractTest.php} | 14 +- tests/{SiteTest.php => SiteAbstractTest.php} | 50 ++--- tests/SiteAliasAbstractTest.php | 71 +++++++ tests/SiteAliasTest.php | 71 ------- ...mainTest.php => SubdomainAbstractTest.php} | 42 ++--- tests/{UiTest.php => UiAbstractTest.php} | 20 +- tests/Utility/KeyLimitChecker.php | 6 +- tests/Utility/PasswordProvider.php | 2 +- ...spaceTest.php => WebspaceAbstractTest.php} | 80 ++++---- 111 files changed, 1070 insertions(+), 1039 deletions(-) rename src/Api/{Struct.php => AbstractStruct.php} (90%) rename tests/{TestCase.php => AbstractTestCase.php} (62%) rename tests/{ApiClientTest.php => ApiClientAbstractTest.php} (74%) rename tests/{CertificateTest.php => CertificateAbstractTest.php} (85%) rename tests/{CustomerTest.php => CustomerAbstractTest.php} (56%) rename tests/{DatabaseTest.php => DatabaseAbstractTest.php} (65%) rename tests/{DatabaseServerTest.php => DatabaseServerAbstractTest.php} (69%) rename tests/{DnsTest.php => DnsAbstractTest.php} (79%) rename tests/{DnsTemplateTest.php => DnsTemplateAbstractTest.php} (60%) rename tests/{EventLogTest.php => EventLogAbstractTest.php} (69%) rename tests/{IpTest.php => IpAbstractTest.php} (77%) rename tests/{LocaleTest.php => LocaleAbstractTest.php} (69%) rename tests/{MailTest.php => MailAbstractTest.php} (55%) rename tests/{PhpHandlerTest.php => PhpHandlerAbstractTest.php} (72%) create mode 100644 tests/ProtectedDirectoryAbstractTest.php delete mode 100644 tests/ProtectedDirectoryTest.php rename tests/{ResellerTest.php => ResellerAbstractTest.php} (61%) create mode 100644 tests/SecretKeyAbstractTest.php delete mode 100644 tests/SecretKeyTest.php rename tests/{ServerTest.php => ServerAbstractTest.php} (75%) rename tests/{ServicePlanTest.php => ServicePlanAbstractTest.php} (64%) rename tests/{SessionTest.php => SessionAbstractTest.php} (58%) rename tests/{SiteTest.php => SiteAbstractTest.php} (59%) create mode 100644 tests/SiteAliasAbstractTest.php delete mode 100644 tests/SiteAliasTest.php rename tests/{SubdomainTest.php => SubdomainAbstractTest.php} (51%) rename tests/{UiTest.php => UiAbstractTest.php} (59%) rename tests/{WebspaceTest.php => WebspaceAbstractTest.php} (66%) diff --git a/src/Api/Struct.php b/src/Api/AbstractStruct.php similarity index 90% rename from src/Api/Struct.php rename to src/Api/AbstractStruct.php index eb2a8ef4..ea7a3917 100644 --- a/src/Api/Struct.php +++ b/src/Api/AbstractStruct.php @@ -3,7 +3,7 @@ namespace PleskX\Api; -abstract class Struct +abstract class AbstractStruct { /** * @param string $property @@ -13,7 +13,7 @@ abstract class Struct */ public function __set(string $property, $value) { - throw new \Exception("Try to set an undeclared property '$property'."); + throw new \Exception("Try to set an undeclared property '$property' to a value: $value."); } /** @@ -24,7 +24,7 @@ public function __set(string $property, $value) * * @throws \Exception */ - protected function _initScalarProperties($apiResponse, array $properties): void + protected function initScalarProperties($apiResponse, array $properties): void { foreach ($properties as $property) { if (is_array($property)) { @@ -68,7 +68,7 @@ protected function _initScalarProperties($apiResponse, array $properties): void */ private function underToCamel(string $under): string { - $under = '_'.str_replace('_', ' ', strtolower($under)); + $under = '_' . str_replace('_', ' ', strtolower($under)); return ltrim(str_replace(' ', '', ucwords($under)), '_'); } diff --git a/src/Api/Client.php b/src/Api/Client.php index c435c11d..48564e8b 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -10,24 +10,24 @@ */ class Client { - const RESPONSE_SHORT = 1; - const RESPONSE_FULL = 2; + public const RESPONSE_SHORT = 1; + public const RESPONSE_FULL = 2; - protected string $_host; - protected int $_port; - protected string $_protocol; - protected string $_login = ''; - protected string $_password = ''; - protected string $_proxy = ''; - protected string $_secretKey = ''; - protected string $_version = ''; + private string $host; + private int $port; + private string $protocol; + protected string $login = ''; + private string $password = ''; + private string $proxy = ''; + private string $secretKey = ''; + private string $version = ''; - protected array $_operatorsCache = []; + protected array $operatorsCache = []; /** * @var callable|null */ - protected $_verifyResponseCallback; + protected $verifyResponseCallback; /** * Create client. @@ -38,9 +38,9 @@ class Client */ public function __construct(string $host, int $port = 8443, string $protocol = 'https') { - $this->_host = $host; - $this->_port = $port; - $this->_protocol = $protocol; + $this->host = $host; + $this->port = $port; + $this->protocol = $protocol; } /** @@ -51,8 +51,8 @@ public function __construct(string $host, int $port = 8443, string $protocol = ' */ public function setCredentials(string $login, string $password): void { - $this->_login = $login; - $this->_password = $password; + $this->login = $login; + $this->password = $password; } /** @@ -62,7 +62,7 @@ public function setCredentials(string $login, string $password): void */ public function setSecretKey(string $secretKey): void { - $this->_secretKey = $secretKey; + $this->secretKey = $secretKey; } /** @@ -72,7 +72,7 @@ public function setSecretKey(string $secretKey): void */ public function setProxy(string $proxy): void { - $this->_proxy = $proxy; + $this->proxy = $proxy; } /** @@ -82,17 +82,18 @@ public function setProxy(string $proxy): void */ public function setVersion(string $version): void { - $this->_version = $version; + $this->version = $version; } /** - * Set custom function to verify response of API call according your own needs. Default verifying will be used if it is not specified. + * Set custom function to verify response of API call according your own needs. + * Default verifying will be used if it is not specified. * * @param callable|null $function */ public function setVerifyResponse(callable $function = null): void { - $this->_verifyResponseCallback = $function; + $this->verifyResponseCallback = $function; } /** @@ -102,7 +103,7 @@ public function setVerifyResponse(callable $function = null): void */ public function getHost(): string { - return $this->_host; + return $this->host; } /** @@ -112,7 +113,7 @@ public function getHost(): string */ public function getPort(): int { - return $this->_port; + return $this->port; } /** @@ -122,7 +123,7 @@ public function getPort(): int */ public function getProtocol(): string { - return $this->_protocol; + return $this->protocol; } /** @@ -134,9 +135,9 @@ public function getProtocol(): string */ public function getPacket($version = null): SimpleXMLElement { - $protocolVersion = !is_null($version) ? $version : $this->_version; + $protocolVersion = !is_null($version) ? $version : $this->version; $content = "<?xml version='1.0' encoding='UTF-8' ?>"; - $content .= '<packet'.('' === $protocolVersion ? '' : " version='$protocolVersion'").'/>'; + $content .= '<packet' . ('' === $protocolVersion ? '' : " version='$protocolVersion'") . '/>'; return new SimpleXMLElement($content); } @@ -157,24 +158,24 @@ public function request($request, $mode = self::RESPONSE_SHORT) $xml = $this->getPacket(); if (is_array($request)) { - $request = $this->_arrayToXml($request, $xml)->asXML(); + $request = $this->arrayToXml($request, $xml)->asXML(); } elseif (preg_match('/^[a-z]/', $request)) { - $request = $this->_expandRequestShortSyntax($request, $xml); + $request = $this->expandRequestShortSyntax($request, $xml); } } - if ('sdk' == $this->_protocol) { - $version = ('' == $this->_version) ? null : $this->_version; + if ('sdk' == $this->protocol) { + $version = ('' == $this->version) ? null : $this->version; $requestXml = new SimpleXMLElement((string) $request); /** @psalm-suppress UndefinedClass */ - $xml = \pm_ApiRpc::getService($version)->call($requestXml->children()[0]->asXml(), $this->_login); + $xml = \pm_ApiRpc::getService($version)->call($requestXml->children()[0]->asXml(), $this->login); } else { - $xml = $this->_performHttpRequest((string) $request); + $xml = $this->performHttpRequest((string) $request); } - $this->_verifyResponseCallback - ? call_user_func($this->_verifyResponseCallback, $xml) - : $this->_verifyResponse($xml); + $this->verifyResponseCallback + ? call_user_func($this->verifyResponseCallback, $xml) + : $this->verifyResponse($xml); return (self::RESPONSE_FULL == $mode) ? $xml : $xml->xpath('//result')[0]; } @@ -188,20 +189,20 @@ public function request($request, $mode = self::RESPONSE_SHORT) * * @return XmlResponse */ - private function _performHttpRequest($request) + private function performHttpRequest($request) { $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, "$this->_protocol://$this->_host:$this->_port/enterprise/control/agent.php"); + curl_setopt($curl, CURLOPT_URL, "$this->protocol://$this->host:$this->port/enterprise/control/agent.php"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($curl, CURLOPT_HTTPHEADER, $this->_getHeaders()); + curl_setopt($curl, CURLOPT_HTTPHEADER, $this->getHeaders()); curl_setopt($curl, CURLOPT_POSTFIELDS, $request); - if ('' !== $this->_proxy) { - curl_setopt($curl, CURLOPT_PROXY, $this->_proxy); + if ('' !== $this->proxy) { + curl_setopt($curl, CURLOPT_PROXY, $this->proxy); } $result = curl_exec($curl); @@ -234,24 +235,24 @@ public function multiRequest(array $requests, $mode = self::RESPONSE_SHORT): arr throw new Client\Exception('SimpleXML type of request is not supported for multi requests.'); } else { if (is_array($request)) { - $request = $this->_arrayToXml($request, $requestXml)->asXML(); + $request = $this->arrayToXml($request, $requestXml)->asXML(); if (!$request) { throw new Client\Exception('Failed to create an XML string for request'); } } elseif (preg_match('/^[a-z]/', $request)) { - $this->_expandRequestShortSyntax($request, $requestXml); + $this->expandRequestShortSyntax($request, $requestXml); } } } - if ('sdk' == $this->_protocol) { + if ('sdk' == $this->protocol) { throw new Client\Exception('Multi requests are not supported via SDK.'); } else { $xmlString = $requestXml->asXML(); if (!$xmlString) { throw new Client\Exception('Failed to create an XML string for request'); } - $responseXml = $this->_performHttpRequest($xmlString); + $responseXml = $this->performHttpRequest($xmlString); } $responses = []; @@ -278,18 +279,18 @@ public function multiRequest(array $requests, $mode = self::RESPONSE_SHORT): arr * * @return array */ - protected function _getHeaders() + private function getHeaders() { $headers = [ 'Content-Type: text/xml', 'HTTP_PRETTY_PRINT: TRUE', ]; - if ($this->_secretKey) { - $headers[] = "KEY: $this->_secretKey"; + if ($this->secretKey) { + $headers[] = "KEY: $this->secretKey"; } else { - $headers[] = "HTTP_AUTH_LOGIN: $this->_login"; - $headers[] = "HTTP_AUTH_PASSWD: $this->_password"; + $headers[] = "HTTP_AUTH_LOGIN: $this->login"; + $headers[] = "HTTP_AUTH_PASSWD: $this->password"; } return $headers; @@ -302,7 +303,7 @@ protected function _getHeaders() * * @throws Exception */ - protected function _verifyResponse($xml): void + private function verifyResponse($xml): void { if ($xml->system && $xml->system->status && 'error' == (string) $xml->system->status) { throw new Exception((string) $xml->system->errtext, (int) $xml->system->errcode); @@ -324,13 +325,14 @@ protected function _verifyResponse($xml): void * * @return false|string */ - protected function _expandRequestShortSyntax($request, SimpleXMLElement $xml) + private function expandRequestShortSyntax($request, SimpleXMLElement $xml) { $parts = explode('.', $request); $node = $xml; $lastParts = end($parts); foreach ($parts as $part) { + // phpcs:ignore @list($name, $value) = explode('=', $part); if ($part !== $lastParts) { $node = $node->addChild($name); @@ -351,12 +353,12 @@ protected function _expandRequestShortSyntax($request, SimpleXMLElement $xml) * * @return SimpleXMLElement */ - protected function _arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = null) + private function arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = null) { foreach ($array as $key => $value) { $el = is_int($key) && $parentEl ? $parentEl : $key; if (is_array($value)) { - $this->_arrayToXml($value, $this->_isAssocArray($value) ? $xml->addChild($el) : $xml, $el); + $this->arrayToXml($value, $this->isAssocArray($value) ? $xml->addChild($el) : $xml, $el); } else { $xml->{$el} = (string) $value; } @@ -370,7 +372,7 @@ protected function _arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = * * @return bool */ - protected function _isAssocArray(array $array) + private function isAssocArray(array $array) { return $array && array_keys($array) !== range(0, count($array) - 1); } @@ -380,149 +382,149 @@ protected function _isAssocArray(array $array) * * @return mixed */ - protected function _getOperator(string $name) + private function getOperator(string $name) { - if (!isset($this->_operatorsCache[$name])) { - $className = '\\PleskX\\Api\\Operator\\'.$name; + if (!isset($this->operatorsCache[$name])) { + $className = '\\PleskX\\Api\\Operator\\' . $name; /** @psalm-suppress InvalidStringClass */ - $this->_operatorsCache[$name] = new $className($this); + $this->operatorsCache[$name] = new $className($this); } - return $this->_operatorsCache[$name]; + return $this->operatorsCache[$name]; } public function server(): Operator\Server { - return $this->_getOperator('Server'); + return $this->getOperator('Server'); } public function customer(): Operator\Customer { - return $this->_getOperator('Customer'); + return $this->getOperator('Customer'); } public function webspace(): Operator\Webspace { - return $this->_getOperator('Webspace'); + return $this->getOperator('Webspace'); } public function subdomain(): Operator\Subdomain { - return $this->_getOperator('Subdomain'); + return $this->getOperator('Subdomain'); } public function dns(): Operator\Dns { - return $this->_getOperator('Dns'); + return $this->getOperator('Dns'); } public function dnsTemplate(): Operator\DnsTemplate { - return $this->_getOperator('DnsTemplate'); + return $this->getOperator('DnsTemplate'); } public function databaseServer(): Operator\DatabaseServer { - return $this->_getOperator('DatabaseServer'); + return $this->getOperator('DatabaseServer'); } public function mail(): Operator\Mail { - return $this->_getOperator('Mail'); + return $this->getOperator('Mail'); } public function certificate(): Operator\Certificate { - return $this->_getOperator('Certificate'); + return $this->getOperator('Certificate'); } public function siteAlias(): Operator\SiteAlias { - return $this->_getOperator('SiteAlias'); + return $this->getOperator('SiteAlias'); } public function ip(): Operator\Ip { - return $this->_getOperator('Ip'); + return $this->getOperator('Ip'); } public function eventLog(): Operator\EventLog { - return $this->_getOperator('EventLog'); + return $this->getOperator('EventLog'); } public function secretKey(): Operator\SecretKey { - return $this->_getOperator('SecretKey'); + return $this->getOperator('SecretKey'); } public function ui(): Operator\Ui { - return $this->_getOperator('Ui'); + return $this->getOperator('Ui'); } public function servicePlan(): Operator\ServicePlan { - return $this->_getOperator('ServicePlan'); + return $this->getOperator('ServicePlan'); } public function virtualDirectory(): Operator\VirtualDirectory { - return $this->_getOperator('VirtualDirectory'); + return $this->getOperator('VirtualDirectory'); } public function database(): Operator\Database { - return $this->_getOperator('Database'); + return $this->getOperator('Database'); } public function session(): Operator\Session { - return $this->_getOperator('Session'); + return $this->getOperator('Session'); } public function locale(): Operator\Locale { - return $this->_getOperator('Locale'); + return $this->getOperator('Locale'); } public function logRotation(): Operator\LogRotation { - return $this->_getOperator('LogRotation'); + return $this->getOperator('LogRotation'); } public function protectedDirectory(): Operator\ProtectedDirectory { - return $this->_getOperator('ProtectedDirectory'); + return $this->getOperator('ProtectedDirectory'); } public function reseller(): Operator\Reseller { - return $this->_getOperator('Reseller'); + return $this->getOperator('Reseller'); } public function resellerPlan(): Operator\ResellerPlan { - return $this->_getOperator('ResellerPlan'); + return $this->getOperator('ResellerPlan'); } public function aps(): Operator\Aps { - return $this->_getOperator('Aps'); + return $this->getOperator('Aps'); } public function servicePlanAddon(): Operator\ServicePlanAddon { - return $this->_getOperator('ServicePlanAddon'); + return $this->getOperator('ServicePlanAddon'); } public function site(): Operator\Site { - return $this->_getOperator('Site'); + return $this->getOperator('Site'); } public function phpHandler(): Operator\PhpHandler { - return $this->_getOperator('PhpHandler'); + return $this->getOperator('PhpHandler'); } } diff --git a/src/Api/InternalClient.php b/src/Api/InternalClient.php index e399c965..99044b1b 100644 --- a/src/Api/InternalClient.php +++ b/src/Api/InternalClient.php @@ -20,6 +20,6 @@ public function __construct() */ public function setLogin(string $login): void { - $this->_login = $login; + $this->login = $login; } } diff --git a/src/Api/Operator.php b/src/Api/Operator.php index c577e366..b22768b4 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -5,17 +5,17 @@ class Operator { - protected string $_wrapperTag = ''; - protected Client $_client; + protected string $wrapperTag = ''; + protected Client $client; public function __construct(Client $client) { - $this->_client = $client; + $this->client = $client; - if ('' === $this->_wrapperTag) { + if ('' === $this->wrapperTag) { $classNameParts = explode('\\', get_class($this)); - $this->_wrapperTag = end($classNameParts); - $this->_wrapperTag = strtolower(preg_replace('/([a-z])([A-Z])/', '\1-\2', $this->_wrapperTag)); + $this->wrapperTag = end($classNameParts); + $this->wrapperTag = strtolower(preg_replace('/([a-z])([A-Z])/', '\1-\2', $this->wrapperTag)); } } @@ -29,7 +29,7 @@ public function __construct(Client $client) */ public function request($request, $mode = Client::RESPONSE_SHORT) { - $wrapperTag = $this->_wrapperTag; + $wrapperTag = $this->wrapperTag; if (is_array($request)) { $request = [$wrapperTag => $request]; @@ -39,7 +39,7 @@ public function request($request, $mode = Client::RESPONSE_SHORT) $request = "<$wrapperTag>$request</$wrapperTag>"; } - return $this->_client->request($request, $mode); + return $this->client->request($request, $mode); } /** @@ -49,7 +49,7 @@ public function request($request, $mode = Client::RESPONSE_SHORT) * * @return bool */ - protected function _delete($field, $value, $deleteMethodName = 'del') + protected function deleteBy(string $field, $value, string $deleteMethodName = 'del'): bool { $response = $this->request([ $deleteMethodName => [ @@ -71,10 +71,10 @@ protected function _delete($field, $value, $deleteMethodName = 'del') * * @return mixed */ - protected function _getItems($structClass, $infoTag, $field = null, $value = null, callable $filter = null) + protected function getItems($structClass, $infoTag, $field = null, $value = null, callable $filter = null) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { @@ -83,7 +83,7 @@ protected function _getItems($structClass, $infoTag, $field = null, $value = nul $getTag->addChild('dataset')->addChild($infoTag); - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { diff --git a/src/Api/Operator/Certificate.php b/src/Api/Operator/Certificate.php index 9113e148..cb7dacb3 100644 --- a/src/Api/Operator/Certificate.php +++ b/src/Api/Operator/Certificate.php @@ -14,14 +14,14 @@ class Certificate extends \PleskX\Api\Operator */ public function generate($properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('generate')->addChild('info'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('generate')->addChild('info'); foreach ($properties as $name => $value) { $info->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index 05bea9d9..be58f919 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -14,14 +14,14 @@ class Customer extends \PleskX\Api\Operator */ public function create($properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add')->addChild('gen_info'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add')->addChild('gen_info'); foreach ($properties as $name => $value) { $info->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -34,7 +34,7 @@ public function create($properties) */ public function delete($field, $value) { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -45,7 +45,7 @@ public function delete($field, $value) */ public function get($field, $value) { - $items = $this->_getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); + $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); return reset($items); } @@ -55,7 +55,7 @@ public function get($field, $value) */ public function getAll() { - return $this->_getItems(Struct\GeneralInfo::class, 'gen_info'); + return $this->getItems(Struct\GeneralInfo::class, 'gen_info'); } /** @@ -89,15 +89,15 @@ public function disable(string $field, $value): bool */ public function setProperties(string $field, $value, array $properties): bool { - $packet = $this->_client->getPacket(); - $setTag = $packet->addChild($this->_wrapperTag)->addChild('set'); + $packet = $this->client->getPacket(); + $setTag = $packet->addChild($this->wrapperTag)->addChild('set'); $setTag->addChild('filter')->addChild($field, (string) $value); $genInfoTag = $setTag->addChild('values')->addChild('gen_info'); foreach ($properties as $property => $propertyValue) { $genInfoTag->addChild($property, (string) $propertyValue); } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return 'ok' === (string) $response->status; } diff --git a/src/Api/Operator/Database.php b/src/Api/Operator/Database.php index 048841b8..dd5ddc6e 100644 --- a/src/Api/Operator/Database.php +++ b/src/Api/Operator/Database.php @@ -14,7 +14,7 @@ class Database extends \PleskX\Api\Operator */ public function create($properties) { - return new Struct\Info($this->_process('add-db', $properties)); + return new Struct\Info($this->process('add-db', $properties)); } /** @@ -24,7 +24,7 @@ public function create($properties) */ public function createUser($properties) { - return new Struct\UserInfo($this->_process('add-db-user', $properties)); + return new Struct\UserInfo($this->process('add-db-user', $properties)); } /** @@ -33,10 +33,10 @@ public function createUser($properties) * * @return \PleskX\Api\XmlResponse */ - private function _process($command, array $properties) + private function process($command, array $properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild($command); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild($command); foreach ($properties as $name => $value) { if (false !== strpos($value, '&')) { @@ -46,7 +46,7 @@ private function _process($command, array $properties) $info->{$name} = $value; } - return $this->_client->request($packet); + return $this->client->request($packet); } /** @@ -56,7 +56,7 @@ private function _process($command, array $properties) */ public function updateUser(array $properties) { - $response = $this->_process('set-db-user', $properties); + $response = $this->process('set-db-user', $properties); return 'ok' === (string) $response->status; } @@ -95,7 +95,7 @@ public function getUser($field, $value) */ public function getAll($field, $value) { - $response = $this->_get('get-db', $field, $value); + $response = $this->getBy('get-db', $field, $value); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $items[] = new Struct\Info($xmlResult); @@ -112,7 +112,7 @@ public function getAll($field, $value) */ public function getAllUsers($field, $value) { - $response = $this->_get('get-db-users', $field, $value); + $response = $this->getBy('get-db-users', $field, $value); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $items[] = new Struct\UserInfo($xmlResult); @@ -128,15 +128,15 @@ public function getAllUsers($field, $value) * * @return \PleskX\Api\XmlResponse */ - private function _get(string $command, string $field, $value) + private function getBy(string $command, string $field, $value) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild($command); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild($command); $filterTag = $getTag->addChild('filter'); $filterTag->{$field} = (string) $value; - return $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + return $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); } /** @@ -147,7 +147,7 @@ private function _get(string $command, string $field, $value) */ public function delete($field, $value) { - return $this->_delete($field, $value, 'del-db'); + return $this->deleteBy($field, $value, 'del-db'); } /** @@ -158,6 +158,6 @@ public function delete($field, $value) */ public function deleteUser($field, $value) { - return $this->_delete($field, $value, 'del-db-user'); + return $this->deleteBy($field, $value, 'del-db-user'); } } diff --git a/src/Api/Operator/DatabaseServer.php b/src/Api/Operator/DatabaseServer.php index 18cfbfa1..09c7f6ce 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -7,7 +7,7 @@ class DatabaseServer extends \PleskX\Api\Operator { - protected string $_wrapperTag = 'db_server'; + protected string $wrapperTag = 'db_server'; /** * @return array @@ -27,7 +27,7 @@ public function getSupportedTypes() */ public function get(string $field, $value) { - $items = $this->_get($field, $value); + $items = $this->getBy($field, $value); return reset($items); } @@ -37,7 +37,7 @@ public function get(string $field, $value) */ public function getAll() { - return $this->_get(); + return $this->getBy(); } /** @@ -46,17 +46,17 @@ public function getAll() * * @return Struct\Info[] */ - private function _get($field = null, $value = null) + private function getBy($field = null, $value = null) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { $filterTag->{$field} = (string) $value; } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { diff --git a/src/Api/Operator/Dns.php b/src/Api/Operator/Dns.php index c57ffef4..6a193dc6 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -14,14 +14,14 @@ class Dns extends \PleskX\Api\Operator */ public function create($properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add_rec'); foreach ($properties as $name => $value) { $info->{$name} = $value; } - return new Struct\Info($this->_client->request($packet)); + return new Struct\Info($this->client->request($packet)); } /** @@ -33,17 +33,17 @@ public function create($properties) */ public function bulkCreate(array $records): array { - $packet = $this->_client->getPacket(); + $packet = $this->client->getPacket(); foreach ($records as $properties) { - $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec'); + $info = $packet->addChild($this->wrapperTag)->addChild('add_rec'); foreach ($properties as $name => $value) { $info->{$name} = $value; } } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $items[] = $xmlResult; @@ -73,13 +73,13 @@ public function get(string $field, $value) */ public function getAll(string $field, $value): array { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_rec'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get_rec'); $filterTag = $getTag->addChild('filter'); $filterTag->addChild($field, (string) $value); - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $item = new Struct\Info($xmlResult->data); @@ -98,7 +98,7 @@ public function getAll(string $field, $value): array */ public function delete(string $field, $value): bool { - return $this->_delete($field, $value, 'del_rec'); + return $this->deleteBy($field, $value, 'del_rec'); } /** @@ -110,14 +110,14 @@ public function delete(string $field, $value): bool */ public function bulkDelete(array $recordIds): array { - $packet = $this->_client->getPacket(); + $packet = $this->client->getPacket(); foreach ($recordIds as $recordId) { - $packet->addChild($this->_wrapperTag)->addChild('del_rec') + $packet->addChild($this->wrapperTag)->addChild('del_rec') ->addChild('filter')->addChild('id', $recordId); } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $items[] = $xmlResult; diff --git a/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index 2e76ab9c..a20f4e57 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -7,7 +7,7 @@ class DnsTemplate extends \PleskX\Api\Operator { - protected string $_wrapperTag = 'dns'; + protected string $wrapperTag = 'dns'; /** * @param array $properties @@ -16,15 +16,15 @@ class DnsTemplate extends \PleskX\Api\Operator */ public function create(array $properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add_rec'); unset($properties['site-id'], $properties['site-alias-id']); foreach ($properties as $name => $value) { $info->{$name} = $value; } - return new Struct\Info($this->_client->request($packet)); + return new Struct\Info($this->client->request($packet)); } /** @@ -48,8 +48,8 @@ public function get($field, $value) */ public function getAll($field = null, $value = null): array { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_rec'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get_rec'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { @@ -57,7 +57,7 @@ public function getAll($field = null, $value = null): array } $getTag->addChild('template'); - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $item = new Struct\Info($xmlResult->data); @@ -76,12 +76,12 @@ public function getAll($field = null, $value = null): array */ public function delete(string $field, $value): bool { - $packet = $this->_client->getPacket(); - $delTag = $packet->addChild($this->_wrapperTag)->addChild('del_rec'); + $packet = $this->client->getPacket(); + $delTag = $packet->addChild($this->wrapperTag)->addChild('del_rec'); $delTag->addChild('filter')->addChild($field, (string) $value); $delTag->addChild('template'); - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return 'ok' === (string) $response->status; } diff --git a/src/Api/Operator/EventLog.php b/src/Api/Operator/EventLog.php index ae319bab..823a97fe 100644 --- a/src/Api/Operator/EventLog.php +++ b/src/Api/Operator/EventLog.php @@ -7,7 +7,7 @@ class EventLog extends \PleskX\Api\Operator { - protected string $_wrapperTag = 'event_log'; + protected string $wrapperTag = 'event_log'; /** * @return Struct\Event[] diff --git a/src/Api/Operator/Ip.php b/src/Api/Operator/Ip.php index 4bc87f77..9e500a54 100644 --- a/src/Api/Operator/Ip.php +++ b/src/Api/Operator/Ip.php @@ -13,9 +13,9 @@ class Ip extends \PleskX\Api\Operator public function get() { $ips = []; - $packet = $this->_client->getPacket(); - $packet->addChild($this->_wrapperTag)->addChild('get'); - $response = $this->_client->request($packet); + $packet = $this->client->getPacket(); + $packet->addChild($this->wrapperTag)->addChild('get'); + $response = $this->client->request($packet); foreach ($response->addresses->ip_info as $ipInfo) { $ips[] = new Struct\Info($ipInfo); diff --git a/src/Api/Operator/Locale.php b/src/Api/Operator/Locale.php index 89991052..efe45e1e 100644 --- a/src/Api/Operator/Locale.php +++ b/src/Api/Operator/Locale.php @@ -15,14 +15,14 @@ class Locale extends \PleskX\Api\Operator public function get($id = null) { $locales = []; - $packet = $this->_client->getPacket(); - $filter = $packet->addChild($this->_wrapperTag)->addChild('get')->addChild('filter'); + $packet = $this->client->getPacket(); + $filter = $packet->addChild($this->wrapperTag)->addChild('get')->addChild('filter'); if (!is_null($id)) { $filter->addChild('id', $id); } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); foreach ($response->locale->get->result as $localeInfo) { $locales[(string) $localeInfo->info->id] = new Struct\Info($localeInfo->info); diff --git a/src/Api/Operator/Mail.php b/src/Api/Operator/Mail.php index da5a630d..5986a8b8 100644 --- a/src/Api/Operator/Mail.php +++ b/src/Api/Operator/Mail.php @@ -19,8 +19,8 @@ class Mail extends Operator */ public function create($name, $siteId, $mailbox = false, $password = '') { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('create'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('create'); $filter = $info->addChild('filter'); $filter->addChild('site-id', (string) $siteId); @@ -33,7 +33,7 @@ public function create($name, $siteId, $mailbox = false, $password = '') $mailname->addChild('password')->value = $password; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response->mailname); } @@ -47,13 +47,13 @@ public function create($name, $siteId, $mailbox = false, $password = '') */ public function delete(string $field, $value, $siteId): bool { - $packet = $this->_client->getPacket(); - $filter = $packet->addChild($this->_wrapperTag)->addChild('remove')->addChild('filter'); + $packet = $this->client->getPacket(); + $filter = $packet->addChild($this->wrapperTag)->addChild('remove')->addChild('filter'); $filter->addChild('site-id', (string) $siteId); $filter->{$field} = (string) $value; - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return 'ok' === (string) $response->status; } @@ -79,8 +79,8 @@ public function get($name, $siteId) */ public function getAll($siteId, $name = null) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_info'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get_info'); $filterTag = $getTag->addChild('filter'); $filterTag->addChild('site-id', (string) $siteId); @@ -88,7 +88,7 @@ public function getAll($siteId, $name = null) $filterTag->addChild('name', $name); } - $response = $this->_client->request($packet, Client::RESPONSE_FULL); + $response = $this->client->request($packet, Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { if (!isset($xmlResult->mailname)) { diff --git a/src/Api/Operator/PhpHandler.php b/src/Api/Operator/PhpHandler.php index ad7f838d..1f54a689 100644 --- a/src/Api/Operator/PhpHandler.php +++ b/src/Api/Operator/PhpHandler.php @@ -17,15 +17,15 @@ class PhpHandler extends Operator */ public function get($field = null, $value = null): Info { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { $filterTag->addChild($field, (string) $value); } - $response = $this->_client->request($packet, Client::RESPONSE_FULL); + $response = $this->client->request($packet, Client::RESPONSE_FULL); $xmlResult = $response->xpath('//result')[0]; return new Info($xmlResult); @@ -39,15 +39,15 @@ public function get($field = null, $value = null): Info */ public function getAll($field = null, $value = null): array { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { $filterTag->addChild($field, (string) $value); } - $response = $this->_client->request($packet, Client::RESPONSE_FULL); + $response = $this->client->request($packet, Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $item = new Info($xmlResult); diff --git a/src/Api/Operator/ProtectedDirectory.php b/src/Api/Operator/ProtectedDirectory.php index 29756d3a..529b7e3e 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -9,7 +9,7 @@ class ProtectedDirectory extends Operator { - protected string $_wrapperTag = 'protected-dir'; + protected string $wrapperTag = 'protected-dir'; /** * @param string $name @@ -20,14 +20,14 @@ class ProtectedDirectory extends Operator */ public function add($name, $siteId, $header = '') { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add'); $info->addChild('site-id', (string) $siteId); $info->addChild('name', $name); $info->addChild('header', $header); - return new Struct\Info($this->_client->request($packet)); + return new Struct\Info($this->client->request($packet)); } /** @@ -38,7 +38,7 @@ public function add($name, $siteId, $header = '') */ public function delete($field, $value) { - return $this->_delete($field, $value, 'delete'); + return $this->deleteBy($field, $value, 'delete'); } /** @@ -62,7 +62,7 @@ public function get(string $field, $value) */ public function getAll(string $field, $value): array { - $response = $this->_get('get', $field, $value); + $response = $this->getBy('get', $field, $value); $items = []; foreach ($response->xpath('//result/data') as $xmlResult) { $items[] = new Struct\DataInfo($xmlResult); @@ -80,14 +80,14 @@ public function getAll(string $field, $value): array */ public function addUser($protectedDirectory, $login, $password) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add-user'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add-user'); $info->{'pd-id'} = (string) $protectedDirectory->id; $info->login = $login; $info->password = $password; - return new Struct\UserInfo($this->_client->request($packet)); + return new Struct\UserInfo($this->client->request($packet)); } /** @@ -98,7 +98,7 @@ public function addUser($protectedDirectory, $login, $password) */ public function deleteUser($field, $value) { - return $this->_delete($field, $value, 'delete-user'); + return $this->deleteBy($field, $value, 'delete-user'); } /** @@ -108,14 +108,14 @@ public function deleteUser($field, $value) * * @return \PleskX\Api\XmlResponse */ - private function _get(string $command, string $field, $value) + private function getBy(string $command, string $field, $value) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild($command); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild($command); $filterTag = $getTag->addChild('filter'); $filterTag->{$field} = (string) $value; - return $this->_client->request($packet, Client::RESPONSE_FULL); + return $this->client->request($packet, Client::RESPONSE_FULL); } } diff --git a/src/Api/Operator/Reseller.php b/src/Api/Operator/Reseller.php index f29391ff..729721ee 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -14,14 +14,14 @@ class Reseller extends \PleskX\Api\Operator */ public function create($properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add')->addChild('gen-info'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add')->addChild('gen-info'); foreach ($properties as $name => $value) { $info->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -34,7 +34,7 @@ public function create($properties) */ public function delete($field, $value) { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -58,8 +58,8 @@ public function get($field, $value) */ public function getAll($field = null, $value = null) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { @@ -70,7 +70,7 @@ public function getAll($field = null, $value = null) $datasetTag->addChild('gen-info'); $datasetTag->addChild('permissions'); - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index a5f0ee2c..bd41db07 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -7,7 +7,7 @@ class SecretKey extends \PleskX\Api\Operator { - protected string $_wrapperTag = 'secret_key'; + protected string $wrapperTag = 'secret_key'; /** * @param string $ipAddress @@ -17,8 +17,8 @@ class SecretKey extends \PleskX\Api\Operator */ public function create($ipAddress = '', $description = '') { - $packet = $this->_client->getPacket(); - $createTag = $packet->addChild($this->_wrapperTag)->addChild('create'); + $packet = $this->client->getPacket(); + $createTag = $packet->addChild($this->wrapperTag)->addChild('create'); if ('' !== $ipAddress) { $createTag->addChild('ip_address', $ipAddress); @@ -28,7 +28,7 @@ public function create($ipAddress = '', $description = '') $createTag->addChild('description', $description); } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return (string) $response->key; } @@ -40,7 +40,7 @@ public function create($ipAddress = '', $description = '') */ public function delete($keyId) { - return $this->_delete('key', $keyId, 'delete'); + return $this->deleteBy('key', $keyId, 'delete'); } /** @@ -50,7 +50,7 @@ public function delete($keyId) */ public function get($keyId) { - $items = $this->_get($keyId); + $items = $this->getBy($keyId); return reset($items); } @@ -60,7 +60,7 @@ public function get($keyId) */ public function getAll() { - return $this->_get(); + return $this->getBy(); } /** @@ -68,17 +68,17 @@ public function getAll() * * @return Struct\Info[] */ - public function _get($keyId = null) + public function getBy($keyId = null) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get_info'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get_info'); $filterTag = $getTag->addChild('filter'); if (!is_null($keyId)) { $filterTag->addChild('key', $keyId); } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result/key_info') as $keyInfo) { diff --git a/src/Api/Operator/Server.php b/src/Api/Operator/Server.php index 38342b7a..a5d79968 100644 --- a/src/Api/Operator/Server.php +++ b/src/Api/Operator/Server.php @@ -10,32 +10,32 @@ class Server extends \PleskX\Api\Operator { public function getProtos(): array { - $packet = $this->_client->getPacket(); - $packet->addChild($this->_wrapperTag)->addChild('get_protos'); - $response = $this->_client->request($packet); + $packet = $this->client->getPacket(); + $packet->addChild($this->wrapperTag)->addChild('get_protos'); + $response = $this->client->request($packet); return (array) $response->protos->proto; } public function getGeneralInfo(): Struct\GeneralInfo { - return new Struct\GeneralInfo($this->_getInfo('gen_info')); + return new Struct\GeneralInfo($this->getInfo('gen_info')); } public function getPreferences(): Struct\Preferences { - return new Struct\Preferences($this->_getInfo('prefs')); + return new Struct\Preferences($this->getInfo('prefs')); } public function getAdmin(): Struct\Admin { - return new Struct\Admin($this->_getInfo('admin')); + return new Struct\Admin($this->getInfo('admin')); } public function getKeyInfo(): array { $keyInfo = []; - $keyInfoXml = $this->_getInfo('key'); + $keyInfoXml = $this->getInfo('key'); foreach ($keyInfoXml->property as $property) { $keyInfo[(string) $property->name] = (string) $property->value; @@ -47,7 +47,7 @@ public function getKeyInfo(): array public function getComponents(): array { $components = []; - $componentsXml = $this->_getInfo('components'); + $componentsXml = $this->getInfo('components'); foreach ($componentsXml->component as $component) { $components[(string) $component->name] = (string) $component->version; @@ -59,7 +59,7 @@ public function getComponents(): array public function getServiceStates(): array { $states = []; - $statesXml = $this->_getInfo('services_state'); + $statesXml = $this->getInfo('services_state'); foreach ($statesXml->srv as $service) { $states[(string) $service->id] = [ @@ -74,13 +74,13 @@ public function getServiceStates(): array public function getSessionPreferences(): Struct\SessionPreferences { - return new Struct\SessionPreferences($this->_getInfo('session_setup')); + return new Struct\SessionPreferences($this->getInfo('session_setup')); } public function getShells(): array { $shells = []; - $shellsXml = $this->_getInfo('shells'); + $shellsXml = $this->getInfo('shells'); foreach ($shellsXml->shell as $shell) { $shells[(string) $shell->name] = (string) $shell->path; @@ -91,20 +91,20 @@ public function getShells(): array public function getNetworkInterfaces(): array { - $interfacesXml = $this->_getInfo('interfaces'); + $interfacesXml = $this->getInfo('interfaces'); return (array) $interfacesXml->interface; } public function getStatistics(): Struct\Statistics { - return new Struct\Statistics($this->_getInfo('stat')); + return new Struct\Statistics($this->getInfo('stat')); } public function getSiteIsolationConfig(): array { $config = []; - $configXml = $this->_getInfo('site-isolation-config'); + $configXml = $this->getInfo('site-isolation-config'); foreach ($configXml->property as $property) { $config[(string) $property->name] = (string) $property->value; @@ -115,7 +115,7 @@ public function getSiteIsolationConfig(): array public function getUpdatesInfo(): Struct\UpdatesInfo { - return new Struct\UpdatesInfo($this->_getInfo('updates')); + return new Struct\UpdatesInfo($this->getInfo('updates')); } /** @@ -126,22 +126,22 @@ public function getUpdatesInfo(): Struct\UpdatesInfo */ public function createSession(string $login, string $clientIp): string { - $packet = $this->_client->getPacket(); - $sessionNode = $packet->addChild($this->_wrapperTag)->addChild('create_session'); + $packet = $this->client->getPacket(); + $sessionNode = $packet->addChild($this->wrapperTag)->addChild('create_session'); $sessionNode->addChild('login', $login); $dataNode = $sessionNode->addChild('data'); $dataNode->addChild('user_ip', base64_encode($clientIp)); $dataNode->addChild('source_server'); - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return (string) $response->id; } - private function _getInfo(string $operation): XmlResponse + private function getInfo(string $operation): XmlResponse { - $packet = $this->_client->getPacket(); - $packet->addChild($this->_wrapperTag)->addChild('get')->addChild($operation); - $response = $this->_client->request($packet); + $packet = $this->client->getPacket(); + $packet->addChild($this->wrapperTag)->addChild('get')->addChild($operation); + $response = $this->client->request($packet); return $response->$operation; } diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index d4c14899..3e38a3f7 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -27,7 +27,7 @@ public function create($properties) */ public function delete($field, $value) { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -38,7 +38,7 @@ public function delete($field, $value) */ public function get($field, $value) { - $items = $this->_get($field, $value); + $items = $this->getBy($field, $value); return reset($items); } @@ -48,7 +48,7 @@ public function get($field, $value) */ public function getAll() { - return $this->_get(); + return $this->getBy(); } /** @@ -57,17 +57,17 @@ public function getAll() * * @return Struct\Info[] */ - private function _get($field = null, $value = null) + private function getBy($field = null, $value = null) { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { $filterTag->addChild($field, (string) $value); } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { diff --git a/src/Api/Operator/Session.php b/src/Api/Operator/Session.php index 71d1cc36..cea02004 100644 --- a/src/Api/Operator/Session.php +++ b/src/Api/Operator/Session.php @@ -15,7 +15,7 @@ class Session extends \PleskX\Api\Operator */ public function create($username, $userIp) { - $packet = $this->_client->getPacket(); + $packet = $this->client->getPacket(); $creator = $packet->addChild('server')->addChild('create_session'); $creator->addChild('login', $username); @@ -24,7 +24,7 @@ public function create($username, $userIp) $loginData->addChild('user_ip', base64_encode($userIp)); $loginData->addChild('source_server', ''); - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return (string) $response->id; } diff --git a/src/Api/Operator/Site.php b/src/Api/Operator/Site.php index 4da17822..67e0a875 100644 --- a/src/Api/Operator/Site.php +++ b/src/Api/Operator/Site.php @@ -7,7 +7,7 @@ class Site extends \PleskX\Api\Operator { - const PROPERTIES_HOSTING = 'hosting'; + public const PROPERTIES_HOSTING = 'hosting'; /** * @param array $properties @@ -16,8 +16,8 @@ class Site extends \PleskX\Api\Operator */ public function create(array $properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add'); $infoGeneral = $info->addChild('gen_setup'); foreach ($properties as $name => $value) { @@ -37,7 +37,7 @@ public function create(array $properties) } } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -50,7 +50,7 @@ public function create(array $properties) */ public function delete($field, $value) { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -61,7 +61,7 @@ public function delete($field, $value) */ public function get($field, $value) { - $items = $this->_getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); + $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); return reset($items); } @@ -74,9 +74,15 @@ public function get($field, $value) */ public function getHosting($field, $value) { - $items = $this->_getItems(Struct\HostingInfo::class, 'hosting', $field, $value, function (\SimpleXMLElement $node) { - return isset($node->vrt_hst); - }); + $items = $this->getItems( + Struct\HostingInfo::class, + 'hosting', + $field, + $value, + function (\SimpleXMLElement $node) { + return isset($node->vrt_hst); + } + ); return empty($items) ? null : reset($items); } @@ -86,6 +92,6 @@ public function getHosting($field, $value) */ public function getAll() { - return $this->_getItems(Struct\GeneralInfo::class, 'gen_info'); + return $this->getItems(Struct\GeneralInfo::class, 'gen_info'); } } diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index 4c9e3900..34539b6d 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -15,8 +15,8 @@ class SiteAlias extends \PleskX\Api\Operator */ public function create(array $properties, array $preferences = []) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('create'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('create'); if (count($preferences) > 0) { $prefs = $info->addChild('pref'); @@ -29,7 +29,7 @@ public function create(array $properties, array $preferences = []) $info->addChild('site-id', $properties['site-id']); $info->addChild('name', $properties['name']); - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -42,7 +42,7 @@ public function create(array $properties, array $preferences = []) */ public function delete($field, $value) { - return $this->_delete($field, $value, 'delete'); + return $this->deleteBy($field, $value, 'delete'); } /** @@ -66,15 +66,15 @@ public function get($field, $value) */ public function getAll($field = null, $value = null): array { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { $filterTag->{$field} = (string) $value; } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $item = new Struct\GeneralInfo($xmlResult->info); diff --git a/src/Api/Operator/Subdomain.php b/src/Api/Operator/Subdomain.php index b748dcad..db88138e 100644 --- a/src/Api/Operator/Subdomain.php +++ b/src/Api/Operator/Subdomain.php @@ -14,8 +14,8 @@ class Subdomain extends \PleskX\Api\Operator */ public function create($properties) { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add'); foreach ($properties as $name => $value) { if (is_array($value)) { @@ -29,7 +29,7 @@ public function create($properties) $info->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -42,7 +42,7 @@ public function create($properties) */ public function delete($field, $value) { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -66,15 +66,15 @@ public function get($field, $value) */ public function getAll($field = null, $value = null): array { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { $filterTag->addChild($field, (string) $value); } - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { diff --git a/src/Api/Operator/Ui.php b/src/Api/Operator/Ui.php index 187fcd24..b14f84c9 100644 --- a/src/Api/Operator/Ui.php +++ b/src/Api/Operator/Ui.php @@ -25,8 +25,8 @@ public function getNavigation() */ public function createCustomButton($owner, $properties) { - $packet = $this->_client->getPacket(); - $buttonNode = $packet->addChild($this->_wrapperTag)->addChild('create-custombutton'); + $packet = $this->client->getPacket(); + $buttonNode = $packet->addChild($this->wrapperTag)->addChild('create-custombutton'); $buttonNode->addChild('owner')->addChild($owner); $propertiesNode = $buttonNode->addChild('properties'); @@ -34,7 +34,7 @@ public function createCustomButton($owner, $properties) $propertiesNode->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return (int) $response->id; } @@ -58,6 +58,6 @@ public function getCustomButton($id) */ public function deleteCustomButton($id) { - return $this->_delete('custombutton-id', $id, 'delete-custombutton'); + return $this->deleteBy('custombutton-id', $id, 'delete-custombutton'); } } diff --git a/src/Api/Operator/VirtualDirectory.php b/src/Api/Operator/VirtualDirectory.php index 0b86149b..504876a0 100644 --- a/src/Api/Operator/VirtualDirectory.php +++ b/src/Api/Operator/VirtualDirectory.php @@ -5,5 +5,5 @@ class VirtualDirectory extends \PleskX\Api\Operator { - protected string $_wrapperTag = 'virtdir'; + protected string $wrapperTag = 'virtdir'; } diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index 82267bf8..360ade89 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -37,13 +37,13 @@ public function getPhysicalHostingDescriptor(): Struct\PhysicalHostingDescriptor */ public function getPhpSettings(string $field, $value): Struct\PhpSettings { - $packet = $this->_client->getPacket(); - $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $getTag->addChild('filter')->addChild($field, (string) $value); $getTag->addChild('dataset')->addChild('php-settings'); - $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); return new Struct\PhpSettings($response); } @@ -56,7 +56,7 @@ public function getPhpSettings(string $field, $value): Struct\PhpSettings */ public function getLimits(string $field, $value): Struct\Limits { - $items = $this->_getItems(Struct\Limits::class, 'limits', $field, $value); + $items = $this->getItems(Struct\Limits::class, 'limits', $field, $value); return reset($items); } @@ -70,8 +70,8 @@ public function getLimits(string $field, $value): Struct\Limits */ public function create(array $properties, array $hostingProperties = null, string $planName = ''): Struct\Info { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add'); $infoGeneral = $info->addChild('gen_setup'); foreach ($properties as $name => $value) { @@ -95,7 +95,7 @@ public function create(array $properties, array $hostingProperties = null, strin $info->addChild('plan-name', $planName); } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response, $properties['name'] ?? ''); } @@ -108,7 +108,7 @@ public function create(array $properties, array $hostingProperties = null, strin */ public function delete(string $field, $value): bool { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -119,7 +119,7 @@ public function delete(string $field, $value): bool */ public function get(string $field, $value): Struct\GeneralInfo { - $items = $this->_getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); + $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); return reset($items); } @@ -129,7 +129,7 @@ public function get(string $field, $value): Struct\GeneralInfo */ public function getAll(): array { - return $this->_getItems(Struct\GeneralInfo::class, 'gen_info'); + return $this->getItems(Struct\GeneralInfo::class, 'gen_info'); } /** @@ -140,7 +140,7 @@ public function getAll(): array */ public function getDiskUsage(string $field, $value): Struct\DiskUsage { - $items = $this->_getItems(Struct\DiskUsage::class, 'disk_usage', $field, $value); + $items = $this->getItems(Struct\DiskUsage::class, 'disk_usage', $field, $value); return reset($items); } @@ -176,15 +176,15 @@ public function disable(string $field, $value): bool */ public function setProperties(string $field, $value, array $properties): bool { - $packet = $this->_client->getPacket(); - $setTag = $packet->addChild($this->_wrapperTag)->addChild('set'); + $packet = $this->client->getPacket(); + $setTag = $packet->addChild($this->wrapperTag)->addChild('set'); $setTag->addChild('filter')->addChild($field, (string) $value); $genInfoTag = $setTag->addChild('values')->addChild('gen_setup'); foreach ($properties as $property => $propertyValue) { $genInfoTag->addChild($property, (string) $propertyValue); } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return 'ok' === (string) $response->status; } diff --git a/src/Api/Struct/Certificate/Info.php b/src/Api/Struct/Certificate/Info.php index 467defac..b12b146a 100644 --- a/src/Api/Struct/Certificate/Info.php +++ b/src/Api/Struct/Certificate/Info.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Certificate; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public string $request; public string $privateKey; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['csr' => 'request'], ['pvt' => 'privateKey'], ]); diff --git a/src/Api/Struct/Customer/GeneralInfo.php b/src/Api/Struct/Customer/GeneralInfo.php index 9da9c6c2..32b7bf7b 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Customer; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class GeneralInfo extends Struct +class GeneralInfo extends AbstractStruct { public int $id; public string $company; @@ -26,7 +26,7 @@ class GeneralInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['cname' => 'company'], ['pname' => 'personalName'], 'login', diff --git a/src/Api/Struct/Customer/Info.php b/src/Api/Struct/Customer/Info.php index f9b4c514..1a220589 100644 --- a/src/Api/Struct/Customer/Info.php +++ b/src/Api/Struct/Customer/Info.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Customer; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $guid; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); diff --git a/src/Api/Struct/Database/Info.php b/src/Api/Struct/Database/Info.php index d706984b..4eb9a93e 100644 --- a/src/Api/Struct/Database/Info.php +++ b/src/Api/Struct/Database/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Database; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $name; @@ -16,7 +16,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'name', 'type', diff --git a/src/Api/Struct/Database/UserInfo.php b/src/Api/Struct/Database/UserInfo.php index 230f4f34..6419021b 100644 --- a/src/Api/Struct/Database/UserInfo.php +++ b/src/Api/Struct/Database/UserInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Database; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class UserInfo extends Struct +class UserInfo extends AbstractStruct { public int $id; public string $login; @@ -13,7 +13,7 @@ class UserInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'login', 'db-id', diff --git a/src/Api/Struct/DatabaseServer/Info.php b/src/Api/Struct/DatabaseServer/Info.php index 7db81f56..3793281a 100644 --- a/src/Api/Struct/DatabaseServer/Info.php +++ b/src/Api/Struct/DatabaseServer/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\DatabaseServer; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $host; @@ -14,7 +14,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'host', 'port', diff --git a/src/Api/Struct/Dns/Info.php b/src/Api/Struct/Dns/Info.php index c3a2e1e4..5558d61f 100644 --- a/src/Api/Struct/Dns/Info.php +++ b/src/Api/Struct/Dns/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Dns; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public int $siteId; @@ -17,7 +17,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'site-id', 'site-alias-id', diff --git a/src/Api/Struct/EventLog/DetailedEvent.php b/src/Api/Struct/EventLog/DetailedEvent.php index 1c35c713..621412ce 100644 --- a/src/Api/Struct/EventLog/DetailedEvent.php +++ b/src/Api/Struct/EventLog/DetailedEvent.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\EventLog; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class DetailedEvent extends Struct +class DetailedEvent extends AbstractStruct { public int $id; public string $type; @@ -17,7 +17,7 @@ class DetailedEvent extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'type', 'time', diff --git a/src/Api/Struct/EventLog/Event.php b/src/Api/Struct/EventLog/Event.php index 01e965d9..e179a324 100644 --- a/src/Api/Struct/EventLog/Event.php +++ b/src/Api/Struct/EventLog/Event.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\EventLog; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Event extends Struct +class Event extends AbstractStruct { public string $type; public int $time; @@ -14,7 +14,7 @@ class Event extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'type', 'time', 'class', diff --git a/src/Api/Struct/Ip/Info.php b/src/Api/Struct/Ip/Info.php index 41180166..7c7ea68e 100644 --- a/src/Api/Struct/Ip/Info.php +++ b/src/Api/Struct/Ip/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Ip; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public string $ipAddress; public string $netmask; @@ -14,7 +14,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'ip_address', 'netmask', 'type', diff --git a/src/Api/Struct/Locale/Info.php b/src/Api/Struct/Locale/Info.php index 2a7b9b6c..f0323ac9 100644 --- a/src/Api/Struct/Locale/Info.php +++ b/src/Api/Struct/Locale/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Locale; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public string $id; public string $language; @@ -13,7 +13,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', ['lang' => 'language'], 'country', diff --git a/src/Api/Struct/Mail/GeneralInfo.php b/src/Api/Struct/Mail/GeneralInfo.php index a29c4f8b..878e0b0a 100644 --- a/src/Api/Struct/Mail/GeneralInfo.php +++ b/src/Api/Struct/Mail/GeneralInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Mail; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class GeneralInfo extends Struct +class GeneralInfo extends AbstractStruct { public int $id; public string $name; @@ -13,7 +13,7 @@ class GeneralInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'name', 'description', diff --git a/src/Api/Struct/Mail/Info.php b/src/Api/Struct/Mail/Info.php index 13cb182d..58b22593 100644 --- a/src/Api/Struct/Mail/Info.php +++ b/src/Api/Struct/Mail/Info.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Mail; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $name; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'name', ]); diff --git a/src/Api/Struct/PhpHandler/Info.php b/src/Api/Struct/PhpHandler/Info.php index a98235af..fc0ba8f7 100644 --- a/src/Api/Struct/PhpHandler/Info.php +++ b/src/Api/Struct/PhpHandler/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\PhpHandler; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public string $id; public string $displayName; @@ -20,7 +20,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'display-name', 'full-version', diff --git a/src/Api/Struct/ProtectedDirectory/DataInfo.php b/src/Api/Struct/ProtectedDirectory/DataInfo.php index 673928f6..ec325630 100644 --- a/src/Api/Struct/ProtectedDirectory/DataInfo.php +++ b/src/Api/Struct/ProtectedDirectory/DataInfo.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\ProtectedDirectory; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class DataInfo extends Struct +class DataInfo extends AbstractStruct { public string $name; public string $header; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'name', 'header', ]); diff --git a/src/Api/Struct/ProtectedDirectory/Info.php b/src/Api/Struct/ProtectedDirectory/Info.php index 19b5952f..ddf2f9d1 100644 --- a/src/Api/Struct/ProtectedDirectory/Info.php +++ b/src/Api/Struct/ProtectedDirectory/Info.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\ProtectedDirectory; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', ]); } diff --git a/src/Api/Struct/ProtectedDirectory/UserInfo.php b/src/Api/Struct/ProtectedDirectory/UserInfo.php index 0d0cc7eb..1f6a5106 100644 --- a/src/Api/Struct/ProtectedDirectory/UserInfo.php +++ b/src/Api/Struct/ProtectedDirectory/UserInfo.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\ProtectedDirectory; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class UserInfo extends Struct +class UserInfo extends AbstractStruct { public int $id; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', ]); } diff --git a/src/Api/Struct/Reseller/GeneralInfo.php b/src/Api/Struct/Reseller/GeneralInfo.php index 39757165..804dd372 100644 --- a/src/Api/Struct/Reseller/GeneralInfo.php +++ b/src/Api/Struct/Reseller/GeneralInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Reseller; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class GeneralInfo extends Struct +class GeneralInfo extends AbstractStruct { public int $id; public string $personalName; @@ -14,7 +14,7 @@ class GeneralInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse->{'gen-info'}, [ + $this->initScalarProperties($apiResponse->{'gen-info'}, [ ['pname' => 'personalName'], 'login', ]); diff --git a/src/Api/Struct/Reseller/Info.php b/src/Api/Struct/Reseller/Info.php index f257b3e3..f196294d 100644 --- a/src/Api/Struct/Reseller/Info.php +++ b/src/Api/Struct/Reseller/Info.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Reseller; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $guid; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); diff --git a/src/Api/Struct/SecretKey/Info.php b/src/Api/Struct/SecretKey/Info.php index bbebd82e..32686499 100644 --- a/src/Api/Struct/SecretKey/Info.php +++ b/src/Api/Struct/SecretKey/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\SecretKey; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public string $key; public string $ipAddress; @@ -14,7 +14,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'key', 'ip_address', 'description', diff --git a/src/Api/Struct/Server/Admin.php b/src/Api/Struct/Server/Admin.php index 4f08c399..7066ce53 100644 --- a/src/Api/Struct/Server/Admin.php +++ b/src/Api/Struct/Server/Admin.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Admin extends Struct +class Admin extends AbstractStruct { public string $companyName; public string $name; @@ -13,7 +13,7 @@ class Admin extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['admin_cname' => 'companyName'], ['admin_pname' => 'name'], ['admin_email' => 'email'], diff --git a/src/Api/Struct/Server/GeneralInfo.php b/src/Api/Struct/Server/GeneralInfo.php index 2b28ab2d..73c7a724 100644 --- a/src/Api/Struct/Server/GeneralInfo.php +++ b/src/Api/Struct/Server/GeneralInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class GeneralInfo extends Struct +class GeneralInfo extends AbstractStruct { public string $serverName; public string $serverGuid; @@ -13,7 +13,7 @@ class GeneralInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'server_name', 'server_guid', 'mode', diff --git a/src/Api/Struct/Server/Preferences.php b/src/Api/Struct/Server/Preferences.php index 0f533c85..de2b362f 100644 --- a/src/Api/Struct/Server/Preferences.php +++ b/src/Api/Struct/Server/Preferences.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Preferences extends Struct +class Preferences extends AbstractStruct { public int $statTtl; public int $trafficAccounting; @@ -13,7 +13,7 @@ class Preferences extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'stat_ttl', 'traffic_accounting', 'restart_apache_interval', diff --git a/src/Api/Struct/Server/SessionPreferences.php b/src/Api/Struct/Server/SessionPreferences.php index 2feed452..bf363bde 100644 --- a/src/Api/Struct/Server/SessionPreferences.php +++ b/src/Api/Struct/Server/SessionPreferences.php @@ -3,15 +3,15 @@ namespace PleskX\Api\Struct\Server; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class SessionPreferences extends Struct +class SessionPreferences extends AbstractStruct { public int $loginTimeout; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'login_timeout', ]); } diff --git a/src/Api/Struct/Server/Statistics.php b/src/Api/Struct/Server/Statistics.php index aed4dd1f..65a5ee88 100644 --- a/src/Api/Struct/Server/Statistics.php +++ b/src/Api/Struct/Server/Statistics.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Statistics extends Struct +class Statistics extends AbstractStruct { /** @var Statistics\Objects */ public $objects; diff --git a/src/Api/Struct/Server/Statistics/DiskSpace.php b/src/Api/Struct/Server/Statistics/DiskSpace.php index 95ff3f1f..35528474 100644 --- a/src/Api/Struct/Server/Statistics/DiskSpace.php +++ b/src/Api/Struct/Server/Statistics/DiskSpace.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server\Statistics; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class DiskSpace extends Struct +class DiskSpace extends AbstractStruct { public int $total; public int $used; @@ -13,7 +13,7 @@ class DiskSpace extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'total', 'used', 'free', diff --git a/src/Api/Struct/Server/Statistics/LoadAverage.php b/src/Api/Struct/Server/Statistics/LoadAverage.php index 005a0f32..8c733233 100644 --- a/src/Api/Struct/Server/Statistics/LoadAverage.php +++ b/src/Api/Struct/Server/Statistics/LoadAverage.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server\Statistics; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class LoadAverage extends Struct +class LoadAverage extends AbstractStruct { public float $load1min; public float $load5min; diff --git a/src/Api/Struct/Server/Statistics/Memory.php b/src/Api/Struct/Server/Statistics/Memory.php index a42b66c9..48afaf58 100644 --- a/src/Api/Struct/Server/Statistics/Memory.php +++ b/src/Api/Struct/Server/Statistics/Memory.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server\Statistics; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Memory extends Struct +class Memory extends AbstractStruct { public int $total; public int $used; @@ -16,7 +16,7 @@ class Memory extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'total', 'used', 'free', diff --git a/src/Api/Struct/Server/Statistics/Objects.php b/src/Api/Struct/Server/Statistics/Objects.php index 4c128960..a6877666 100644 --- a/src/Api/Struct/Server/Statistics/Objects.php +++ b/src/Api/Struct/Server/Statistics/Objects.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server\Statistics; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Objects extends Struct +class Objects extends AbstractStruct { public int $clients; public int $domains; @@ -21,7 +21,7 @@ class Objects extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'clients', 'domains', 'databases', diff --git a/src/Api/Struct/Server/Statistics/Other.php b/src/Api/Struct/Server/Statistics/Other.php index d65c4316..3230a7f1 100644 --- a/src/Api/Struct/Server/Statistics/Other.php +++ b/src/Api/Struct/Server/Statistics/Other.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server\Statistics; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Other extends Struct +class Other extends AbstractStruct { public string $cpu; public int $uptime; @@ -13,7 +13,7 @@ class Other extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'cpu', 'uptime', ['inside_vz' => 'insideVz'], diff --git a/src/Api/Struct/Server/Statistics/Swap.php b/src/Api/Struct/Server/Statistics/Swap.php index b61a4ad9..ee1acdf9 100644 --- a/src/Api/Struct/Server/Statistics/Swap.php +++ b/src/Api/Struct/Server/Statistics/Swap.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server\Statistics; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Swap extends Struct +class Swap extends AbstractStruct { public int $total; public int $used; @@ -13,7 +13,7 @@ class Swap extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'total', 'used', 'free', diff --git a/src/Api/Struct/Server/Statistics/Version.php b/src/Api/Struct/Server/Statistics/Version.php index b3684ab3..d3f84f5b 100644 --- a/src/Api/Struct/Server/Statistics/Version.php +++ b/src/Api/Struct/Server/Statistics/Version.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Server\Statistics; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Version extends Struct +class Version extends AbstractStruct { public string $internalName; public string $version; @@ -16,7 +16,7 @@ class Version extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['plesk_name' => 'internalName'], ['plesk_version' => 'version'], ['plesk_build' => 'build'], diff --git a/src/Api/Struct/Server/UpdatesInfo.php b/src/Api/Struct/Server/UpdatesInfo.php index 3a75d7b5..57eea6c8 100644 --- a/src/Api/Struct/Server/UpdatesInfo.php +++ b/src/Api/Struct/Server/UpdatesInfo.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Server; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class UpdatesInfo extends Struct +class UpdatesInfo extends AbstractStruct { public string $lastInstalledUpdate; public bool $installUpdatesAutomatically; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'last_installed_update', 'install_updates_automatically', ]); diff --git a/src/Api/Struct/ServicePlan/Info.php b/src/Api/Struct/ServicePlan/Info.php index 8d1a3c12..8b3fbf9d 100644 --- a/src/Api/Struct/ServicePlan/Info.php +++ b/src/Api/Struct/ServicePlan/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\ServicePlan; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $name; @@ -14,7 +14,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'name', 'guid', diff --git a/src/Api/Struct/Session/Info.php b/src/Api/Struct/Session/Info.php index e2060347..2ab3f401 100644 --- a/src/Api/Struct/Session/Info.php +++ b/src/Api/Struct/Session/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Session; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public string $id; public string $type; @@ -16,7 +16,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'type', 'ip-address', diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index 1bc0c9a5..28e72f77 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Site; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class GeneralInfo extends Struct +class GeneralInfo extends AbstractStruct { public int $id; public string $creationDate; @@ -21,7 +21,7 @@ class GeneralInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['cr_date' => 'creationDate'], 'name', 'ascii-name', diff --git a/src/Api/Struct/Site/HostingInfo.php b/src/Api/Struct/Site/HostingInfo.php index 34a307f3..cab0fe0e 100644 --- a/src/Api/Struct/Site/HostingInfo.php +++ b/src/Api/Struct/Site/HostingInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Site; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class HostingInfo extends Struct +class HostingInfo extends AbstractStruct { public array $properties = []; public string $ipAddress; @@ -15,7 +15,7 @@ public function __construct(\SimpleXMLElement $apiResponse) foreach ($apiResponse->vrt_hst->property as $property) { $this->properties[(string) $property->name] = (string) $property->value; } - $this->_initScalarProperties($apiResponse->vrt_hst, [ + $this->initScalarProperties($apiResponse->vrt_hst, [ 'ip_address', ]); } diff --git a/src/Api/Struct/Site/Info.php b/src/Api/Struct/Site/Info.php index 99b57fe8..0c2b6376 100644 --- a/src/Api/Struct/Site/Info.php +++ b/src/Api/Struct/Site/Info.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Site; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $guid; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); diff --git a/src/Api/Struct/SiteAlias/GeneralInfo.php b/src/Api/Struct/SiteAlias/GeneralInfo.php index 0b77651b..b2581c6c 100644 --- a/src/Api/Struct/SiteAlias/GeneralInfo.php +++ b/src/Api/Struct/SiteAlias/GeneralInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\SiteAlias; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class GeneralInfo extends Struct +class GeneralInfo extends AbstractStruct { public string $name; public string $asciiName; @@ -13,7 +13,7 @@ class GeneralInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'name', 'ascii-name', 'status', diff --git a/src/Api/Struct/SiteAlias/Info.php b/src/Api/Struct/SiteAlias/Info.php index a452ba96..646e155b 100644 --- a/src/Api/Struct/SiteAlias/Info.php +++ b/src/Api/Struct/SiteAlias/Info.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\SiteAlias; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public string $status; public int $id; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'status', ]); diff --git a/src/Api/Struct/Subdomain/Info.php b/src/Api/Struct/Subdomain/Info.php index 7c760433..43e0595a 100644 --- a/src/Api/Struct/Subdomain/Info.php +++ b/src/Api/Struct/Subdomain/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Subdomain; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $parent; @@ -15,7 +15,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse) { $this->properties = []; - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'parent', 'name', diff --git a/src/Api/Struct/Ui/CustomButton.php b/src/Api/Struct/Ui/CustomButton.php index ccac0b26..2a5edf3f 100644 --- a/src/Api/Struct/Ui/CustomButton.php +++ b/src/Api/Struct/Ui/CustomButton.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Ui; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class CustomButton extends Struct +class CustomButton extends AbstractStruct { public int $id; public int $sortKey; @@ -18,8 +18,8 @@ class CustomButton extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, ['id']); - $this->_initScalarProperties($apiResponse->properties, [ + $this->initScalarProperties($apiResponse, ['id']); + $this->initScalarProperties($apiResponse->properties, [ 'sort_key', 'public', 'internal', diff --git a/src/Api/Struct/Webspace/DiskUsage.php b/src/Api/Struct/Webspace/DiskUsage.php index 6369717c..23b2d489 100644 --- a/src/Api/Struct/Webspace/DiskUsage.php +++ b/src/Api/Struct/Webspace/DiskUsage.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class DiskUsage extends Struct +class DiskUsage extends AbstractStruct { public int $httpdocs; public int $httpsdocs; @@ -21,7 +21,7 @@ class DiskUsage extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'httpdocs', 'httpsdocs', 'subdomains', diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index 53ab423a..5a702758 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class GeneralInfo extends Struct +class GeneralInfo extends AbstractStruct { public int $id; public string $creationDate; @@ -23,7 +23,7 @@ class GeneralInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['cr_date' => 'creationDate'], 'name', 'ascii-name', diff --git a/src/Api/Struct/Webspace/HostingPropertyInfo.php b/src/Api/Struct/Webspace/HostingPropertyInfo.php index f761d36b..3e1d3082 100644 --- a/src/Api/Struct/Webspace/HostingPropertyInfo.php +++ b/src/Api/Struct/Webspace/HostingPropertyInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class HostingPropertyInfo extends Struct +class HostingPropertyInfo extends AbstractStruct { public string $name; public string $type; @@ -13,7 +13,7 @@ class HostingPropertyInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'name', 'type', 'label', diff --git a/src/Api/Struct/Webspace/Info.php b/src/Api/Struct/Webspace/Info.php index cb6e4c2c..4e928c5b 100644 --- a/src/Api/Struct/Webspace/Info.php +++ b/src/Api/Struct/Webspace/Info.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Info extends Struct +class Info extends AbstractStruct { public int $id; public string $guid; @@ -13,7 +13,7 @@ class Info extends Struct public function __construct(\SimpleXMLElement $apiResponse, string $name = '') { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); diff --git a/src/Api/Struct/Webspace/Limit.php b/src/Api/Struct/Webspace/Limit.php index 6d7b0a40..655ea850 100644 --- a/src/Api/Struct/Webspace/Limit.php +++ b/src/Api/Struct/Webspace/Limit.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Limit extends Struct +class Limit extends AbstractStruct { public string $name; public string $value; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'name', 'value', ]); diff --git a/src/Api/Struct/Webspace/LimitDescriptor.php b/src/Api/Struct/Webspace/LimitDescriptor.php index 0b4f7b7f..9526cbff 100644 --- a/src/Api/Struct/Webspace/LimitDescriptor.php +++ b/src/Api/Struct/Webspace/LimitDescriptor.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class LimitDescriptor extends Struct +class LimitDescriptor extends AbstractStruct { public array $limits; diff --git a/src/Api/Struct/Webspace/LimitInfo.php b/src/Api/Struct/Webspace/LimitInfo.php index e0ff03ae..162c2fc2 100644 --- a/src/Api/Struct/Webspace/LimitInfo.php +++ b/src/Api/Struct/Webspace/LimitInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class LimitInfo extends Struct +class LimitInfo extends AbstractStruct { public string $name; public string $type; @@ -13,7 +13,7 @@ class LimitInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'name', 'type', 'label', diff --git a/src/Api/Struct/Webspace/Limits.php b/src/Api/Struct/Webspace/Limits.php index 7a317c79..a8866f2f 100644 --- a/src/Api/Struct/Webspace/Limits.php +++ b/src/Api/Struct/Webspace/Limits.php @@ -3,16 +3,16 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class Limits extends Struct +class Limits extends AbstractStruct { public string $overuse; public array $limits; public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, ['overuse']); + $this->initScalarProperties($apiResponse, ['overuse']); $this->limits = []; foreach ($apiResponse->limit as $limit) { diff --git a/src/Api/Struct/Webspace/PermissionDescriptor.php b/src/Api/Struct/Webspace/PermissionDescriptor.php index 1f09931f..fea5f1e8 100644 --- a/src/Api/Struct/Webspace/PermissionDescriptor.php +++ b/src/Api/Struct/Webspace/PermissionDescriptor.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class PermissionDescriptor extends Struct +class PermissionDescriptor extends AbstractStruct { public array $permissions; diff --git a/src/Api/Struct/Webspace/PermissionInfo.php b/src/Api/Struct/Webspace/PermissionInfo.php index 7cdfc4a0..42e5dfbf 100644 --- a/src/Api/Struct/Webspace/PermissionInfo.php +++ b/src/Api/Struct/Webspace/PermissionInfo.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class PermissionInfo extends Struct +class PermissionInfo extends AbstractStruct { public string $name; public string $type; @@ -13,7 +13,7 @@ class PermissionInfo extends Struct public function __construct(\SimpleXMLElement $apiResponse) { - $this->_initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'name', 'type', 'label', diff --git a/src/Api/Struct/Webspace/PhpSettings.php b/src/Api/Struct/Webspace/PhpSettings.php index 8067571e..05a72810 100644 --- a/src/Api/Struct/Webspace/PhpSettings.php +++ b/src/Api/Struct/Webspace/PhpSettings.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class PhpSettings extends Struct +class PhpSettings extends AbstractStruct { public array $properties; diff --git a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php index 987b10ee..2331e48d 100644 --- a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php +++ b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php @@ -3,9 +3,9 @@ namespace PleskX\Api\Struct\Webspace; -use PleskX\Api\Struct; +use PleskX\Api\AbstractStruct; -class PhysicalHostingDescriptor extends Struct +class PhysicalHostingDescriptor extends AbstractStruct { public array $properties; diff --git a/src/Api/XmlResponse.php b/src/Api/XmlResponse.php index 687b6d8a..073116a4 100644 --- a/src/Api/XmlResponse.php +++ b/src/Api/XmlResponse.php @@ -17,6 +17,6 @@ class XmlResponse extends \SimpleXMLElement */ public function getValue($node) { - return (string) $this->xpath('//'.$node)[0]; + return (string) $this->xpath('//' . $node)[0]; } } diff --git a/tests/TestCase.php b/tests/AbstractTestCase.php similarity index 62% rename from tests/TestCase.php rename to tests/AbstractTestCase.php index 58670fa6..435ca224 100644 --- a/tests/TestCase.php +++ b/tests/AbstractTestCase.php @@ -5,10 +5,10 @@ use PleskXTest\Utility\PasswordProvider; -abstract class TestCase extends \PHPUnit\Framework\TestCase +abstract class AbstractTestCase extends \PHPUnit\Framework\TestCase { /** @var \PleskX\Api\Client */ - protected static $_client; + protected static $client; private static $webspaces = []; private static $servicePlans = []; @@ -21,16 +21,18 @@ public static function setUpBeforeClass(): void $port = 8443; $scheme = 'https'; - if ($url = getenv('REMOTE_URL')) { + $url = getenv('REMOTE_URL'); + if ($url) { $parsedUrl = parse_url($url); list($host, $port, $scheme) = [$parsedUrl['host'], $parsedUrl['port'], $parsedUrl['scheme']]; } - static::$_client = new \PleskX\Api\Client($host, $port, $scheme); - static::$_client->setCredentials($login, $password); + static::$client = new \PleskX\Api\Client($host, $port, $scheme); + static::$client->setCredentials($login, $password); - if ($proxy = getenv('REMOTE_PROXY')) { - static::$_client->setProxy($proxy); + $proxy = getenv('REMOTE_PROXY'); + if ($proxy) { + static::$client->setProxy($proxy); } } @@ -38,14 +40,16 @@ public static function tearDownAfterClass(): void { foreach (self::$webspaces as $webspace) { try { - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); + // phpcs:ignore } catch (\Exception $e) { } } foreach (self::$servicePlans as $servicePlan) { try { - static::$_client->servicePlan()->delete('id', $servicePlan->id); + static::$client->servicePlan()->delete('id', $servicePlan->id); + // phpcs:ignore } catch (\Exception $e) { } } @@ -54,9 +58,9 @@ public static function tearDownAfterClass(): void /** * @return string */ - protected static function _getIpAddress() + protected static function getIpAddress() { - $ips = static::$_client->ip()->get(); + $ips = static::$client->ip()->get(); $ipInfo = reset($ips); return $ipInfo->ipAddress; @@ -65,13 +69,13 @@ protected static function _getIpAddress() /** * @return \PleskX\Api\Struct\Webspace\Info */ - protected static function _createWebspace() + protected static function createWebspace() { $id = uniqid(); - $webspace = static::$_client->webspace()->create( + $webspace = static::$client->webspace()->create( [ 'name' => "test{$id}.test", - 'ip_address' => static::_getIpAddress(), + 'ip_address' => static::getIpAddress(), ], [ 'ftp_login' => "u{$id}", @@ -83,10 +87,10 @@ protected static function _createWebspace() return $webspace; } - protected static function _createServicePlan() + protected static function createServicePlan() { $id = uniqid(); - $servicePlan = static::$_client->servicePlan()->create(['name' => "test{$id}plan"]); + $servicePlan = static::$client->servicePlan()->create(['name' => "test{$id}plan"]); self::$servicePlans[] = $servicePlan; diff --git a/tests/ApiClientTest.php b/tests/ApiClientAbstractTest.php similarity index 74% rename from tests/ApiClientTest.php rename to tests/ApiClientAbstractTest.php index 41547416..e1943349 100644 --- a/tests/ApiClientTest.php +++ b/tests/ApiClientAbstractTest.php @@ -5,16 +5,16 @@ use PleskX\Api\Client\Exception; -class ApiClientTest extends TestCase +class ApiClientAbstractTest extends AbstractTestCase { public function testWrongProtocol() { $this->expectException(\PleskX\Api\Exception::class); $this->expectExceptionCode(1005); - $packet = static::$_client->getPacket('100.0.0'); + $packet = static::$client->getPacket('100.0.0'); $packet->addChild('server')->addChild('get_protos'); - static::$_client->request($packet); + static::$client->request($packet); } public function testUnknownOperator() @@ -22,9 +22,9 @@ public function testUnknownOperator() $this->expectException(\PleskX\Api\Exception::class); $this->expectExceptionCode(1014); - $packet = static::$_client->getPacket(); + $packet = static::$client->getPacket(); $packet->addChild('unknown'); - static::$_client->request($packet); + static::$client->request($packet); } public function testInvalidXmlRequest() @@ -32,7 +32,7 @@ public function testInvalidXmlRequest() $this->expectException(\PleskX\Api\Exception::class); $this->expectExceptionCode(1014); - static::$_client->request('<packet><wrongly formatted xml</packet>'); + static::$client->request('<packet><wrongly formatted xml</packet>'); } public function testInvalidCredentials() @@ -40,12 +40,12 @@ public function testInvalidCredentials() $this->expectException(\PleskX\Api\Exception::class); $this->expectExceptionCode(1001); - $host = static::$_client->getHost(); - $port = static::$_client->getPort(); - $protocol = static::$_client->getProtocol(); + $host = static::$client->getHost(); + $port = static::$client->getPort(); + $protocol = static::$client->getProtocol(); $client = new \PleskX\Api\Client($host, $port, $protocol); $client->setCredentials('bad-login', 'bad-password'); - $packet = static::$_client->getPacket(); + $packet = static::$client->getPacket(); $packet->addChild('server')->addChild('get_protos'); $client->request($packet); } @@ -55,48 +55,48 @@ public function testInvalidSecretKey() $this->expectException(\PleskX\Api\Exception::class); $this->expectExceptionCode(11003); - $host = static::$_client->getHost(); - $port = static::$_client->getPort(); - $protocol = static::$_client->getProtocol(); + $host = static::$client->getHost(); + $port = static::$client->getPort(); + $protocol = static::$client->getProtocol(); $client = new \PleskX\Api\Client($host, $port, $protocol); $client->setSecretKey('bad-key'); - $packet = static::$_client->getPacket(); + $packet = static::$client->getPacket(); $packet->addChild('server')->addChild('get_protos'); $client->request($packet); } public function testLatestMajorProtocol() { - $packet = static::$_client->getPacket('1.6'); + $packet = static::$client->getPacket('1.6'); $packet->addChild('server')->addChild('get_protos'); - $result = static::$_client->request($packet); + $result = static::$client->request($packet); $this->assertEquals('ok', $result->status); } public function testLatestMinorProtocol() { - $packet = static::$_client->getPacket('1.6.5'); + $packet = static::$client->getPacket('1.6.5'); $packet->addChild('server')->addChild('get_protos'); - $result = static::$_client->request($packet); + $result = static::$client->request($packet); $this->assertEquals('ok', $result->status); } public function testRequestShortSyntax() { - $response = static::$_client->request('server.get.gen_info'); + $response = static::$client->request('server.get.gen_info'); $this->assertGreaterThan(0, strlen($response->gen_info->server_name)); } public function testOperatorPlainRequest() { - $response = static::$_client->server()->request('get.gen_info'); + $response = static::$client->server()->request('get.gen_info'); $this->assertGreaterThan(0, strlen($response->gen_info->server_name)); $this->assertEquals(36, strlen($response->getValue('server_guid'))); } public function testRequestArraySyntax() { - $response = static::$_client->request([ + $response = static::$client->request([ 'server' => [ 'get' => [ 'gen_info' => '', @@ -108,13 +108,13 @@ public function testRequestArraySyntax() public function testOperatorArraySyntax() { - $response = static::$_client->server()->request(['get' => ['gen_info' => '']]); + $response = static::$client->server()->request(['get' => ['gen_info' => '']]); $this->assertGreaterThan(0, strlen($response->gen_info->server_name)); } public function testMultiRequest() { - $responses = static::$_client->multiRequest([ + $responses = static::$client->multiRequest([ 'server.get_protos', 'server.get.gen_info', ]); @@ -156,18 +156,18 @@ public function testGetProtocol() public function testSetVerifyResponse() { - static::$_client->setVerifyResponse(function ($xml) { + static::$client->setVerifyResponse(function ($xml) { if ($xml->xpath('//proto')) { throw new Exception('proto'); } }); try { - static::$_client->server()->getProtos(); + static::$client->server()->getProtos(); } catch (Exception $e) { $this->assertEquals('proto', $e->getMessage()); } finally { - static::$_client->setVerifyResponse(); + static::$client->setVerifyResponse(); } } } diff --git a/tests/CertificateTest.php b/tests/CertificateAbstractTest.php similarity index 85% rename from tests/CertificateTest.php rename to tests/CertificateAbstractTest.php index cd6cda3b..b83c0979 100644 --- a/tests/CertificateTest.php +++ b/tests/CertificateAbstractTest.php @@ -3,11 +3,11 @@ namespace PleskXTest; -class CertificateTest extends TestCase +class CertificateAbstractTest extends AbstractTestCase { public function testGenerate() { - $certificate = static::$_client->certificate()->generate([ + $certificate = static::$client->certificate()->generate([ 'bits' => 2048, 'country' => 'RU', 'state' => 'NSO', diff --git a/tests/CustomerTest.php b/tests/CustomerAbstractTest.php similarity index 56% rename from tests/CustomerTest.php rename to tests/CustomerAbstractTest.php index cb69f5e5..428e44cc 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerAbstractTest.php @@ -6,13 +6,13 @@ use PleskXTest\Utility\KeyLimitChecker; use PleskXTest\Utility\PasswordProvider; -class CustomerTest extends TestCase +class CustomerAbstractTest extends AbstractTestCase { - private $_customerProperties; + private array $customerProperties; public function setUp(): void { - $this->_customerProperties = [ + $this->customerProperties = [ 'cname' => 'Plesk', 'pname' => 'John Smith', 'login' => 'john-unit-test', @@ -25,24 +25,24 @@ public function setUp(): void public function testCreate() { - $customer = static::$_client->customer()->create($this->_customerProperties); + $customer = static::$client->customer()->create($this->customerProperties); $this->assertIsInt($customer->id); $this->assertGreaterThan(0, $customer->id); - static::$_client->customer()->delete('id', $customer->id); + static::$client->customer()->delete('id', $customer->id); } public function testDelete() { - $customer = static::$_client->customer()->create($this->_customerProperties); - $result = static::$_client->customer()->delete('id', $customer->id); + $customer = static::$client->customer()->create($this->customerProperties); + $result = static::$client->customer()->delete('id', $customer->id); $this->assertTrue($result); } public function testGet() { - $customer = static::$_client->customer()->create($this->_customerProperties); - $customerInfo = static::$_client->customer()->get('id', $customer->id); + $customer = static::$client->customer()->create($this->customerProperties); + $customerInfo = static::$client->customer()->get('id', $customer->id); $this->assertEquals('Plesk', $customerInfo->company); $this->assertEquals('John Smith', $customerInfo->personalName); $this->assertEquals('john-unit-test', $customerInfo->login); @@ -51,29 +51,29 @@ public function testGet() $this->assertEquals('link:12345', $customerInfo->externalId); $this->assertEquals($customer->id, $customerInfo->id); - static::$_client->customer()->delete('id', $customer->id); + static::$client->customer()->delete('id', $customer->id); } public function testGetAll() { - $keyInfo = static::$_client->server()->getKeyInfo(); + $keyInfo = static::$client->server()->getKeyInfo(); if (!KeyLimitChecker::checkByType($keyInfo, KeyLimitChecker::LIMIT_CLIENTS, 2)) { $this->markTestSkipped('License does not allow to create more than 1 customer.'); } - static::$_client->customer()->create([ + static::$client->customer()->create([ 'pname' => 'John Smith', 'login' => 'customer-a', 'passwd' => PasswordProvider::STRONG_PASSWORD, ]); - static::$_client->customer()->create([ + static::$client->customer()->create([ 'pname' => 'Mike Black', 'login' => 'customer-b', 'passwd' => PasswordProvider::STRONG_PASSWORD, ]); - $customersInfo = static::$_client->customer()->getAll(); + $customersInfo = static::$client->customer()->getAll(); $this->assertIsArray($customersInfo); $customersCheck = array_filter($customersInfo, function ($value) { @@ -81,42 +81,42 @@ public function testGetAll() }); $this->assertCount(2, $customersCheck); - static::$_client->customer()->delete('login', 'customer-a'); - static::$_client->customer()->delete('login', 'customer-b'); + static::$client->customer()->delete('login', 'customer-a'); + static::$client->customer()->delete('login', 'customer-b'); } public function testEnable() { - $customer = static::$_client->customer()->create($this->_customerProperties); - static::$_client->customer()->disable('id', $customer->id); - static::$_client->customer()->enable('id', $customer->id); - $customerInfo = static::$_client->customer()->get('id', $customer->id); + $customer = static::$client->customer()->create($this->customerProperties); + static::$client->customer()->disable('id', $customer->id); + static::$client->customer()->enable('id', $customer->id); + $customerInfo = static::$client->customer()->get('id', $customer->id); $this->assertTrue($customerInfo->enabled); - static::$_client->customer()->delete('id', $customer->id); + static::$client->customer()->delete('id', $customer->id); } public function testDisable() { - $customer = static::$_client->customer()->create($this->_customerProperties); - static::$_client->customer()->disable('id', $customer->id); - $customerInfo = static::$_client->customer()->get('id', $customer->id); + $customer = static::$client->customer()->create($this->customerProperties); + static::$client->customer()->disable('id', $customer->id); + $customerInfo = static::$client->customer()->get('id', $customer->id); $this->assertFalse($customerInfo->enabled); - static::$_client->customer()->delete('id', $customer->id); + static::$client->customer()->delete('id', $customer->id); } public function testSetProperties() { - $customer = static::$_client->customer()->create($this->_customerProperties); - static::$_client->customer()->setProperties('id', $customer->id, [ + $customer = static::$client->customer()->create($this->customerProperties); + static::$client->customer()->setProperties('id', $customer->id, [ 'pname' => 'Mike Black', 'email' => 'mike@black.com', ]); - $customerInfo = static::$_client->customer()->get('id', $customer->id); + $customerInfo = static::$client->customer()->get('id', $customer->id); $this->assertEquals('Mike Black', $customerInfo->personalName); $this->assertEquals('mike@black.com', $customerInfo->email); - static::$_client->customer()->delete('id', $customer->id); + static::$client->customer()->delete('id', $customer->id); } } diff --git a/tests/DatabaseTest.php b/tests/DatabaseAbstractTest.php similarity index 65% rename from tests/DatabaseTest.php rename to tests/DatabaseAbstractTest.php index ddbdf5aa..c02632b7 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseAbstractTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\PasswordProvider; -class DatabaseTest extends TestCase +class DatabaseAbstractTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; @@ -13,198 +13,198 @@ class DatabaseTest extends TestCase public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - static::$webspace = static::_createWebspace(); + static::$webspace = static::createWebspace(); } public function testCreate() { - $database = $this->_createDatabase([ + $database = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - static::$_client->database()->delete('id', $database->id); + static::$client->database()->delete('id', $database->id); } public function testCreateUser() { - $database = $this->_createDatabase([ + $database = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $user = $this->_createUser([ + $user = $this->createUser([ 'db-id' => $database->id, 'login' => 'test_user1', 'password' => PasswordProvider::STRONG_PASSWORD, ]); - static::$_client->database()->deleteUser('id', $user->id); - static::$_client->database()->delete('id', $database->id); + static::$client->database()->deleteUser('id', $user->id); + static::$client->database()->delete('id', $database->id); } public function testUpdateUser() { - $database = $this->_createDatabase([ + $database = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $user = $this->_createUser([ + $user = $this->createUser([ 'db-id' => $database->id, 'login' => 'test_user1', 'password' => PasswordProvider::STRONG_PASSWORD, ]); - $updatedUser = static::$_client->database()->updateUser([ + $updatedUser = static::$client->database()->updateUser([ 'id' => $user->id, 'login' => 'test_user2', 'password' => PasswordProvider::STRONG_PASSWORD, ]); $this->assertEquals(true, $updatedUser); - static::$_client->database()->deleteUser('id', $user->id); - static::$_client->database()->delete('id', $database->id); + static::$client->database()->deleteUser('id', $user->id); + static::$client->database()->delete('id', $database->id); } public function testGetById() { - $database = $this->_createDatabase([ + $database = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $db = static::$_client->database()->get('id', $database->id); + $db = static::$client->database()->get('id', $database->id); $this->assertEquals('test1', $db->name); $this->assertEquals('mysql', $db->type); $this->assertEquals(static::$webspace->id, $db->webspaceId); $this->assertEquals(1, $db->dbServerId); - static::$_client->database()->delete('id', $database->id); + static::$client->database()->delete('id', $database->id); } public function testGetAllByWebspaceId() { - $db1 = $this->_createDatabase([ + $db1 = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $db2 = $this->_createDatabase([ + $db2 = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test2', 'type' => 'mysql', 'db-server-id' => 1, ]); - $databases = static::$_client->database()->getAll('webspace-id', static::$webspace->id); + $databases = static::$client->database()->getAll('webspace-id', static::$webspace->id); $this->assertEquals('test1', $databases[0]->name); $this->assertEquals('test2', $databases[1]->name); $this->assertEquals(static::$webspace->id, $databases[0]->webspaceId); $this->assertEquals(1, $databases[1]->dbServerId); - static::$_client->database()->delete('id', $db1->id); - static::$_client->database()->delete('id', $db2->id); + static::$client->database()->delete('id', $db1->id); + static::$client->database()->delete('id', $db2->id); } public function testGetUserById() { - $database = $this->_createDatabase([ + $database = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $user = $this->_createUser([ + $user = $this->createUser([ 'db-id' => $database->id, 'login' => 'test_user1', 'password' => PasswordProvider::STRONG_PASSWORD, ]); - $dbUser = static::$_client->database()->getUser('id', $user->id); + $dbUser = static::$client->database()->getUser('id', $user->id); $this->assertEquals('test_user1', $dbUser->login); $this->assertEquals($database->id, $dbUser->dbId); - static::$_client->database()->deleteUser('id', $user->id); - static::$_client->database()->delete('id', $database->id); + static::$client->database()->deleteUser('id', $user->id); + static::$client->database()->delete('id', $database->id); } public function testGetAllUsersByDbId() { - $db1 = $this->_createDatabase([ + $db1 = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $db2 = $this->_createDatabase([ + $db2 = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test2', 'type' => 'mysql', 'db-server-id' => 1, ]); - $user1 = $this->_createUser([ + $user1 = $this->createUser([ 'db-id' => $db1->id, 'login' => 'test_user1', 'password' => PasswordProvider::STRONG_PASSWORD, ]); - $user2 = $this->_createUser([ + $user2 = $this->createUser([ 'db-id' => $db1->id, 'login' => 'test_user2', 'password' => PasswordProvider::STRONG_PASSWORD, ]); - $user3 = $this->_createUser([ + $user3 = $this->createUser([ 'db-id' => $db2->id, 'login' => 'test_user3', 'password' => PasswordProvider::STRONG_PASSWORD, ]); - $dbUsers = static::$_client->database()->getAllUsers('db-id', $db1->id); + $dbUsers = static::$client->database()->getAllUsers('db-id', $db1->id); $this->assertEquals(2, count($dbUsers)); $this->assertEquals('test_user1', $dbUsers[0]->login); $this->assertEquals('test_user2', $dbUsers[1]->login); - static::$_client->database()->deleteUser('id', $user1->id); - static::$_client->database()->deleteUser('id', $user2->id); - static::$_client->database()->deleteUser('id', $user3->id); - static::$_client->database()->delete('id', $db1->id); - static::$_client->database()->delete('id', $db2->id); + static::$client->database()->deleteUser('id', $user1->id); + static::$client->database()->deleteUser('id', $user2->id); + static::$client->database()->deleteUser('id', $user3->id); + static::$client->database()->delete('id', $db1->id); + static::$client->database()->delete('id', $db2->id); } public function testDelete() { - $database = $this->_createDatabase([ + $database = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $result = static::$_client->database()->delete('id', $database->id); + $result = static::$client->database()->delete('id', $database->id); $this->assertTrue($result); } public function testDeleteUser() { - $database = $this->_createDatabase([ + $database = $this->createDatabase([ 'webspace-id' => static::$webspace->id, 'name' => 'test1', 'type' => 'mysql', 'db-server-id' => 1, ]); - $user = $this->_createUser([ + $user = $this->createUser([ 'db-id' => $database->id, 'login' => 'test_user1', 'password' => PasswordProvider::STRONG_PASSWORD, ]); - $result = static::$_client->database()->deleteUser('id', $user->id); + $result = static::$client->database()->deleteUser('id', $user->id); $this->assertTrue($result); - static::$_client->database()->delete('id', $database->id); + static::$client->database()->delete('id', $database->id); } /** @@ -212,9 +212,9 @@ public function testDeleteUser() * * @return \PleskX\Api\Struct\Database\Info */ - private function _createDatabase(array $params) + private function createDatabase(array $params) { - $database = static::$_client->database()->create($params); + $database = static::$client->database()->create($params); $this->assertIsInt($database->id); $this->assertGreaterThan(0, $database->id); @@ -226,9 +226,9 @@ private function _createDatabase(array $params) * * @return \PleskX\Api\Struct\Database\UserInfo */ - private function _createUser(array $params) + private function createUser(array $params) { - $user = static::$_client->database()->createUser($params); + $user = static::$client->database()->createUser($params); $this->assertIsInt($user->id); $this->assertGreaterThan(0, $user->id); diff --git a/tests/DatabaseServerTest.php b/tests/DatabaseServerAbstractTest.php similarity index 69% rename from tests/DatabaseServerTest.php rename to tests/DatabaseServerAbstractTest.php index ab716a46..a6288188 100644 --- a/tests/DatabaseServerTest.php +++ b/tests/DatabaseServerAbstractTest.php @@ -3,25 +3,25 @@ namespace PleskXTest; -class DatabaseServerTest extends TestCase +class DatabaseServerAbstractTest extends AbstractTestCase { public function testGetSupportedTypes() { - $types = static::$_client->databaseServer()->getSupportedTypes(); + $types = static::$client->databaseServer()->getSupportedTypes(); $this->assertGreaterThan(0, count($types)); $this->assertContains('mysql', $types); } public function testGet() { - $dbServer = static::$_client->databaseServer()->get('id', 1); + $dbServer = static::$client->databaseServer()->get('id', 1); $this->assertEquals('localhost', $dbServer->host); $this->assertGreaterThan(0, $dbServer->port); } public function testGetAll() { - $dbServers = static::$_client->databaseServer()->getAll(); + $dbServers = static::$client->databaseServer()->getAll(); $this->assertIsArray($dbServers); $this->assertGreaterThan(0, count($dbServers)); $this->assertEquals('localhost', $dbServers[0]->host); diff --git a/tests/DnsTest.php b/tests/DnsAbstractTest.php similarity index 79% rename from tests/DnsTest.php rename to tests/DnsAbstractTest.php index 69867418..ec63f766 100644 --- a/tests/DnsTest.php +++ b/tests/DnsAbstractTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class DnsTest extends TestCase +class DnsAbstractTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; @@ -14,11 +14,11 @@ public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - $serviceStates = static::$_client->server()->getServiceStates(); + $serviceStates = static::$client->server()->getServiceStates(); static::$isDnsSupported = isset($serviceStates['dns']) && ('running' == $serviceStates['dns']['state']); if (static::$isDnsSupported) { - static::$webspace = static::_createWebspace(); + static::$webspace = static::createWebspace(); } } @@ -33,7 +33,7 @@ protected function setUp(): void public function testCreate() { - $dns = static::$_client->dns()->create([ + $dns = static::$client->dns()->create([ 'site-id' => static::$webspace->id, 'type' => 'TXT', 'host' => 'host', @@ -41,7 +41,7 @@ public function testCreate() ]); $this->assertIsInt($dns->id); $this->assertGreaterThan(0, $dns->id); - static::$_client->dns()->delete('id', $dns->id); + static::$client->dns()->delete('id', $dns->id); } /** @@ -49,7 +49,7 @@ public function testCreate() */ public function testBulkCreate() { - $response = static::$_client->dns()->bulkCreate([ + $response = static::$client->dns()->bulkCreate([ [ 'site-id' => static::$webspace->id, 'type' => 'TXT', @@ -92,7 +92,7 @@ public function testBulkDelete(array $createdRecords) return (int) $record->id; }, $createdRecords); - $response = static::$_client->dns()->bulkDelete($createdRecordIds); + $response = static::$client->dns()->bulkDelete($createdRecordIds); $this->assertCount(3, $response); @@ -104,36 +104,36 @@ public function testBulkDelete(array $createdRecords) public function testGetById() { - $dns = static::$_client->dns()->create([ + $dns = static::$client->dns()->create([ 'site-id' => static::$webspace->id, 'type' => 'TXT', 'host' => '', 'value' => 'value', ]); - $dnsInfo = static::$_client->dns()->get('id', $dns->id); + $dnsInfo = static::$client->dns()->get('id', $dns->id); $this->assertEquals('TXT', $dnsInfo->type); $this->assertEquals(static::$webspace->id, $dnsInfo->siteId); $this->assertEquals('value', $dnsInfo->value); - static::$_client->dns()->delete('id', $dns->id); + static::$client->dns()->delete('id', $dns->id); } public function testGetAllByWebspaceId() { - $dns = static::$_client->dns()->create([ + $dns = static::$client->dns()->create([ 'site-id' => static::$webspace->id, 'type' => 'DS', 'host' => '', 'value' => '60485 5 1 2BB183AF5F22588179A53B0A98631FAD1A292118', ]); - $dns2 = static::$_client->dns()->create([ + $dns2 = static::$client->dns()->create([ 'site-id' => static::$webspace->id, 'type' => 'DS', 'host' => '', 'value' => '60485 5 1 2BB183AF5F22588179A53B0A98631FAD1A292119', ]); - $dnsInfo = static::$_client->dns()->getAll('site-id', static::$webspace->id); + $dnsInfo = static::$client->dns()->getAll('site-id', static::$webspace->id); $dsRecords = []; foreach ($dnsInfo as $dnsRec) { if ('DS' == $dnsRec->type) { @@ -145,19 +145,19 @@ public function testGetAllByWebspaceId() $this->assertEquals(static::$webspace->id, $dsRecord->siteId); } - static::$_client->dns()->delete('id', $dns->id); - static::$_client->dns()->delete('id', $dns2->id); + static::$client->dns()->delete('id', $dns->id); + static::$client->dns()->delete('id', $dns2->id); } public function testDelete() { - $dns = static::$_client->dns()->create([ + $dns = static::$client->dns()->create([ 'site-id' => static::$webspace->id, 'type' => 'TXT', 'host' => 'host', 'value' => 'value', ]); - $result = static::$_client->dns()->delete('id', $dns->id); + $result = static::$client->dns()->delete('id', $dns->id); $this->assertTrue($result); } } diff --git a/tests/DnsTemplateTest.php b/tests/DnsTemplateAbstractTest.php similarity index 60% rename from tests/DnsTemplateTest.php rename to tests/DnsTemplateAbstractTest.php index e53202c0..e7536bc6 100644 --- a/tests/DnsTemplateTest.php +++ b/tests/DnsTemplateAbstractTest.php @@ -3,33 +3,30 @@ namespace PleskXTest; -class DnsTemplateTest extends TestCase +class DnsTemplateAbstractTest extends AbstractTestCase { - /** - * @var bool - */ - private static $_isDnsSupported; + private static bool $isDnsSupported; public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - $serviceStates = static::$_client->server()->getServiceStates(); - static::$_isDnsSupported = $serviceStates['dns'] && ('running' == $serviceStates['dns']['state']); + $serviceStates = static::$client->server()->getServiceStates(); + static::$isDnsSupported = $serviceStates['dns'] && ('running' == $serviceStates['dns']['state']); } protected function setUp(): void { parent::setUp(); - if (!static::$_isDnsSupported) { + if (!static::$isDnsSupported) { $this->markTestSkipped('DNS system is not supported.'); } } public function testCreate() { - $dns = static::$_client->dnsTemplate()->create([ + $dns = static::$client->dnsTemplate()->create([ 'type' => 'TXT', 'host' => 'test.create', 'value' => 'value', @@ -38,37 +35,37 @@ public function testCreate() $this->assertGreaterThan(0, $dns->id); $this->assertEquals(0, $dns->siteId); $this->assertEquals(0, $dns->siteAliasId); - static::$_client->dnsTemplate()->delete('id', $dns->id); + static::$client->dnsTemplate()->delete('id', $dns->id); } public function testGetById() { - $dns = static::$_client->dnsTemplate()->create([ + $dns = static::$client->dnsTemplate()->create([ 'type' => 'TXT', 'host' => 'test.get.by.id', 'value' => 'value', ]); - $dnsInfo = static::$_client->dnsTemplate()->get('id', $dns->id); + $dnsInfo = static::$client->dnsTemplate()->get('id', $dns->id); $this->assertEquals('TXT', $dnsInfo->type); $this->assertEquals('value', $dnsInfo->value); - static::$_client->dnsTemplate()->delete('id', $dns->id); + static::$client->dnsTemplate()->delete('id', $dns->id); } public function testGetAll() { - $dns = static::$_client->dnsTemplate()->create([ + $dns = static::$client->dnsTemplate()->create([ 'type' => 'TXT', 'host' => 'test.get.all', 'value' => 'value', ]); - $dns2 = static::$_client->dnsTemplate()->create([ + $dns2 = static::$client->dnsTemplate()->create([ 'type' => 'TXT', 'host' => 'test.get.all', 'value' => 'value2', ]); - $dnsInfo = static::$_client->dnsTemplate()->getAll(); + $dnsInfo = static::$client->dnsTemplate()->getAll(); $dsRecords = []; foreach ($dnsInfo as $dnsRec) { if ('TXT' === $dnsRec->type && 0 === strpos($dnsRec->host, 'test.get.all')) { @@ -77,18 +74,18 @@ public function testGetAll() } $this->assertCount(2, $dsRecords); - static::$_client->dnsTemplate()->delete('id', $dns->id); - static::$_client->dnsTemplate()->delete('id', $dns2->id); + static::$client->dnsTemplate()->delete('id', $dns->id); + static::$client->dnsTemplate()->delete('id', $dns2->id); } public function testDelete() { - $dns = static::$_client->dnsTemplate()->create([ + $dns = static::$client->dnsTemplate()->create([ 'type' => 'TXT', 'host' => 'test.delete', 'value' => 'value', ]); - $result = static::$_client->dnsTemplate()->delete('id', $dns->id); + $result = static::$client->dnsTemplate()->delete('id', $dns->id); $this->assertTrue($result); } } diff --git a/tests/EventLogTest.php b/tests/EventLogAbstractTest.php similarity index 69% rename from tests/EventLogTest.php rename to tests/EventLogAbstractTest.php index c402fbc9..283dd25a 100644 --- a/tests/EventLogTest.php +++ b/tests/EventLogAbstractTest.php @@ -3,11 +3,11 @@ namespace PleskXTest; -class EventLogTest extends TestCase +class EventLogAbstractTest extends AbstractTestCase { public function testGet() { - $events = static::$_client->eventLog()->get(); + $events = static::$client->eventLog()->get(); $this->assertGreaterThan(0, $events); $event = reset($events); @@ -16,7 +16,7 @@ public function testGet() public function testGetDetailedLog() { - $events = static::$_client->eventLog()->getDetailedLog(); + $events = static::$client->eventLog()->getDetailedLog(); $this->assertGreaterThan(0, $events); $event = reset($events); @@ -25,7 +25,7 @@ public function testGetDetailedLog() public function testGetLastId() { - $lastId = static::$_client->eventLog()->getLastId(); + $lastId = static::$client->eventLog()->getLastId(); $this->assertGreaterThan(0, $lastId); } } diff --git a/tests/IpTest.php b/tests/IpAbstractTest.php similarity index 77% rename from tests/IpTest.php rename to tests/IpAbstractTest.php index 1e4625a2..c6147fc1 100644 --- a/tests/IpTest.php +++ b/tests/IpAbstractTest.php @@ -3,11 +3,11 @@ namespace PleskXTest; -class IpTest extends TestCase +class IpAbstractTest extends AbstractTestCase { public function testGet() { - $ips = static::$_client->ip()->get(); + $ips = static::$client->ip()->get(); $this->assertGreaterThan(0, count($ips)); $ip = reset($ips); diff --git a/tests/LocaleTest.php b/tests/LocaleAbstractTest.php similarity index 69% rename from tests/LocaleTest.php rename to tests/LocaleAbstractTest.php index 003cb019..be3bc07b 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleAbstractTest.php @@ -3,11 +3,11 @@ namespace PleskXTest; -class LocaleTest extends TestCase +class LocaleAbstractTest extends AbstractTestCase { public function testGet() { - $locales = static::$_client->locale()->get(); + $locales = static::$client->locale()->get(); $this->assertGreaterThan(0, count($locales)); $locale = $locales['en-US']; @@ -16,7 +16,7 @@ public function testGet() public function testGetById() { - $locale = static::$_client->locale()->get('en-US'); + $locale = static::$client->locale()->get('en-US'); $this->assertEquals('en-US', $locale->id); } } diff --git a/tests/MailTest.php b/tests/MailAbstractTest.php similarity index 55% rename from tests/MailTest.php rename to tests/MailAbstractTest.php index 948c26c5..f6370160 100644 --- a/tests/MailTest.php +++ b/tests/MailAbstractTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\PasswordProvider; -class MailTest extends TestCase +class MailAbstractTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; @@ -19,11 +19,11 @@ public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - $serviceStates = static::$_client->server()->getServiceStates(); + $serviceStates = static::$client->server()->getServiceStates(); static::$isMailSupported = isset($serviceStates['smtp']) && ('running' == $serviceStates['smtp']['state']); if (static::$isMailSupported) { - static::$webspace = static::_createWebspace(); + static::$webspace = static::createWebspace(); } } @@ -38,48 +38,53 @@ protected function setUp(): void public function testCreate() { - $mailname = static::$_client->mail()->create('test', static::$webspace->id, true, PasswordProvider::STRONG_PASSWORD); + $mailname = static::$client->mail()->create( + 'test', + static::$webspace->id, + true, + PasswordProvider::STRONG_PASSWORD + ); $this->assertIsInt($mailname->id); $this->assertGreaterThan(0, $mailname->id); $this->assertEquals('test', $mailname->name); - static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); + static::$client->mail()->delete('name', $mailname->name, static::$webspace->id); } public function testDelete() { - $mailname = static::$_client->mail()->create('test', static::$webspace->id); + $mailname = static::$client->mail()->create('test', static::$webspace->id); - $result = static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); + $result = static::$client->mail()->delete('name', $mailname->name, static::$webspace->id); $this->assertTrue($result); } public function testGet() { - $mailname = static::$_client->mail()->create('test', static::$webspace->id); + $mailname = static::$client->mail()->create('test', static::$webspace->id); - $mailnameInfo = static::$_client->mail()->get('test', static::$webspace->id); + $mailnameInfo = static::$client->mail()->get('test', static::$webspace->id); $this->assertEquals('test', $mailnameInfo->name); $this->assertEquals($mailname->id, $mailnameInfo->id); - static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); + static::$client->mail()->delete('name', $mailname->name, static::$webspace->id); } public function testGetAll() { - $mailname = static::$_client->mail()->create('test', static::$webspace->id); + $mailname = static::$client->mail()->create('test', static::$webspace->id); - $mailnamesInfo = static::$_client->mail()->getAll(static::$webspace->id); + $mailnamesInfo = static::$client->mail()->getAll(static::$webspace->id); $this->assertCount(1, $mailnamesInfo); $this->assertEquals('test', $mailnamesInfo[0]->name); - static::$_client->mail()->delete('name', $mailname->name, static::$webspace->id); + static::$client->mail()->delete('name', $mailname->name, static::$webspace->id); } public function testGetAllWithoutMailnames() { - $mailnamesInfo = static::$_client->mail()->getAll(static::$webspace->id); + $mailnamesInfo = static::$client->mail()->getAll(static::$webspace->id); $this->assertCount(0, $mailnamesInfo); } } diff --git a/tests/PhpHandlerTest.php b/tests/PhpHandlerAbstractTest.php similarity index 72% rename from tests/PhpHandlerTest.php rename to tests/PhpHandlerAbstractTest.php index 47b0b67e..f950e057 100644 --- a/tests/PhpHandlerTest.php +++ b/tests/PhpHandlerAbstractTest.php @@ -3,18 +3,18 @@ namespace PleskXTest; -class PhpHandlerTest extends TestCase +class PhpHandlerAbstractTest extends AbstractTestCase { public function testGet() { - $handler = static::$_client->phpHandler()->get(); + $handler = static::$client->phpHandler()->get(); $this->assertObjectHasAttribute('type', $handler); } public function testGetAll() { - $handlers = static::$_client->phpHandler()->getAll(); + $handlers = static::$client->phpHandler()->getAll(); $this->assertIsArray($handlers); $this->assertNotEmpty($handlers); @@ -30,6 +30,6 @@ public function testGetUnknownHandlerThrowsException() $this->expectException(\PleskX\Api\Exception::class); $this->expectExceptionMessage('Php handler does not exists'); - static::$_client->phpHandler()->get('id', 'this-handler-does-not-exist'); + static::$client->phpHandler()->get('id', 'this-handler-does-not-exist'); } } diff --git a/tests/ProtectedDirectoryAbstractTest.php b/tests/ProtectedDirectoryAbstractTest.php new file mode 100644 index 00000000..0b94f85d --- /dev/null +++ b/tests/ProtectedDirectoryAbstractTest.php @@ -0,0 +1,92 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskXTest; + +use PleskXTest\Utility\PasswordProvider; + +class ProtectedDirectoryAbstractTest extends AbstractTestCase +{ + /** @var \PleskX\Api\Struct\Webspace\Info */ + private static $webspace; + + public static function setUpBeforeClass(): void + { + parent::setUpBeforeClass(); + static::$webspace = static::createWebspace(); + } + + public function testAdd() + { + $protectedDirectory = static::$client->protectedDirectory()->add('/', static::$webspace->id); + + $this->assertIsObject($protectedDirectory); + $this->assertGreaterThan(0, $protectedDirectory->id); + + static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); + } + + public function testAddInvalidDirectory() + { + $this->expectException(\PleskX\Api\Exception::class); + $this->expectExceptionCode(1019); + + static::$client->protectedDirectory()->add('', static::$webspace->id); + } + + public function testDelete() + { + $protectedDirectory = static::$client->protectedDirectory()->add('/', static::$webspace->id); + + $result = static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); + $this->assertTrue($result); + } + + public function testGetById() + { + $protectedDirectory = static::$client->protectedDirectory()->add('test', static::$webspace->id); + + $foundDirectory = static::$client->protectedDirectory()->get('id', $protectedDirectory->id); + $this->assertEquals('test', $foundDirectory->name); + + static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); + } + + public function testGetUnknownDirectory() + { + $this->expectException(\PleskX\Api\Exception::class); + $this->expectExceptionCode(1013); + + $nonExistentDirectoryId = 99999999; + static::$client->protectedDirectory()->get('id', $nonExistentDirectoryId); + } + + public function testAddUser() + { + $protectedDirectory = static::$client->protectedDirectory()->add('/', static::$webspace->id); + + $user = static::$client->protectedDirectory()->addUser( + $protectedDirectory, + 'john', + PasswordProvider::STRONG_PASSWORD + ); + $this->assertGreaterThan(0, $user->id); + + static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); + } + + public function testDeleteUser() + { + $protectedDirectory = static::$client->protectedDirectory()->add('/', static::$webspace->id); + + $user = static::$client->protectedDirectory()->addUser( + $protectedDirectory, + 'john', + PasswordProvider::STRONG_PASSWORD + ); + $result = static::$client->protectedDirectory()->deleteUser('id', $user->id); + $this->assertTrue($result); + + static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); + } +} diff --git a/tests/ProtectedDirectoryTest.php b/tests/ProtectedDirectoryTest.php deleted file mode 100644 index aa368fcf..00000000 --- a/tests/ProtectedDirectoryTest.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -// Copyright 1999-2021. Plesk International GmbH. - -namespace PleskXTest; - -use PleskXTest\Utility\PasswordProvider; - -class ProtectedDirectoryTest extends TestCase -{ - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; - - public static function setUpBeforeClass(): void - { - parent::setUpBeforeClass(); - static::$webspace = static::_createWebspace(); - } - - public function testAdd() - { - $protectedDirectory = static::$_client->protectedDirectory()->add('/', static::$webspace->id); - - $this->assertIsObject($protectedDirectory); - $this->assertGreaterThan(0, $protectedDirectory->id); - - static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); - } - - public function testAddInvalidDirectory() - { - $this->expectException(\PleskX\Api\Exception::class); - $this->expectExceptionCode(1019); - - static::$_client->protectedDirectory()->add('', static::$webspace->id); - } - - public function testDelete() - { - $protectedDirectory = static::$_client->protectedDirectory()->add('/', static::$webspace->id); - - $result = static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); - $this->assertTrue($result); - } - - public function testGetById() - { - $protectedDirectory = static::$_client->protectedDirectory()->add('test', static::$webspace->id); - - $foundDirectory = static::$_client->protectedDirectory()->get('id', $protectedDirectory->id); - $this->assertEquals('test', $foundDirectory->name); - - static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); - } - - public function testGetUnknownDirectory() - { - $this->expectException(\PleskX\Api\Exception::class); - $this->expectExceptionCode(1013); - - $nonExistentDirectoryId = 99999999; - static::$_client->protectedDirectory()->get('id', $nonExistentDirectoryId); - } - - public function testAddUser() - { - $protectedDirectory = static::$_client->protectedDirectory()->add('/', static::$webspace->id); - - $user = static::$_client->protectedDirectory()->addUser($protectedDirectory, 'john', PasswordProvider::STRONG_PASSWORD); - $this->assertGreaterThan(0, $user->id); - - static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); - } - - public function testDeleteUser() - { - $protectedDirectory = static::$_client->protectedDirectory()->add('/', static::$webspace->id); - - $user = static::$_client->protectedDirectory()->addUser($protectedDirectory, 'john', PasswordProvider::STRONG_PASSWORD); - $result = static::$_client->protectedDirectory()->deleteUser('id', $user->id); - $this->assertTrue($result); - - static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); - } -} diff --git a/tests/ResellerTest.php b/tests/ResellerAbstractTest.php similarity index 61% rename from tests/ResellerTest.php rename to tests/ResellerAbstractTest.php index 3d1c0831..db404fef 100644 --- a/tests/ResellerTest.php +++ b/tests/ResellerAbstractTest.php @@ -6,13 +6,13 @@ use PleskXTest\Utility\KeyLimitChecker; use PleskXTest\Utility\PasswordProvider; -class ResellerTest extends TestCase +class ResellerAbstractTest extends AbstractTestCase { - private $_resellerProperties; + private array $resellerProperties; public function setUp(): void { - $this->_resellerProperties = [ + $this->resellerProperties = [ 'pname' => 'John Reseller', 'login' => 'reseller-unit-test', 'passwd' => PasswordProvider::STRONG_PASSWORD, @@ -21,57 +21,57 @@ public function setUp(): void public function testCreate() { - $reseller = static::$_client->reseller()->create($this->_resellerProperties); + $reseller = static::$client->reseller()->create($this->resellerProperties); $this->assertIsInt($reseller->id); $this->assertGreaterThan(0, $reseller->id); - static::$_client->reseller()->delete('id', $reseller->id); + static::$client->reseller()->delete('id', $reseller->id); } public function testDelete() { - $reseller = static::$_client->reseller()->create($this->_resellerProperties); - $result = static::$_client->reseller()->delete('id', $reseller->id); + $reseller = static::$client->reseller()->create($this->resellerProperties); + $result = static::$client->reseller()->delete('id', $reseller->id); $this->assertTrue($result); } public function testGet() { - $reseller = static::$_client->reseller()->create($this->_resellerProperties); - $resellerInfo = static::$_client->reseller()->get('id', $reseller->id); + $reseller = static::$client->reseller()->create($this->resellerProperties); + $resellerInfo = static::$client->reseller()->get('id', $reseller->id); $this->assertEquals('John Reseller', $resellerInfo->personalName); $this->assertEquals('reseller-unit-test', $resellerInfo->login); $this->assertGreaterThan(0, count($resellerInfo->permissions)); $this->assertEquals($reseller->id, $resellerInfo->id); - static::$_client->reseller()->delete('id', $reseller->id); + static::$client->reseller()->delete('id', $reseller->id); } public function testGetAll() { - $keyInfo = static::$_client->server()->getKeyInfo(); + $keyInfo = static::$client->server()->getKeyInfo(); if (!KeyLimitChecker::checkByType($keyInfo, KeyLimitChecker::LIMIT_RESELLERS, 2)) { $this->markTestSkipped('License does not allow to create more than 1 reseller.'); } - static::$_client->reseller()->create([ + static::$client->reseller()->create([ 'pname' => 'John Reseller', 'login' => 'reseller-a', 'passwd' => PasswordProvider::STRONG_PASSWORD, ]); - static::$_client->reseller()->create([ + static::$client->reseller()->create([ 'pname' => 'Mike Reseller', 'login' => 'reseller-b', 'passwd' => PasswordProvider::STRONG_PASSWORD, ]); - $resellersInfo = static::$_client->reseller()->getAll(); + $resellersInfo = static::$client->reseller()->getAll(); $this->assertCount(2, $resellersInfo); $this->assertEquals('John Reseller', $resellersInfo[0]->personalName); $this->assertEquals('reseller-a', $resellersInfo[0]->login); - static::$_client->reseller()->delete('login', 'reseller-a'); - static::$_client->reseller()->delete('login', 'reseller-b'); + static::$client->reseller()->delete('login', 'reseller-a'); + static::$client->reseller()->delete('login', 'reseller-b'); } } diff --git a/tests/SecretKeyAbstractTest.php b/tests/SecretKeyAbstractTest.php new file mode 100644 index 00000000..e2704280 --- /dev/null +++ b/tests/SecretKeyAbstractTest.php @@ -0,0 +1,102 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskXTest; + +use PleskX\Api\Exception; + +class SecretKeyAbstractTest extends AbstractTestCase +{ + public function testCreate() + { + $keyId = static::$client->secretKey()->create('192.168.0.1'); + $this->assertMatchesRegularExpression( + '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', + $keyId + ); + static::$client->secretKey()->delete($keyId); + } + + public function testCreateAutoIp() + { + $keyId = static::$client->secretKey()->create(); + $this->assertNotEmpty($keyId); + static::$client->secretKey()->delete($keyId); + } + + public function testCreateMultiIps() + { + $keyId = static::$client->secretKey()->create(join(',', ['192.168.0.1', '192.168.0.2'])); + $this->assertMatchesRegularExpression( + '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', + $keyId + ); + static::$client->secretKey()->delete($keyId); + } + + public function testCreateWithDescription() + { + $keyId = static::$client->secretKey()->create('192.168.0.1', 'test key'); + $keyInfo = static::$client->secretKey()->get($keyId); + + $this->assertEquals('test key', $keyInfo->description); + + static::$client->secretKey()->delete($keyId); + } + + public function testGet() + { + $keyId = static::$client->secretKey()->create('192.168.0.1'); + $keyInfo = static::$client->secretKey()->get($keyId); + + $this->assertNotEmpty($keyInfo->key); + $this->assertEquals('192.168.0.1', $keyInfo->ipAddress); + $this->assertEquals('admin', $keyInfo->login); + + static::$client->secretKey()->delete($keyId); + } + + public function testGetAll() + { + $keyIds = []; + $keyIds[] = static::$client->secretKey()->create('192.168.0.1'); + $keyIds[] = static::$client->secretKey()->create('192.168.0.2'); + + $keys = static::$client->secretKey()->getAll(); + $this->assertGreaterThanOrEqual(2, count($keys)); + + $keyIpAddresses = array_map(function ($key) { + return $key->ipAddress; + }, $keys); + $this->assertContains('192.168.0.1', $keyIpAddresses); + $this->assertContains('192.168.0.2', $keyIpAddresses); + + foreach ($keyIds as $keyId) { + static::$client->secretKey()->delete($keyId); + } + } + + public function testDelete() + { + $keyId = static::$client->secretKey()->create('192.168.0.1'); + static::$client->secretKey()->delete($keyId); + + try { + static::$client->secretKey()->get($keyId); + $this->fail("Secret key $keyId was not deleted."); + } catch (Exception $exception) { + $this->assertEquals(1013, $exception->getCode()); + } + } + + public function testListEmpty() + { + $keys = static::$client->secretKey()->getAll(); + foreach ($keys as $key) { + static::$client->secretKey()->delete($key->key); + } + + $keys = static::$client->secretKey()->getAll(); + $this->assertEquals(0, count($keys)); + } +} diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php deleted file mode 100644 index 0e04ccaa..00000000 --- a/tests/SecretKeyTest.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php -// Copyright 1999-2021. Plesk International GmbH. - -namespace PleskXTest; - -use PleskX\Api\Exception; - -class SecretKeyTest extends TestCase -{ - public function testCreate() - { - $keyId = static::$_client->secretKey()->create('192.168.0.1'); - $this->assertMatchesRegularExpression('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $keyId); - static::$_client->secretKey()->delete($keyId); - } - - public function testCreateAutoIp() - { - $keyId = static::$_client->secretKey()->create(); - $this->assertNotEmpty($keyId); - static::$_client->secretKey()->delete($keyId); - } - - public function testCreateMultiIps() - { - $keyId = static::$_client->secretKey()->create(join(',', ['192.168.0.1', '192.168.0.2'])); - $this->assertMatchesRegularExpression('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $keyId); - static::$_client->secretKey()->delete($keyId); - } - - public function testCreateWithDescription() - { - $keyId = static::$_client->secretKey()->create('192.168.0.1', 'test key'); - $keyInfo = static::$_client->secretKey()->get($keyId); - - $this->assertEquals('test key', $keyInfo->description); - - static::$_client->secretKey()->delete($keyId); - } - - public function testGet() - { - $keyId = static::$_client->secretKey()->create('192.168.0.1'); - $keyInfo = static::$_client->secretKey()->get($keyId); - - $this->assertNotEmpty($keyInfo->key); - $this->assertEquals('192.168.0.1', $keyInfo->ipAddress); - $this->assertEquals('admin', $keyInfo->login); - - static::$_client->secretKey()->delete($keyId); - } - - public function testGetAll() - { - $keyIds = []; - $keyIds[] = static::$_client->secretKey()->create('192.168.0.1'); - $keyIds[] = static::$_client->secretKey()->create('192.168.0.2'); - - $keys = static::$_client->secretKey()->getAll(); - $this->assertGreaterThanOrEqual(2, count($keys)); - - $keyIpAddresses = array_map(function ($key) { - return $key->ipAddress; - }, $keys); - $this->assertContains('192.168.0.1', $keyIpAddresses); - $this->assertContains('192.168.0.2', $keyIpAddresses); - - foreach ($keyIds as $keyId) { - static::$_client->secretKey()->delete($keyId); - } - } - - public function testDelete() - { - $keyId = static::$_client->secretKey()->create('192.168.0.1'); - static::$_client->secretKey()->delete($keyId); - - try { - static::$_client->secretKey()->get($keyId); - $this->fail("Secret key $keyId was not deleted."); - } catch (Exception $exception) { - $this->assertEquals(1013, $exception->getCode()); - } - } - - public function testListEmpty() - { - $keys = static::$_client->secretKey()->getAll(); - foreach ($keys as $key) { - static::$_client->secretKey()->delete($key->key); - } - - $keys = static::$_client->secretKey()->getAll(); - $this->assertEquals(0, count($keys)); - } -} diff --git a/tests/ServerTest.php b/tests/ServerAbstractTest.php similarity index 75% rename from tests/ServerTest.php rename to tests/ServerAbstractTest.php index 29be9d6c..73befea3 100644 --- a/tests/ServerTest.php +++ b/tests/ServerAbstractTest.php @@ -3,26 +3,29 @@ namespace PleskXTest; -class ServerTest extends TestCase +class ServerAbstractTest extends AbstractTestCase { public function testGetProtos() { - $protos = static::$_client->server()->getProtos(); + $protos = static::$client->server()->getProtos(); $this->assertIsArray($protos); $this->assertContains('1.6.3.0', $protos); } public function testGetGenInfo() { - $generalInfo = static::$_client->server()->getGeneralInfo(); + $generalInfo = static::$client->server()->getGeneralInfo(); $this->assertGreaterThan(0, strlen($generalInfo->serverName)); - $this->assertMatchesRegularExpression('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', strtolower($generalInfo->serverGuid)); + $this->assertMatchesRegularExpression( + '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', + strtolower($generalInfo->serverGuid) + ); $this->assertEquals('standard', $generalInfo->mode); } public function testGetPreferences() { - $preferences = static::$_client->server()->getPreferences(); + $preferences = static::$client->server()->getPreferences(); $this->assertIsNumeric($preferences->statTtl); $this->assertGreaterThan(0, $preferences->statTtl); $this->assertEquals(0, $preferences->restartApacheInterval); @@ -30,14 +33,14 @@ public function testGetPreferences() public function testGetAdmin() { - $admin = static::$_client->server()->getAdmin(); + $admin = static::$client->server()->getAdmin(); $this->assertGreaterThan(0, strlen($admin->name)); $this->assertStringContainsString('@', $admin->email); } public function testGetKeyInfo() { - $keyInfo = static::$_client->server()->getKeyInfo(); + $keyInfo = static::$client->server()->getKeyInfo(); $this->assertIsArray($keyInfo); $this->assertGreaterThan(0, count($keyInfo)); $this->assertArrayHasKey('plesk_key_id', $keyInfo); @@ -46,7 +49,7 @@ public function testGetKeyInfo() public function testGetComponents() { - $components = static::$_client->server()->getComponents(); + $components = static::$client->server()->getComponents(); $this->assertIsArray($components); $this->assertGreaterThan(0, count($components)); $this->assertArrayHasKey('psa', $components); @@ -54,7 +57,7 @@ public function testGetComponents() public function testGetServiceStates() { - $serviceStates = static::$_client->server()->getServiceStates(); + $serviceStates = static::$client->server()->getServiceStates(); $this->assertIsArray($serviceStates); $this->assertGreaterThan(0, count($serviceStates)); @@ -68,14 +71,14 @@ public function testGetServiceStates() public function testGetSessionPreferences() { - $preferences = static::$_client->server()->getSessionPreferences(); + $preferences = static::$client->server()->getSessionPreferences(); $this->assertIsNumeric($preferences->loginTimeout); $this->assertGreaterThan(0, $preferences->loginTimeout); } public function testGetShells() { - $shells = static::$_client->server()->getShells(); + $shells = static::$client->server()->getShells(); $this->assertIsArray($shells); $this->assertGreaterThan(0, count($shells)); @@ -83,14 +86,14 @@ public function testGetShells() public function testGetNetworkInterfaces() { - $netInterfaces = static::$_client->server()->getNetworkInterfaces(); + $netInterfaces = static::$client->server()->getNetworkInterfaces(); $this->assertIsArray($netInterfaces); $this->assertGreaterThan(0, count($netInterfaces)); } public function testGetStatistics() { - $stats = static::$_client->server()->getStatistics(); + $stats = static::$client->server()->getStatistics(); $this->assertIsNumeric($stats->objects->clients); $this->assertIsNumeric($stats->objects->domains); $this->assertIsNumeric($stats->objects->databases); @@ -109,7 +112,7 @@ public function testGetStatistics() public function testGetSiteIsolationConfig() { - $config = static::$_client->server()->getSiteIsolationConfig(); + $config = static::$client->server()->getSiteIsolationConfig(); $this->assertIsArray($config); $this->assertGreaterThan(0, count($config)); $this->assertArrayHasKey('php', $config); @@ -117,7 +120,7 @@ public function testGetSiteIsolationConfig() public function testGetUpdatesInfo() { - $updatesInfo = static::$_client->server()->getUpdatesInfo(); + $updatesInfo = static::$client->server()->getUpdatesInfo(); $this->assertIsBool($updatesInfo->installUpdatesAutomatically); } } diff --git a/tests/ServicePlanTest.php b/tests/ServicePlanAbstractTest.php similarity index 64% rename from tests/ServicePlanTest.php rename to tests/ServicePlanAbstractTest.php index 5d759800..d6f72605 100644 --- a/tests/ServicePlanTest.php +++ b/tests/ServicePlanAbstractTest.php @@ -3,25 +3,25 @@ namespace PleskXTest; -class ServicePlanTest extends TestCase +class ServicePlanAbstractTest extends AbstractTestCase { public function testGet() { - $servicePlan = static::_createServicePlan(); - $servicePlanInfo = static::$_client->servicePlan()->get('id', $servicePlan->id); + $servicePlan = static::createServicePlan(); + $servicePlanInfo = static::$client->servicePlan()->get('id', $servicePlan->id); $this->assertNotEmpty($servicePlanInfo->name); $this->assertSame($servicePlan->id, $servicePlanInfo->id); - static::$_client->servicePlan()->delete('id', $servicePlan->id); + static::$client->servicePlan()->delete('id', $servicePlan->id); } public function testGetAll() { - static::_createServicePlan(); - static::_createServicePlan(); - static::_createServicePlan(); + static::createServicePlan(); + static::createServicePlan(); + static::createServicePlan(); - $servicePlans = static::$_client->servicePlan()->getAll(); + $servicePlans = static::$client->servicePlan()->getAll(); $this->assertIsArray($servicePlans); $this->assertGreaterThan(2, count($servicePlans)); $this->assertNotEmpty($servicePlans[0]->name); @@ -29,16 +29,16 @@ public function testGetAll() public function testCreateServicePlan() { - $servicePlan = static::_createServicePlan(); + $servicePlan = static::createServicePlan(); $this->assertGreaterThan(0, $servicePlan->id); - static::$_client->servicePlan()->delete('id', $servicePlan->id); + static::$client->servicePlan()->delete('id', $servicePlan->id); } public function testDelete() { - $servicePlan = static::_createServicePlan(); - $result = static::$_client->servicePlan()->delete('id', $servicePlan->id); + $servicePlan = static::createServicePlan(); + $result = static::$client->servicePlan()->delete('id', $servicePlan->id); $this->assertTrue($result); } @@ -72,9 +72,9 @@ public function testCreateComplexServicePlan() ], ]; - $servicePlan = static::$_client->servicePlan()->create($properties); + $servicePlan = static::$client->servicePlan()->create($properties); $this->assertGreaterThan(0, $servicePlan->id); - static::$_client->servicePlan()->delete('id', $servicePlan->id); + static::$client->servicePlan()->delete('id', $servicePlan->id); } } diff --git a/tests/SessionTest.php b/tests/SessionAbstractTest.php similarity index 58% rename from tests/SessionTest.php rename to tests/SessionAbstractTest.php index 4486103f..e27d7fb3 100644 --- a/tests/SessionTest.php +++ b/tests/SessionAbstractTest.php @@ -3,11 +3,11 @@ namespace PleskXTest; -class SessionTest extends TestCase +class SessionAbstractTest extends AbstractTestCase { public function testCreate() { - $sessionToken = static::$_client->session()->create('admin', '127.0.0.1'); + $sessionToken = static::$client->session()->create('admin', '127.0.0.1'); $this->assertIsString($sessionToken); $this->assertGreaterThan(10, strlen($sessionToken)); @@ -15,8 +15,8 @@ public function testCreate() public function testGet() { - $sessionId = static::$_client->server()->createSession('admin', '127.0.0.1'); - $sessions = static::$_client->session()->get(); + $sessionId = static::$client->server()->createSession('admin', '127.0.0.1'); + $sessions = static::$client->session()->get(); $this->assertArrayHasKey($sessionId, $sessions); $sessionInfo = $sessions[$sessionId]; @@ -27,9 +27,9 @@ public function testGet() public function testTerminate() { - $sessionId = static::$_client->server()->createSession('admin', '127.0.0.1'); - static::$_client->session()->terminate($sessionId); - $sessions = static::$_client->session()->get(); + $sessionId = static::$client->server()->createSession('admin', '127.0.0.1'); + static::$client->session()->terminate($sessionId); + $sessions = static::$client->session()->get(); $this->assertArrayNotHasKey($sessionId, $sessions); } } diff --git a/tests/SiteTest.php b/tests/SiteAbstractTest.php similarity index 59% rename from tests/SiteTest.php rename to tests/SiteAbstractTest.php index c1f2703b..f3ca8a66 100644 --- a/tests/SiteTest.php +++ b/tests/SiteAbstractTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\KeyLimitChecker; -class SiteTest extends TestCase +class SiteAbstractTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; @@ -13,72 +13,72 @@ class SiteTest extends TestCase public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - static::$webspace = static::_createWebspace(); + static::$webspace = static::createWebspace(); } protected function setUp(): void { parent::setUp(); - $keyInfo = static::$_client->server()->getKeyInfo(); + $keyInfo = static::$client->server()->getKeyInfo(); if (!KeyLimitChecker::checkByType($keyInfo, KeyLimitChecker::LIMIT_DOMAINS, 2)) { $this->markTestSkipped('License does not allow to create more than 1 domain.'); } } - private function _createSite($name, array $properties = []) + private function createSite($name, array $properties = []) { $properties = array_merge([ 'name' => $name, 'webspace-id' => static::$webspace->id, ], $properties); - return static::$_client->site()->create($properties); + return static::$client->site()->create($properties); } public function testCreate() { - $site = $this->_createSite('addon.dom'); + $site = $this->createSite('addon.dom'); $this->assertIsNumeric($site->id); $this->assertGreaterThan(0, $site->id); - static::$_client->site()->delete('id', $site->id); + static::$client->site()->delete('id', $site->id); } public function testDelete() { - $site = $this->_createSite('addon.dom'); + $site = $this->createSite('addon.dom'); - $result = static::$_client->site()->delete('id', $site->id); + $result = static::$client->site()->delete('id', $site->id); $this->assertTrue($result); } public function testGet() { - $site = $this->_createSite('addon.dom'); + $site = $this->createSite('addon.dom'); - $siteInfo = static::$_client->site()->get('id', $site->id); + $siteInfo = static::$client->site()->get('id', $site->id); $this->assertEquals('addon.dom', $siteInfo->name); $this->assertMatchesRegularExpression("/^\d{4}-\d{2}-\d{2}$/", $siteInfo->creationDate); $this->assertEquals(36, strlen($siteInfo->guid)); $siteGuid = $siteInfo->guid; - $siteInfo = static::$_client->site()->get('guid', $siteGuid); + $siteInfo = static::$client->site()->get('guid', $siteGuid); $this->assertEquals($site->id, $siteInfo->id); - static::$_client->site()->delete('id', $site->id); + static::$client->site()->delete('id', $site->id); } public function testGetHostingWoHosting() { - $site = $this->_createSite('addon.dom'); + $site = $this->createSite('addon.dom'); - $siteHosting = static::$_client->site()->getHosting('id', $site->id); + $siteHosting = static::$client->site()->getHosting('id', $site->id); $this->assertNull($siteHosting); - static::$_client->site()->delete('id', $site->id); + static::$client->site()->delete('id', $site->id); } public function testGetHostingWithHosting() @@ -88,33 +88,33 @@ public function testGetHostingWithHosting() 'www_root' => 'addon.dom', ], ]; - $site = $this->_createSite('addon.dom', $properties); + $site = $this->createSite('addon.dom', $properties); - $siteHosting = static::$_client->site()->getHosting('id', $site->id); + $siteHosting = static::$client->site()->getHosting('id', $site->id); $this->assertArrayHasKey('www_root', $siteHosting->properties); $this->assertStringEndsWith('addon.dom', $siteHosting->properties['www_root']); - static::$_client->site()->delete('id', $site->id); + static::$client->site()->delete('id', $site->id); } public function testGetAll() { - $site = $this->_createSite('addon.dom'); - $site2 = $this->_createSite('addon2.dom'); + $site = $this->createSite('addon.dom'); + $site2 = $this->createSite('addon2.dom'); - $sitesInfo = static::$_client->site()->getAll(); + $sitesInfo = static::$client->site()->getAll(); $this->assertCount(2, $sitesInfo); $this->assertEquals('addon.dom', $sitesInfo[0]->name); $this->assertEquals('addon.dom', $sitesInfo[0]->asciiName); $this->assertEquals($site->id, $sitesInfo[0]->id); - static::$_client->site()->delete('id', $site->id); - static::$_client->site()->delete('id', $site2->id); + static::$client->site()->delete('id', $site->id); + static::$client->site()->delete('id', $site2->id); } public function testGetAllWithoutSites() { - $sitesInfo = static::$_client->site()->getAll(); + $sitesInfo = static::$client->site()->getAll(); $this->assertEmpty($sitesInfo); } } diff --git a/tests/SiteAliasAbstractTest.php b/tests/SiteAliasAbstractTest.php new file mode 100644 index 00000000..1a1b634d --- /dev/null +++ b/tests/SiteAliasAbstractTest.php @@ -0,0 +1,71 @@ +<?php +// Copyright 1999-2021. Plesk International GmbH. + +namespace PleskXTest; + +class SiteAliasAbstractTest extends AbstractTestCase +{ + /** @var \PleskX\Api\Struct\Webspace\Info */ + private static $webspace; + + public static function setUpBeforeClass(): void + { + parent::setUpBeforeClass(); + static::$webspace = static::createWebspace(); + } + + private function createSiteAlias($name, array $properties = []) + { + $properties = array_merge([ + 'name' => $name, + 'site-id' => static::$webspace->id, + ], $properties); + + return static::$client->siteAlias()->create($properties); + } + + public function testCreate() + { + $siteAlias = $this->createSiteAlias('alias.dom'); + + $this->assertIsNumeric($siteAlias->id); + $this->assertGreaterThan(0, $siteAlias->id); + + static::$client->siteAlias()->delete('id', $siteAlias->id); + } + + public function testDelete() + { + $siteAlias = $this->createSiteAlias('alias.dom'); + + $result = static::$client->siteAlias()->delete('id', $siteAlias->id); + $this->assertTrue($result); + } + + public function testGet() + { + $siteAlias = $this->createSiteAlias('alias.dom'); + + $siteAliasInfo = static::$client->siteAlias()->get('id', $siteAlias->id); + $this->assertEquals('alias.dom', $siteAliasInfo->name); + + static::$client->siteAlias()->delete('id', $siteAlias->id); + } + + public function testGetAll() + { + $siteAlias = $this->createSiteAlias('alias.dom'); + $siteAlias2 = $this->createSiteAlias('alias2.dom'); + + $siteAliasInfo = static::$client->siteAlias()->get('id', $siteAlias->id); + $this->assertEquals('alias.dom', $siteAliasInfo->name); + + $siteAliasesInfo = static::$client->siteAlias()->getAll('site-id', self::$webspace->id); + $this->assertCount(2, $siteAliasesInfo); + $this->assertEquals('alias.dom', $siteAliasesInfo[0]->name); + $this->assertEquals('alias.dom', $siteAliasesInfo[0]->asciiName); + + static::$client->siteAlias()->delete('id', $siteAlias->id); + static::$client->siteAlias()->delete('id', $siteAlias2->id); + } +} diff --git a/tests/SiteAliasTest.php b/tests/SiteAliasTest.php deleted file mode 100644 index 645fc861..00000000 --- a/tests/SiteAliasTest.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -// Copyright 1999-2021. Plesk International GmbH. - -namespace PleskXTest; - -class SiteAliasTest extends TestCase -{ - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; - - public static function setUpBeforeClass(): void - { - parent::setUpBeforeClass(); - static::$webspace = static::_createWebspace(); - } - - private function _createSiteAlias($name, array $properties = []) - { - $properties = array_merge([ - 'name' => $name, - 'site-id' => static::$webspace->id, - ], $properties); - - return static::$_client->siteAlias()->create($properties); - } - - public function testCreate() - { - $siteAlias = $this->_createSiteAlias('alias.dom'); - - $this->assertIsNumeric($siteAlias->id); - $this->assertGreaterThan(0, $siteAlias->id); - - static::$_client->siteAlias()->delete('id', $siteAlias->id); - } - - public function testDelete() - { - $siteAlias = $this->_createSiteAlias('alias.dom'); - - $result = static::$_client->siteAlias()->delete('id', $siteAlias->id); - $this->assertTrue($result); - } - - public function testGet() - { - $siteAlias = $this->_createSiteAlias('alias.dom'); - - $siteAliasInfo = static::$_client->siteAlias()->get('id', $siteAlias->id); - $this->assertEquals('alias.dom', $siteAliasInfo->name); - - static::$_client->siteAlias()->delete('id', $siteAlias->id); - } - - public function testGetAll() - { - $siteAlias = $this->_createSiteAlias('alias.dom'); - $siteAlias2 = $this->_createSiteAlias('alias2.dom'); - - $siteAliasInfo = static::$_client->siteAlias()->get('id', $siteAlias->id); - $this->assertEquals('alias.dom', $siteAliasInfo->name); - - $siteAliasesInfo = static::$_client->siteAlias()->getAll('site-id', self::$webspace->id); - $this->assertCount(2, $siteAliasesInfo); - $this->assertEquals('alias.dom', $siteAliasesInfo[0]->name); - $this->assertEquals('alias.dom', $siteAliasesInfo[0]->asciiName); - - static::$_client->siteAlias()->delete('id', $siteAlias->id); - static::$_client->siteAlias()->delete('id', $siteAlias2->id); - } -} diff --git a/tests/SubdomainTest.php b/tests/SubdomainAbstractTest.php similarity index 51% rename from tests/SubdomainTest.php rename to tests/SubdomainAbstractTest.php index bd75f9e9..3e452166 100644 --- a/tests/SubdomainTest.php +++ b/tests/SubdomainAbstractTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class SubdomainTest extends TestCase +class SubdomainAbstractTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; @@ -14,8 +14,8 @@ class SubdomainTest extends TestCase public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); - static::$webspace = static::_createWebspace(); - $webspaceInfo = static::$_client->webspace()->get('id', static::$webspace->id); + static::$webspace = static::createWebspace(); + $webspaceInfo = static::$client->webspace()->get('id', static::$webspace->id); static::$webspaceName = $webspaceInfo->name; } @@ -24,9 +24,9 @@ public static function setUpBeforeClass(): void * * @return \PleskX\Api\Struct\Subdomain\Info */ - private function _createSubdomain($name) + private function createSubdomain(string $name) { - return static::$_client->subdomain()->create([ + return static::$client->subdomain()->create([ 'parent' => static::$webspaceName, 'name' => $name, 'property' => [ @@ -37,53 +37,53 @@ private function _createSubdomain($name) public function testCreate() { - $subdomain = $this->_createSubdomain('sub'); + $subdomain = $this->createSubdomain('sub'); $this->assertIsInt($subdomain->id); $this->assertGreaterThan(0, $subdomain->id); - static::$_client->subdomain()->delete('id', $subdomain->id); + static::$client->subdomain()->delete('id', $subdomain->id); } public function testDelete() { - $subdomain = $this->_createSubdomain('sub'); + $subdomain = $this->createSubdomain('sub'); - $result = static::$_client->subdomain()->delete('id', $subdomain->id); + $result = static::$client->subdomain()->delete('id', $subdomain->id); $this->assertTrue($result); } public function testGet() { $name = 'sub'; - $subdomain = $this->_createSubdomain($name); + $subdomain = $this->createSubdomain($name); - $subdomainInfo = static::$_client->subdomain()->get('id', $subdomain->id); - $this->assertEquals($name.'.'.$subdomainInfo->parent, $subdomainInfo->name); + $subdomainInfo = static::$client->subdomain()->get('id', $subdomain->id); + $this->assertEquals($name . '.' . $subdomainInfo->parent, $subdomainInfo->name); $this->assertTrue(false !== strpos($subdomainInfo->properties['www_root'], $name)); $this->assertEquals($subdomain->id, $subdomainInfo->id); - static::$_client->subdomain()->delete('id', $subdomain->id); + static::$client->subdomain()->delete('id', $subdomain->id); } public function testGetAll() { $name = 'sub'; $name2 = 'sub2'; - $subdomain = $this->_createSubdomain($name); - $subdomain2 = $this->_createSubdomain($name2); + $subdomain = $this->createSubdomain($name); + $subdomain2 = $this->createSubdomain($name2); - $subdomainsInfo = static::$_client->subdomain()->getAll(); + $subdomainsInfo = static::$client->subdomain()->getAll(); $this->assertCount(2, $subdomainsInfo); - $this->assertEquals($name.'.'.$subdomainsInfo[0]->parent, $subdomainsInfo[0]->name); + $this->assertEquals($name . '.' . $subdomainsInfo[0]->parent, $subdomainsInfo[0]->name); $this->assertTrue(false !== strpos($subdomainsInfo[0]->properties['www_root'], $name)); - $this->assertEquals($name2.'.'.$subdomainsInfo[1]->parent, $subdomainsInfo[1]->name); + $this->assertEquals($name2 . '.' . $subdomainsInfo[1]->parent, $subdomainsInfo[1]->name); $this->assertTrue(false !== strpos($subdomainsInfo[1]->properties['www_root'], $name2)); - static::$_client->subdomain()->delete('id', $subdomain->id); - static::$_client->subdomain()->delete('id', $subdomain2->id); + static::$client->subdomain()->delete('id', $subdomain->id); + static::$client->subdomain()->delete('id', $subdomain2->id); - $subdomainsInfo = static::$_client->subdomain()->getAll(); + $subdomainsInfo = static::$client->subdomain()->getAll(); $this->assertEmpty($subdomainsInfo); } } diff --git a/tests/UiTest.php b/tests/UiAbstractTest.php similarity index 59% rename from tests/UiTest.php rename to tests/UiAbstractTest.php index 6b997653..3e8ce04c 100644 --- a/tests/UiTest.php +++ b/tests/UiAbstractTest.php @@ -3,9 +3,9 @@ namespace PleskXTest; -class UiTest extends TestCase +class UiAbstractTest extends AbstractTestCase { - private $_customButtonProperties = [ + private array $customButtonProperties = [ 'place' => 'admin', 'url' => 'http://example.com', 'text' => 'Example site', @@ -13,7 +13,7 @@ class UiTest extends TestCase public function testGetNavigation() { - $navigation = static::$_client->ui()->getNavigation(); + $navigation = static::$client->ui()->getNavigation(); $this->assertIsArray($navigation); $this->assertGreaterThan(0, count($navigation)); $this->assertArrayHasKey('general', $navigation); @@ -27,26 +27,26 @@ public function testGetNavigation() public function testCreateCustomButton() { - $buttonId = static::$_client->ui()->createCustomButton('admin', $this->_customButtonProperties); + $buttonId = static::$client->ui()->createCustomButton('admin', $this->customButtonProperties); $this->assertGreaterThan(0, $buttonId); - static::$_client->ui()->deleteCustomButton($buttonId); + static::$client->ui()->deleteCustomButton($buttonId); } public function testGetCustomButton() { - $buttonId = static::$_client->ui()->createCustomButton('admin', $this->_customButtonProperties); - $customButtonInfo = static::$_client->ui()->getCustomButton($buttonId); + $buttonId = static::$client->ui()->createCustomButton('admin', $this->customButtonProperties); + $customButtonInfo = static::$client->ui()->getCustomButton($buttonId); $this->assertEquals('http://example.com', $customButtonInfo->url); $this->assertEquals('Example site', $customButtonInfo->text); - static::$_client->ui()->deleteCustomButton($buttonId); + static::$client->ui()->deleteCustomButton($buttonId); } public function testDeleteCustomButton() { - $buttonId = static::$_client->ui()->createCustomButton('admin', $this->_customButtonProperties); - $result = static::$_client->ui()->deleteCustomButton($buttonId); + $buttonId = static::$client->ui()->createCustomButton('admin', $this->customButtonProperties); + $result = static::$client->ui()->deleteCustomButton($buttonId); $this->assertTrue($result); } } diff --git a/tests/Utility/KeyLimitChecker.php b/tests/Utility/KeyLimitChecker.php index 46951147..851e577f 100644 --- a/tests/Utility/KeyLimitChecker.php +++ b/tests/Utility/KeyLimitChecker.php @@ -5,9 +5,9 @@ class KeyLimitChecker { - const LIMIT_CLIENTS = 'limit_clients'; - const LIMIT_RESELLERS = 'limit_resellers'; - const LIMIT_DOMAINS = 'limit_domains'; + public const LIMIT_CLIENTS = 'limit_clients'; + public const LIMIT_RESELLERS = 'limit_resellers'; + public const LIMIT_DOMAINS = 'limit_domains'; /** * Checks whether limit is within the required constraint. diff --git a/tests/Utility/PasswordProvider.php b/tests/Utility/PasswordProvider.php index 1c306aa2..22bd737e 100644 --- a/tests/Utility/PasswordProvider.php +++ b/tests/Utility/PasswordProvider.php @@ -5,5 +5,5 @@ class PasswordProvider { - const STRONG_PASSWORD = 'test-&PWD*1@42!13#'; + public const STRONG_PASSWORD = 'test-&PWD*1@42!13#'; } diff --git a/tests/WebspaceTest.php b/tests/WebspaceAbstractTest.php similarity index 66% rename from tests/WebspaceTest.php rename to tests/WebspaceAbstractTest.php index af04b3e4..abe4fe0f 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceAbstractTest.php @@ -5,35 +5,35 @@ use PleskXTest\Utility\PasswordProvider; -class WebspaceTest extends TestCase +class WebspaceAbstractTest extends AbstractTestCase { public function testGetPermissionDescriptor() { - $descriptor = static::$_client->webspace()->getPermissionDescriptor(); + $descriptor = static::$client->webspace()->getPermissionDescriptor(); $this->assertIsArray($descriptor->permissions); $this->assertNotEmpty($descriptor->permissions); } public function testGetLimitDescriptor() { - $descriptor = static::$_client->webspace()->getLimitDescriptor(); + $descriptor = static::$client->webspace()->getLimitDescriptor(); $this->assertIsArray($descriptor->limits); $this->assertNotEmpty($descriptor->limits); } public function testGetDiskUsage() { - $webspace = static::_createWebspace(); - $diskusage = static::$_client->webspace()->getDiskUsage('id', $webspace->id); + $webspace = static::createWebspace(); + $diskusage = static::$client->webspace()->getDiskUsage('id', $webspace->id); $this->assertObjectHasAttribute('httpdocs', $diskusage); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testGetPhysicalHostingDescriptor() { - $descriptor = static::$_client->webspace()->getPhysicalHostingDescriptor(); + $descriptor = static::$client->webspace()->getPhysicalHostingDescriptor(); $this->assertIsArray($descriptor->properties); $this->assertNotEmpty($descriptor->properties); @@ -44,53 +44,53 @@ public function testGetPhysicalHostingDescriptor() public function testGetPhpSettings() { - $webspace = static::_createWebspace(); - $info = static::$_client->webspace()->getPhpSettings('id', $webspace->id); + $webspace = static::createWebspace(); + $info = static::$client->webspace()->getPhpSettings('id', $webspace->id); $this->assertArrayHasKey('open_basedir', $info->properties); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testGetLimits() { - $webspace = static::_createWebspace(); - $limits = static::$_client->webspace()->getLimits('id', $webspace->id); + $webspace = static::createWebspace(); + $limits = static::$client->webspace()->getLimits('id', $webspace->id); $this->assertIsArray($limits->limits); $this->assertNotEmpty($limits->limits); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testCreateWebspace() { - $webspace = static::_createWebspace(); + $webspace = static::createWebspace(); $this->assertGreaterThan(0, $webspace->id); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testDelete() { - $webspace = static::_createWebspace(); - $result = static::$_client->webspace()->delete('id', $webspace->id); + $webspace = static::createWebspace(); + $result = static::$client->webspace()->delete('id', $webspace->id); $this->assertTrue($result); } public function testDeleteByName() { - $webspace = static::_createWebspace(); - $result = static::$_client->webspace()->delete('name', $webspace->name); + $webspace = static::createWebspace(); + $result = static::$client->webspace()->delete('name', $webspace->name); $this->assertTrue($result); } public function testRequestCreateWebspace() { - $handlers = static::$_client->phpHandler()->getAll(); + $handlers = static::$client->phpHandler()->getAll(); $enabledHandlers = array_filter($handlers, function ($handler) { return $handler->handlerStatus !== 'disabled'; }); @@ -103,7 +103,7 @@ public function testRequestCreateWebspace() 'name' => 'webspace-test-full.test', 'htype' => 'vrt_hst', 'status' => '0', - 'ip_address' => [static::_getIpAddress()], + 'ip_address' => [static::getIpAddress()], ], 'hosting' => [ 'vrt_hst' => [ @@ -121,7 +121,7 @@ public function testRequestCreateWebspace() 'value' => PasswordProvider::STRONG_PASSWORD, ], ], - 'ip_address' => static::_getIpAddress(), + 'ip_address' => static::getIpAddress(), ], ], 'limits' => [ @@ -165,17 +165,17 @@ public function testRequestCreateWebspace() ], ]; - $webspace = static::$_client->webspace()->request($request); + $webspace = static::$client->webspace()->request($request); $this->assertGreaterThan(0, $webspace->id); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testGet() { - $webspace = static::_createWebspace(); - $webspaceInfo = static::$_client->webspace()->get('id', $webspace->id); + $webspace = static::createWebspace(); + $webspaceInfo = static::$client->webspace()->get('id', $webspace->id); $this->assertNotEmpty($webspaceInfo->name); $this->assertEquals(0, $webspaceInfo->realSize); @@ -185,41 +185,41 @@ public function testGet() $this->assertMatchesRegularExpression("/^\d{4}-\d{2}-\d{2}$/", $webspaceInfo->creationDate); $this->assertEquals($webspace->id, $webspaceInfo->id); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testEnable() { - $webspace = static::_createWebspace(); + $webspace = static::createWebspace(); - static::$_client->webspace()->disable('id', $webspace->id); - static::$_client->webspace()->enable('id', $webspace->id); - $webspaceInfo = static::$_client->webspace()->get('id', $webspace->id); + static::$client->webspace()->disable('id', $webspace->id); + static::$client->webspace()->enable('id', $webspace->id); + $webspaceInfo = static::$client->webspace()->get('id', $webspace->id); $this->assertTrue($webspaceInfo->enabled); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testDisable() { - $webspace = static::_createWebspace(); + $webspace = static::createWebspace(); - static::$_client->webspace()->disable('id', $webspace->id); - $webspaceInfo = static::$_client->webspace()->get('id', $webspace->id); + static::$client->webspace()->disable('id', $webspace->id); + $webspaceInfo = static::$client->webspace()->get('id', $webspace->id); $this->assertFalse($webspaceInfo->enabled); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } public function testSetProperties() { - $webspace = static::_createWebspace(); - static::$_client->webspace()->setProperties('id', $webspace->id, [ + $webspace = static::createWebspace(); + static::$client->webspace()->setProperties('id', $webspace->id, [ 'description' => 'Test Description', ]); - $webspaceInfo = static::$_client->webspace()->get('id', $webspace->id); + $webspaceInfo = static::$client->webspace()->get('id', $webspace->id); $this->assertEquals('Test Description', $webspaceInfo->description); - static::$_client->webspace()->delete('id', $webspace->id); + static::$client->webspace()->delete('id', $webspace->id); } } From ebeace71ea435501c5847f7753aea0c3e71d2daf Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <sibprogrammer@gmail.com> Date: Tue, 26 Oct 2021 23:11:53 +0700 Subject: [PATCH 61/73] Replace StyleCI with phpcs --- .styleci.yml | 6 ------ README.md | 1 - composer.json | 5 ++++- 3 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 .styleci.yml diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 518d094f..00000000 --- a/.styleci.yml +++ /dev/null @@ -1,6 +0,0 @@ -preset: recommended - -disabled: - - align_double_arrow - - phpdoc_align - - blank_line_after_opening_tag diff --git a/README.md b/README.md index ac6c2e9d..25fa379a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Test Status](https://github.com/plesk/api-php-lib/actions/workflows/test.yml/badge.svg)](https://github.com/plesk/api-php-lib/actions/workflows/test.yml) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/plesk/api-php-lib/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/plesk/api-php-lib/?branch=master) -[![StyleCI](https://styleci.io/repos/26514840/shield?branch=master)](https://styleci.io/repos/26514840) [![codecov](https://codecov.io/gh/plesk/api-php-lib/branch/master/graph/badge.svg?token=5Kwbddpdeb)](https://codecov.io/gh/plesk/api-php-lib) PHP object-oriented library for Plesk XML-RPC API. diff --git a/composer.json b/composer.json index 6bc965b5..ef6f9710 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,10 @@ "scripts": { "test": "phpunit", "test:watch": "phpunit-watcher watch", - "lint": "psalm" + "lint": [ + "psalm", + "phpcs" + ] }, "autoload": { "psr-4": { From 639560d3884a14e9c9f139e1fa6cdaa09b5bc993 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 27 Oct 2021 10:42:48 +0700 Subject: [PATCH 62/73] Fix test class names due to incorrect automatic refactoring --- tests/{ApiClientAbstractTest.php => ApiClientTest.php} | 2 +- tests/{CertificateAbstractTest.php => CertificateTest.php} | 2 +- tests/{CustomerAbstractTest.php => CustomerTest.php} | 2 +- .../{DatabaseServerAbstractTest.php => DatabaseServerTest.php} | 2 +- tests/{DatabaseAbstractTest.php => DatabaseTest.php} | 2 +- tests/{DnsTemplateAbstractTest.php => DnsTemplateTest.php} | 2 +- tests/{DnsAbstractTest.php => DnsTest.php} | 2 +- tests/{EventLogAbstractTest.php => EventLogTest.php} | 2 +- tests/{IpAbstractTest.php => IpTest.php} | 2 +- tests/{LocaleAbstractTest.php => LocaleTest.php} | 2 +- tests/{MailAbstractTest.php => MailTest.php} | 2 +- tests/{PhpHandlerAbstractTest.php => PhpHandlerTest.php} | 2 +- ...ctedDirectoryAbstractTest.php => ProtectedDirectoryTest.php} | 2 +- tests/{ResellerAbstractTest.php => ResellerTest.php} | 2 +- tests/{SecretKeyAbstractTest.php => SecretKeyTest.php} | 2 +- tests/{ServerAbstractTest.php => ServerTest.php} | 2 +- tests/{ServicePlanAbstractTest.php => ServicePlanTest.php} | 2 +- tests/{SessionAbstractTest.php => SessionTest.php} | 2 +- tests/{SiteAliasAbstractTest.php => SiteAliasTest.php} | 2 +- tests/{SiteAbstractTest.php => SiteTest.php} | 2 +- tests/{SubdomainAbstractTest.php => SubdomainTest.php} | 2 +- tests/{UiAbstractTest.php => UiTest.php} | 2 +- tests/{WebspaceAbstractTest.php => WebspaceTest.php} | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) rename tests/{ApiClientAbstractTest.php => ApiClientTest.php} (99%) rename tests/{CertificateAbstractTest.php => CertificateTest.php} (93%) rename tests/{CustomerAbstractTest.php => CustomerTest.php} (98%) rename tests/{DatabaseServerAbstractTest.php => DatabaseServerTest.php} (93%) rename tests/{DatabaseAbstractTest.php => DatabaseTest.php} (99%) rename tests/{DnsTemplateAbstractTest.php => DnsTemplateTest.php} (97%) rename tests/{DnsAbstractTest.php => DnsTest.php} (99%) rename tests/{EventLogAbstractTest.php => EventLogTest.php} (93%) rename tests/{IpAbstractTest.php => IpTest.php} (88%) rename tests/{LocaleAbstractTest.php => LocaleTest.php} (90%) rename tests/{MailAbstractTest.php => MailTest.php} (98%) rename tests/{PhpHandlerAbstractTest.php => PhpHandlerTest.php} (94%) rename tests/{ProtectedDirectoryAbstractTest.php => ProtectedDirectoryTest.php} (97%) rename tests/{ResellerAbstractTest.php => ResellerTest.php} (98%) rename tests/{SecretKeyAbstractTest.php => SecretKeyTest.php} (98%) rename tests/{ServerAbstractTest.php => ServerTest.php} (98%) rename tests/{ServicePlanAbstractTest.php => ServicePlanTest.php} (97%) rename tests/{SessionAbstractTest.php => SessionTest.php} (95%) rename tests/{SiteAliasAbstractTest.php => SiteAliasTest.php} (97%) rename tests/{SiteAbstractTest.php => SiteTest.php} (98%) rename tests/{SubdomainAbstractTest.php => SubdomainTest.php} (98%) rename tests/{UiAbstractTest.php => UiTest.php} (97%) rename tests/{WebspaceAbstractTest.php => WebspaceTest.php} (99%) diff --git a/tests/ApiClientAbstractTest.php b/tests/ApiClientTest.php similarity index 99% rename from tests/ApiClientAbstractTest.php rename to tests/ApiClientTest.php index e1943349..7931731b 100644 --- a/tests/ApiClientAbstractTest.php +++ b/tests/ApiClientTest.php @@ -5,7 +5,7 @@ use PleskX\Api\Client\Exception; -class ApiClientAbstractTest extends AbstractTestCase +class ApiClientTest extends AbstractTestCase { public function testWrongProtocol() { diff --git a/tests/CertificateAbstractTest.php b/tests/CertificateTest.php similarity index 93% rename from tests/CertificateAbstractTest.php rename to tests/CertificateTest.php index b83c0979..fbb94a16 100644 --- a/tests/CertificateAbstractTest.php +++ b/tests/CertificateTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class CertificateAbstractTest extends AbstractTestCase +class CertificateTest extends AbstractTestCase { public function testGenerate() { diff --git a/tests/CustomerAbstractTest.php b/tests/CustomerTest.php similarity index 98% rename from tests/CustomerAbstractTest.php rename to tests/CustomerTest.php index 428e44cc..5cffa152 100644 --- a/tests/CustomerAbstractTest.php +++ b/tests/CustomerTest.php @@ -6,7 +6,7 @@ use PleskXTest\Utility\KeyLimitChecker; use PleskXTest\Utility\PasswordProvider; -class CustomerAbstractTest extends AbstractTestCase +class CustomerTest extends AbstractTestCase { private array $customerProperties; diff --git a/tests/DatabaseServerAbstractTest.php b/tests/DatabaseServerTest.php similarity index 93% rename from tests/DatabaseServerAbstractTest.php rename to tests/DatabaseServerTest.php index a6288188..71b2e2f3 100644 --- a/tests/DatabaseServerAbstractTest.php +++ b/tests/DatabaseServerTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class DatabaseServerAbstractTest extends AbstractTestCase +class DatabaseServerTest extends AbstractTestCase { public function testGetSupportedTypes() { diff --git a/tests/DatabaseAbstractTest.php b/tests/DatabaseTest.php similarity index 99% rename from tests/DatabaseAbstractTest.php rename to tests/DatabaseTest.php index c02632b7..50075e6e 100644 --- a/tests/DatabaseAbstractTest.php +++ b/tests/DatabaseTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\PasswordProvider; -class DatabaseAbstractTest extends AbstractTestCase +class DatabaseTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; diff --git a/tests/DnsTemplateAbstractTest.php b/tests/DnsTemplateTest.php similarity index 97% rename from tests/DnsTemplateAbstractTest.php rename to tests/DnsTemplateTest.php index e7536bc6..69b06d0a 100644 --- a/tests/DnsTemplateAbstractTest.php +++ b/tests/DnsTemplateTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class DnsTemplateAbstractTest extends AbstractTestCase +class DnsTemplateTest extends AbstractTestCase { private static bool $isDnsSupported; diff --git a/tests/DnsAbstractTest.php b/tests/DnsTest.php similarity index 99% rename from tests/DnsAbstractTest.php rename to tests/DnsTest.php index ec63f766..1ab6f746 100644 --- a/tests/DnsAbstractTest.php +++ b/tests/DnsTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class DnsAbstractTest extends AbstractTestCase +class DnsTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; diff --git a/tests/EventLogAbstractTest.php b/tests/EventLogTest.php similarity index 93% rename from tests/EventLogAbstractTest.php rename to tests/EventLogTest.php index 283dd25a..bf2eb28b 100644 --- a/tests/EventLogAbstractTest.php +++ b/tests/EventLogTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class EventLogAbstractTest extends AbstractTestCase +class EventLogTest extends AbstractTestCase { public function testGet() { diff --git a/tests/IpAbstractTest.php b/tests/IpTest.php similarity index 88% rename from tests/IpAbstractTest.php rename to tests/IpTest.php index c6147fc1..a9bc70f4 100644 --- a/tests/IpAbstractTest.php +++ b/tests/IpTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class IpAbstractTest extends AbstractTestCase +class IpTest extends AbstractTestCase { public function testGet() { diff --git a/tests/LocaleAbstractTest.php b/tests/LocaleTest.php similarity index 90% rename from tests/LocaleAbstractTest.php rename to tests/LocaleTest.php index be3bc07b..a9a480a7 100644 --- a/tests/LocaleAbstractTest.php +++ b/tests/LocaleTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class LocaleAbstractTest extends AbstractTestCase +class LocaleTest extends AbstractTestCase { public function testGet() { diff --git a/tests/MailAbstractTest.php b/tests/MailTest.php similarity index 98% rename from tests/MailAbstractTest.php rename to tests/MailTest.php index f6370160..5e48e516 100644 --- a/tests/MailAbstractTest.php +++ b/tests/MailTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\PasswordProvider; -class MailAbstractTest extends AbstractTestCase +class MailTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; diff --git a/tests/PhpHandlerAbstractTest.php b/tests/PhpHandlerTest.php similarity index 94% rename from tests/PhpHandlerAbstractTest.php rename to tests/PhpHandlerTest.php index f950e057..8c94c08e 100644 --- a/tests/PhpHandlerAbstractTest.php +++ b/tests/PhpHandlerTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class PhpHandlerAbstractTest extends AbstractTestCase +class PhpHandlerTest extends AbstractTestCase { public function testGet() { diff --git a/tests/ProtectedDirectoryAbstractTest.php b/tests/ProtectedDirectoryTest.php similarity index 97% rename from tests/ProtectedDirectoryAbstractTest.php rename to tests/ProtectedDirectoryTest.php index 0b94f85d..6fb76de2 100644 --- a/tests/ProtectedDirectoryAbstractTest.php +++ b/tests/ProtectedDirectoryTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\PasswordProvider; -class ProtectedDirectoryAbstractTest extends AbstractTestCase +class ProtectedDirectoryTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; diff --git a/tests/ResellerAbstractTest.php b/tests/ResellerTest.php similarity index 98% rename from tests/ResellerAbstractTest.php rename to tests/ResellerTest.php index db404fef..025a77a7 100644 --- a/tests/ResellerAbstractTest.php +++ b/tests/ResellerTest.php @@ -6,7 +6,7 @@ use PleskXTest\Utility\KeyLimitChecker; use PleskXTest\Utility\PasswordProvider; -class ResellerAbstractTest extends AbstractTestCase +class ResellerTest extends AbstractTestCase { private array $resellerProperties; diff --git a/tests/SecretKeyAbstractTest.php b/tests/SecretKeyTest.php similarity index 98% rename from tests/SecretKeyAbstractTest.php rename to tests/SecretKeyTest.php index e2704280..be5dd1b7 100644 --- a/tests/SecretKeyAbstractTest.php +++ b/tests/SecretKeyTest.php @@ -5,7 +5,7 @@ use PleskX\Api\Exception; -class SecretKeyAbstractTest extends AbstractTestCase +class SecretKeyTest extends AbstractTestCase { public function testCreate() { diff --git a/tests/ServerAbstractTest.php b/tests/ServerTest.php similarity index 98% rename from tests/ServerAbstractTest.php rename to tests/ServerTest.php index 73befea3..217d2315 100644 --- a/tests/ServerAbstractTest.php +++ b/tests/ServerTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class ServerAbstractTest extends AbstractTestCase +class ServerTest extends AbstractTestCase { public function testGetProtos() { diff --git a/tests/ServicePlanAbstractTest.php b/tests/ServicePlanTest.php similarity index 97% rename from tests/ServicePlanAbstractTest.php rename to tests/ServicePlanTest.php index d6f72605..56bc96c0 100644 --- a/tests/ServicePlanAbstractTest.php +++ b/tests/ServicePlanTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class ServicePlanAbstractTest extends AbstractTestCase +class ServicePlanTest extends AbstractTestCase { public function testGet() { diff --git a/tests/SessionAbstractTest.php b/tests/SessionTest.php similarity index 95% rename from tests/SessionAbstractTest.php rename to tests/SessionTest.php index e27d7fb3..a0a42faf 100644 --- a/tests/SessionAbstractTest.php +++ b/tests/SessionTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class SessionAbstractTest extends AbstractTestCase +class SessionTest extends AbstractTestCase { public function testCreate() { diff --git a/tests/SiteAliasAbstractTest.php b/tests/SiteAliasTest.php similarity index 97% rename from tests/SiteAliasAbstractTest.php rename to tests/SiteAliasTest.php index 1a1b634d..64da0a53 100644 --- a/tests/SiteAliasAbstractTest.php +++ b/tests/SiteAliasTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class SiteAliasAbstractTest extends AbstractTestCase +class SiteAliasTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; diff --git a/tests/SiteAbstractTest.php b/tests/SiteTest.php similarity index 98% rename from tests/SiteAbstractTest.php rename to tests/SiteTest.php index f3ca8a66..0dc091f8 100644 --- a/tests/SiteAbstractTest.php +++ b/tests/SiteTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\KeyLimitChecker; -class SiteAbstractTest extends AbstractTestCase +class SiteTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; diff --git a/tests/SubdomainAbstractTest.php b/tests/SubdomainTest.php similarity index 98% rename from tests/SubdomainAbstractTest.php rename to tests/SubdomainTest.php index 3e452166..474dbba8 100644 --- a/tests/SubdomainAbstractTest.php +++ b/tests/SubdomainTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class SubdomainAbstractTest extends AbstractTestCase +class SubdomainTest extends AbstractTestCase { /** @var \PleskX\Api\Struct\Webspace\Info */ private static $webspace; diff --git a/tests/UiAbstractTest.php b/tests/UiTest.php similarity index 97% rename from tests/UiAbstractTest.php rename to tests/UiTest.php index 3e8ce04c..03a3d44e 100644 --- a/tests/UiAbstractTest.php +++ b/tests/UiTest.php @@ -3,7 +3,7 @@ namespace PleskXTest; -class UiAbstractTest extends AbstractTestCase +class UiTest extends AbstractTestCase { private array $customButtonProperties = [ 'place' => 'admin', diff --git a/tests/WebspaceAbstractTest.php b/tests/WebspaceTest.php similarity index 99% rename from tests/WebspaceAbstractTest.php rename to tests/WebspaceTest.php index abe4fe0f..01e63323 100644 --- a/tests/WebspaceAbstractTest.php +++ b/tests/WebspaceTest.php @@ -5,7 +5,7 @@ use PleskXTest\Utility\PasswordProvider; -class WebspaceAbstractTest extends AbstractTestCase +class WebspaceTest extends AbstractTestCase { public function testGetPermissionDescriptor() { From bd32dba37e56bb5a3f36118145d4729fbc6838b3 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 27 Oct 2021 11:16:54 +0700 Subject: [PATCH 63/73] Replace docblock with type hints in tests to enforce type checks --- tests/AbstractTestCase.php | 25 ++++++++++--------------- tests/DatabaseTest.php | 17 +++-------------- tests/DnsTest.php | 12 +++++------- tests/MailTest.php | 9 ++------- tests/ProtectedDirectoryTest.php | 3 +-- tests/SiteAliasTest.php | 5 ++--- tests/SiteTest.php | 5 ++--- tests/SubdomainTest.php | 14 +++----------- 8 files changed, 28 insertions(+), 62 deletions(-) diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index 435ca224..f25f8b03 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -3,15 +3,16 @@ namespace PleskXTest; +use PHPUnit\Framework\TestCase; +use PleskX\Api\Client; use PleskXTest\Utility\PasswordProvider; -abstract class AbstractTestCase extends \PHPUnit\Framework\TestCase +abstract class AbstractTestCase extends TestCase { - /** @var \PleskX\Api\Client */ - protected static $client; + protected static Client $client; - private static $webspaces = []; - private static $servicePlans = []; + private static array $webspaces = []; + private static array $servicePlans = []; public static function setUpBeforeClass(): void { @@ -27,7 +28,7 @@ public static function setUpBeforeClass(): void list($host, $port, $scheme) = [$parsedUrl['host'], $parsedUrl['port'], $parsedUrl['scheme']]; } - static::$client = new \PleskX\Api\Client($host, $port, $scheme); + static::$client = new Client($host, $port, $scheme); static::$client->setCredentials($login, $password); $proxy = getenv('REMOTE_PROXY'); @@ -55,10 +56,7 @@ public static function tearDownAfterClass(): void } } - /** - * @return string - */ - protected static function getIpAddress() + protected static function getIpAddress(): string { $ips = static::$client->ip()->get(); $ipInfo = reset($ips); @@ -66,10 +64,7 @@ protected static function getIpAddress() return $ipInfo->ipAddress; } - /** - * @return \PleskX\Api\Struct\Webspace\Info - */ - protected static function createWebspace() + protected static function createWebspace(): \PleskX\Api\Struct\Webspace\Info { $id = uniqid(); $webspace = static::$client->webspace()->create( @@ -87,7 +82,7 @@ protected static function createWebspace() return $webspace; } - protected static function createServicePlan() + protected static function createServicePlan(): \PleskX\Api\Struct\ServicePlan\Info { $id = uniqid(); $servicePlan = static::$client->servicePlan()->create(['name' => "test{$id}plan"]); diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index 50075e6e..f87ef721 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -7,8 +7,7 @@ class DatabaseTest extends AbstractTestCase { - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; + private static \PleskX\Api\Struct\Webspace\Info $webspace; public static function setUpBeforeClass(): void { @@ -207,12 +206,7 @@ public function testDeleteUser() static::$client->database()->delete('id', $database->id); } - /** - * @param array $params - * - * @return \PleskX\Api\Struct\Database\Info - */ - private function createDatabase(array $params) + private function createDatabase(array $params): \PleskX\Api\Struct\Database\Info { $database = static::$client->database()->create($params); $this->assertIsInt($database->id); @@ -221,12 +215,7 @@ private function createDatabase(array $params) return $database; } - /** - * @param array $params - * - * @return \PleskX\Api\Struct\Database\UserInfo - */ - private function createUser(array $params) + private function createUser(array $params): \PleskX\Api\Struct\Database\UserInfo { $user = static::$client->database()->createUser($params); $this->assertIsInt($user->id); diff --git a/tests/DnsTest.php b/tests/DnsTest.php index 1ab6f746..b7f84fee 100644 --- a/tests/DnsTest.php +++ b/tests/DnsTest.php @@ -5,10 +5,8 @@ class DnsTest extends AbstractTestCase { - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; - - private static $isDnsSupported; + private static \PleskX\Api\Struct\Webspace\Info $webspace; + private static bool $isDnsSupported; public static function setUpBeforeClass(): void { @@ -45,9 +43,9 @@ public function testCreate() } /** - * @return \PleskX\Api\XmlResponse[] + * @return \SimpleXMLElement[] */ - public function testBulkCreate() + public function testBulkCreate(): array { $response = static::$client->dns()->bulkCreate([ [ @@ -84,7 +82,7 @@ public function testBulkCreate() /** * @depends testBulkCreate * - * @param \PleskX\Api\XmlResponse[] $createdRecords + * @param \SimpleXMLElement[] $createdRecords */ public function testBulkDelete(array $createdRecords) { diff --git a/tests/MailTest.php b/tests/MailTest.php index 5e48e516..4afd05ff 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -7,13 +7,8 @@ class MailTest extends AbstractTestCase { - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; - - /** - * @var bool - */ - private static $isMailSupported; + private static \PleskX\Api\Struct\Webspace\Info $webspace; + private static bool $isMailSupported; public static function setUpBeforeClass(): void { diff --git a/tests/ProtectedDirectoryTest.php b/tests/ProtectedDirectoryTest.php index 6fb76de2..319c079b 100644 --- a/tests/ProtectedDirectoryTest.php +++ b/tests/ProtectedDirectoryTest.php @@ -7,8 +7,7 @@ class ProtectedDirectoryTest extends AbstractTestCase { - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; + private static \PleskX\Api\Struct\Webspace\Info $webspace; public static function setUpBeforeClass(): void { diff --git a/tests/SiteAliasTest.php b/tests/SiteAliasTest.php index 64da0a53..4538d104 100644 --- a/tests/SiteAliasTest.php +++ b/tests/SiteAliasTest.php @@ -5,8 +5,7 @@ class SiteAliasTest extends AbstractTestCase { - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; + private static \PleskX\Api\Struct\Webspace\Info $webspace; public static function setUpBeforeClass(): void { @@ -14,7 +13,7 @@ public static function setUpBeforeClass(): void static::$webspace = static::createWebspace(); } - private function createSiteAlias($name, array $properties = []) + private function createSiteAlias($name, array $properties = []): \PleskX\Api\Struct\SiteAlias\Info { $properties = array_merge([ 'name' => $name, diff --git a/tests/SiteTest.php b/tests/SiteTest.php index 0dc091f8..f53f1f52 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -7,8 +7,7 @@ class SiteTest extends AbstractTestCase { - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; + private static \PleskX\Api\Struct\Webspace\Info $webspace; public static function setUpBeforeClass(): void { @@ -27,7 +26,7 @@ protected function setUp(): void } } - private function createSite($name, array $properties = []) + private function createSite($name, array $properties = []): \PleskX\Api\Struct\Site\Info { $properties = array_merge([ 'name' => $name, diff --git a/tests/SubdomainTest.php b/tests/SubdomainTest.php index 474dbba8..8b5e1752 100644 --- a/tests/SubdomainTest.php +++ b/tests/SubdomainTest.php @@ -5,11 +5,8 @@ class SubdomainTest extends AbstractTestCase { - /** @var \PleskX\Api\Struct\Webspace\Info */ - private static $webspace; - - /** @var string */ - private static $webspaceName; + private static \PleskX\Api\Struct\Webspace\Info $webspace; + private static string $webspaceName; public static function setUpBeforeClass(): void { @@ -19,12 +16,7 @@ public static function setUpBeforeClass(): void static::$webspaceName = $webspaceInfo->name; } - /** - * @param string $name - * - * @return \PleskX\Api\Struct\Subdomain\Info - */ - private function createSubdomain(string $name) + private function createSubdomain(string $name): \PleskX\Api\Struct\Subdomain\Info { return static::$client->subdomain()->create([ 'parent' => static::$webspaceName, From 4191ffd5c00dccea7f8e9ea22faaac4885b49d28 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Fri, 29 Oct 2021 12:45:40 +0700 Subject: [PATCH 64/73] Enforce type checks for better code quality --- src/Api/Operator.php | 6 ++-- src/Api/Operator/Certificate.php | 7 +--- src/Api/Operator/Customer.php | 13 +++---- src/Api/Operator/Database.php | 46 +++++++------------------ src/Api/Operator/DatabaseServer.php | 11 +++--- src/Api/Operator/Dns.php | 9 ++--- src/Api/Operator/DnsTemplate.php | 6 ++-- src/Api/Operator/EventLog.php | 9 ++--- src/Api/Operator/Ip.php | 2 +- src/Api/Operator/Mail.php | 22 +++--------- src/Api/Operator/ProtectedDirectory.php | 15 +++----- src/Api/Operator/Reseller.php | 13 +++---- src/Api/Operator/SecretKey.php | 26 +++----------- src/Api/Operator/Server.php | 6 ---- src/Api/Operator/ServicePlan.php | 15 +++----- src/Api/Operator/Session.php | 17 ++------- src/Api/Operator/Site.php | 15 +++----- src/Api/Operator/SiteAlias.php | 12 ++----- src/Api/Operator/Subdomain.php | 11 ++---- src/Api/Operator/Ui.php | 27 +++------------ src/Api/XmlResponse.php | 2 +- 21 files changed, 75 insertions(+), 215 deletions(-) diff --git a/src/Api/Operator.php b/src/Api/Operator.php index b22768b4..8cfb656e 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -27,7 +27,7 @@ public function __construct(Client $client) * * @return XmlResponse */ - public function request($request, $mode = Client::RESPONSE_SHORT) + public function request($request, $mode = Client::RESPONSE_SHORT): XmlResponse { $wrapperTag = $this->wrapperTag; @@ -69,9 +69,9 @@ protected function deleteBy(string $field, $value, string $deleteMethodName = 'd * @param int|string|null $value * @param callable|null $filter * - * @return mixed + * @return array */ - protected function getItems($structClass, $infoTag, $field = null, $value = null, callable $filter = null) + protected function getItems($structClass, $infoTag, $field = null, $value = null, callable $filter = null): array { $packet = $this->client->getPacket(); $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); diff --git a/src/Api/Operator/Certificate.php b/src/Api/Operator/Certificate.php index cb7dacb3..25bc2b1f 100644 --- a/src/Api/Operator/Certificate.php +++ b/src/Api/Operator/Certificate.php @@ -7,12 +7,7 @@ class Certificate extends \PleskX\Api\Operator { - /** - * @param array $properties - * - * @return Struct\Info - */ - public function generate($properties) + public function generate(array $properties): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('generate')->addChild('info'); diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index be58f919..f927c594 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -7,12 +7,7 @@ class Customer extends \PleskX\Api\Operator { - /** - * @param array $properties - * - * @return Struct\Info - */ - public function create($properties) + public function create(array $properties): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('add')->addChild('gen_info'); @@ -32,7 +27,7 @@ public function create($properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value); } @@ -43,7 +38,7 @@ public function delete($field, $value) * * @return Struct\GeneralInfo */ - public function get($field, $value) + public function get(string $field, $value): Struct\GeneralInfo { $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); @@ -53,7 +48,7 @@ public function get($field, $value) /** * @return Struct\GeneralInfo[] */ - public function getAll() + public function getAll(): array { return $this->getItems(Struct\GeneralInfo::class, 'gen_info'); } diff --git a/src/Api/Operator/Database.php b/src/Api/Operator/Database.php index dd5ddc6e..b2b64ef7 100644 --- a/src/Api/Operator/Database.php +++ b/src/Api/Operator/Database.php @@ -4,36 +4,21 @@ namespace PleskX\Api\Operator; use PleskX\Api\Struct\Database as Struct; +use PleskX\Api\XmlResponse; class Database extends \PleskX\Api\Operator { - /** - * @param array $properties - * - * @return Struct\Info - */ - public function create($properties) + public function create(array $properties): Struct\Info { return new Struct\Info($this->process('add-db', $properties)); } - /** - * @param array $properties - * - * @return Struct\UserInfo - */ - public function createUser($properties) + public function createUser(array $properties): Struct\UserInfo { return new Struct\UserInfo($this->process('add-db-user', $properties)); } - /** - * @param string $command - * @param array $properties - * - * @return \PleskX\Api\XmlResponse - */ - private function process($command, array $properties) + private function process(string $command, array $properties): XmlResponse { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild($command); @@ -49,12 +34,7 @@ private function process($command, array $properties) return $this->client->request($packet); } - /** - * @param array $properties - * - * @return bool - */ - public function updateUser(array $properties) + public function updateUser(array $properties): bool { $response = $this->process('set-db-user', $properties); @@ -67,7 +47,7 @@ public function updateUser(array $properties) * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value): Struct\Info { $items = $this->getAll($field, $value); @@ -80,7 +60,7 @@ public function get($field, $value) * * @return Struct\UserInfo */ - public function getUser($field, $value) + public function getUser(string $field, $value): Struct\UserInfo { $items = $this->getAllUsers($field, $value); @@ -93,7 +73,7 @@ public function getUser($field, $value) * * @return Struct\Info[] */ - public function getAll($field, $value) + public function getAll(string $field, $value): array { $response = $this->getBy('get-db', $field, $value); $items = []; @@ -110,7 +90,7 @@ public function getAll($field, $value) * * @return Struct\UserInfo[] */ - public function getAllUsers($field, $value) + public function getAllUsers(string $field, $value): array { $response = $this->getBy('get-db-users', $field, $value); $items = []; @@ -126,9 +106,9 @@ public function getAllUsers($field, $value) * @param string $field * @param int|string $value * - * @return \PleskX\Api\XmlResponse + * @return XmlResponse */ - private function getBy(string $command, string $field, $value) + private function getBy(string $command, string $field, $value): XmlResponse { $packet = $this->client->getPacket(); $getTag = $packet->addChild($this->wrapperTag)->addChild($command); @@ -145,7 +125,7 @@ private function getBy(string $command, string $field, $value) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value, 'del-db'); } @@ -156,7 +136,7 @@ public function delete($field, $value) * * @return bool */ - public function deleteUser($field, $value) + public function deleteUser(string $field, $value): bool { return $this->deleteBy($field, $value, 'del-db-user'); } diff --git a/src/Api/Operator/DatabaseServer.php b/src/Api/Operator/DatabaseServer.php index 09c7f6ce..6b8066a0 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -9,10 +9,7 @@ class DatabaseServer extends \PleskX\Api\Operator { protected string $wrapperTag = 'db_server'; - /** - * @return array - */ - public function getSupportedTypes() + public function getSupportedTypes(): array { $response = $this->request('get-supported-types'); @@ -25,7 +22,7 @@ public function getSupportedTypes() * * @return Struct\Info */ - public function get(string $field, $value) + public function get(string $field, $value): Struct\Info { $items = $this->getBy($field, $value); @@ -35,7 +32,7 @@ public function get(string $field, $value) /** * @return Struct\Info[] */ - public function getAll() + public function getAll(): array { return $this->getBy(); } @@ -46,7 +43,7 @@ public function getAll() * * @return Struct\Info[] */ - private function getBy($field = null, $value = null) + private function getBy($field = null, $value = null): array { $packet = $this->client->getPacket(); $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); diff --git a/src/Api/Operator/Dns.php b/src/Api/Operator/Dns.php index 6a193dc6..ed3db23a 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -7,12 +7,7 @@ class Dns extends \PleskX\Api\Operator { - /** - * @param array $properties - * - * @return Struct\Info - */ - public function create($properties) + public function create(array $properties): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('add_rec'); @@ -58,7 +53,7 @@ public function bulkCreate(array $records): array * * @return Struct\Info */ - public function get(string $field, $value) + public function get(string $field, $value): Struct\Info { $items = $this->getAll($field, $value); diff --git a/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index a20f4e57..7c2d014c 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -14,7 +14,7 @@ class DnsTemplate extends \PleskX\Api\Operator * * @return Struct\Info */ - public function create(array $properties) + public function create(array $properties): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('add_rec'); @@ -31,9 +31,9 @@ public function create(array $properties) * @param string $field * @param int|string $value * - * @return Struct\Info|null + * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value): Struct\Info { $items = $this->getAll($field, $value); diff --git a/src/Api/Operator/EventLog.php b/src/Api/Operator/EventLog.php index 823a97fe..43adb05f 100644 --- a/src/Api/Operator/EventLog.php +++ b/src/Api/Operator/EventLog.php @@ -12,7 +12,7 @@ class EventLog extends \PleskX\Api\Operator /** * @return Struct\Event[] */ - public function get() + public function get(): array { $records = []; $response = $this->request('get'); @@ -27,7 +27,7 @@ public function get() /** * @return Struct\DetailedEvent[] */ - public function getDetailedLog() + public function getDetailedLog(): array { $records = []; $response = $this->request('get_events'); @@ -39,10 +39,7 @@ public function getDetailedLog() return $records; } - /** - * @return int - */ - public function getLastId() + public function getLastId(): int { return (int) $this->request('get-last-id')->getValue('id'); } diff --git a/src/Api/Operator/Ip.php b/src/Api/Operator/Ip.php index 9e500a54..1c1667bd 100644 --- a/src/Api/Operator/Ip.php +++ b/src/Api/Operator/Ip.php @@ -10,7 +10,7 @@ class Ip extends \PleskX\Api\Operator /** * @return Struct\Info[] */ - public function get() + public function get(): array { $ips = []; $packet = $this->client->getPacket(); diff --git a/src/Api/Operator/Mail.php b/src/Api/Operator/Mail.php index 5986a8b8..dadd0639 100644 --- a/src/Api/Operator/Mail.php +++ b/src/Api/Operator/Mail.php @@ -9,15 +9,7 @@ class Mail extends Operator { - /** - * @param string $name - * @param int $siteId - * @param bool $mailbox - * @param string $password - * - * @return Struct\Info - */ - public function create($name, $siteId, $mailbox = false, $password = '') + public function create(string $name, int $siteId, bool $mailbox = false, string $password = ''): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('create'); @@ -45,7 +37,7 @@ public function create($name, $siteId, $mailbox = false, $password = '') * * @return bool */ - public function delete(string $field, $value, $siteId): bool + public function delete(string $field, $value, int $siteId): bool { $packet = $this->client->getPacket(); $filter = $packet->addChild($this->wrapperTag)->addChild('remove')->addChild('filter'); @@ -58,13 +50,7 @@ public function delete(string $field, $value, $siteId): bool return 'ok' === (string) $response->status; } - /** - * @param string $name - * @param int $siteId - * - * @return Struct\GeneralInfo - */ - public function get($name, $siteId) + public function get(string $name, int $siteId): Struct\GeneralInfo { $items = $this->getAll($siteId, $name); @@ -77,7 +63,7 @@ public function get($name, $siteId) * * @return Struct\GeneralInfo[] */ - public function getAll($siteId, $name = null) + public function getAll(int $siteId, $name = null): array { $packet = $this->client->getPacket(); $getTag = $packet->addChild($this->wrapperTag)->addChild('get_info'); diff --git a/src/Api/Operator/ProtectedDirectory.php b/src/Api/Operator/ProtectedDirectory.php index 529b7e3e..a0dbb776 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -11,14 +11,7 @@ class ProtectedDirectory extends Operator { protected string $wrapperTag = 'protected-dir'; - /** - * @param string $name - * @param int $siteId - * @param string $header - * - * @return Struct\Info - */ - public function add($name, $siteId, $header = '') + public function add(string $name, int $siteId, string $header = ''): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('add'); @@ -36,7 +29,7 @@ public function add($name, $siteId, $header = '') * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value, 'delete'); } @@ -45,9 +38,9 @@ public function delete($field, $value) * @param string $field * @param int|string $value * - * @return Struct\DataInfo|false + * @return Struct\DataInfo */ - public function get(string $field, $value) + public function get(string $field, $value): Struct\DataInfo { $items = $this->getAll($field, $value); diff --git a/src/Api/Operator/Reseller.php b/src/Api/Operator/Reseller.php index 729721ee..147b468b 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -7,12 +7,7 @@ class Reseller extends \PleskX\Api\Operator { - /** - * @param array $properties - * - * @return Struct\Info - */ - public function create($properties) + public function create(array $properties): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('add')->addChild('gen-info'); @@ -32,7 +27,7 @@ public function create($properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value); } @@ -43,7 +38,7 @@ public function delete($field, $value) * * @return Struct\GeneralInfo */ - public function get($field, $value) + public function get(string $field, $value): Struct\GeneralInfo { $items = $this->getAll($field, $value); @@ -56,7 +51,7 @@ public function get($field, $value) * * @return Struct\GeneralInfo[] */ - public function getAll($field = null, $value = null) + public function getAll($field = null, $value = null): array { $packet = $this->client->getPacket(); $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index bd41db07..b2be4cd5 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -9,13 +9,7 @@ class SecretKey extends \PleskX\Api\Operator { protected string $wrapperTag = 'secret_key'; - /** - * @param string $ipAddress - * @param string $description - * - * @return string - */ - public function create($ipAddress = '', $description = '') + public function create(string $ipAddress = '', string $description = ''): string { $packet = $this->client->getPacket(); $createTag = $packet->addChild($this->wrapperTag)->addChild('create'); @@ -33,22 +27,12 @@ public function create($ipAddress = '', $description = '') return (string) $response->key; } - /** - * @param string $keyId - * - * @return bool - */ - public function delete($keyId) + public function delete(string $keyId): bool { return $this->deleteBy('key', $keyId, 'delete'); } - /** - * @param string $keyId - * - * @return Struct\Info - */ - public function get($keyId) + public function get(string $keyId): Struct\Info { $items = $this->getBy($keyId); @@ -58,7 +42,7 @@ public function get($keyId) /** * @return Struct\Info[] */ - public function getAll() + public function getAll(): array { return $this->getBy(); } @@ -68,7 +52,7 @@ public function getAll() * * @return Struct\Info[] */ - public function getBy($keyId = null) + public function getBy($keyId = null): array { $packet = $this->client->getPacket(); $getTag = $packet->addChild($this->wrapperTag)->addChild('get_info'); diff --git a/src/Api/Operator/Server.php b/src/Api/Operator/Server.php index a5d79968..1a72d849 100644 --- a/src/Api/Operator/Server.php +++ b/src/Api/Operator/Server.php @@ -118,12 +118,6 @@ public function getUpdatesInfo(): Struct\UpdatesInfo return new Struct\UpdatesInfo($this->getInfo('updates')); } - /** - * @param string $login - * @param string $clientIp - * - * @return string - */ public function createSession(string $login, string $clientIp): string { $packet = $this->client->getPacket(); diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index 3e38a3f7..f9a1d887 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -7,12 +7,7 @@ class ServicePlan extends \PleskX\Api\Operator { - /** - * @param array $properties - * - * @return Struct\Info - */ - public function create($properties) + public function create(array $properties): Struct\Info { $response = $this->request(['add' => $properties]); @@ -25,7 +20,7 @@ public function create($properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value); } @@ -36,7 +31,7 @@ public function delete($field, $value) * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value): Struct\Info { $items = $this->getBy($field, $value); @@ -46,7 +41,7 @@ public function get($field, $value) /** * @return Struct\Info[] */ - public function getAll() + public function getAll(): array { return $this->getBy(); } @@ -57,7 +52,7 @@ public function getAll() * * @return Struct\Info[] */ - private function getBy($field = null, $value = null) + private function getBy($field = null, $value = null): array { $packet = $this->client->getPacket(); $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); diff --git a/src/Api/Operator/Session.php b/src/Api/Operator/Session.php index cea02004..b4713822 100644 --- a/src/Api/Operator/Session.php +++ b/src/Api/Operator/Session.php @@ -7,13 +7,7 @@ class Session extends \PleskX\Api\Operator { - /** - * @param string $username - * @param string $userIp - * - * @return string - */ - public function create($username, $userIp) + public function create(string $username, string $userIp): string { $packet = $this->client->getPacket(); $creator = $packet->addChild('server')->addChild('create_session'); @@ -32,7 +26,7 @@ public function create($username, $userIp) /** * @return Struct\Info[] */ - public function get() + public function get(): array { $sessions = []; $response = $this->request('get'); @@ -44,12 +38,7 @@ public function get() return $sessions; } - /** - * @param string $sessionId - * - * @return bool - */ - public function terminate($sessionId) + public function terminate(string $sessionId): bool { $response = $this->request("terminate.session-id=$sessionId"); diff --git a/src/Api/Operator/Site.php b/src/Api/Operator/Site.php index 67e0a875..273757bb 100644 --- a/src/Api/Operator/Site.php +++ b/src/Api/Operator/Site.php @@ -9,12 +9,7 @@ class Site extends \PleskX\Api\Operator { public const PROPERTIES_HOSTING = 'hosting'; - /** - * @param array $properties - * - * @return Struct\Info - */ - public function create(array $properties) + public function create(array $properties): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('add'); @@ -48,7 +43,7 @@ public function create(array $properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value); } @@ -59,7 +54,7 @@ public function delete($field, $value) * * @return Struct\GeneralInfo */ - public function get($field, $value) + public function get(string $field, $value): Struct\GeneralInfo { $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); @@ -72,7 +67,7 @@ public function get($field, $value) * * @return Struct\HostingInfo|null */ - public function getHosting($field, $value) + public function getHosting(string $field, $value): ?Struct\HostingInfo { $items = $this->getItems( Struct\HostingInfo::class, @@ -90,7 +85,7 @@ function (\SimpleXMLElement $node) { /** * @return Struct\GeneralInfo[] */ - public function getAll() + public function getAll(): array { return $this->getItems(Struct\GeneralInfo::class, 'gen_info'); } diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index 34539b6d..fce9afc0 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -7,13 +7,7 @@ class SiteAlias extends \PleskX\Api\Operator { - /** - * @param array $properties - * @param array $preferences - * - * @return Struct\Info - */ - public function create(array $properties, array $preferences = []) + public function create(array $properties, array $preferences = []): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('create'); @@ -40,7 +34,7 @@ public function create(array $properties, array $preferences = []) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value, 'delete'); } @@ -51,7 +45,7 @@ public function delete($field, $value) * * @return Struct\GeneralInfo */ - public function get($field, $value) + public function get(string $field, $value): Struct\GeneralInfo { $items = $this->getAll($field, $value); diff --git a/src/Api/Operator/Subdomain.php b/src/Api/Operator/Subdomain.php index db88138e..5158993b 100644 --- a/src/Api/Operator/Subdomain.php +++ b/src/Api/Operator/Subdomain.php @@ -7,12 +7,7 @@ class Subdomain extends \PleskX\Api\Operator { - /** - * @param array $properties - * - * @return Struct\Info - */ - public function create($properties) + public function create(array $properties): Struct\Info { $packet = $this->client->getPacket(); $info = $packet->addChild($this->wrapperTag)->addChild('add'); @@ -40,7 +35,7 @@ public function create($properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { return $this->deleteBy($field, $value); } @@ -51,7 +46,7 @@ public function delete($field, $value) * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value): Struct\Info { $items = $this->getAll($field, $value); diff --git a/src/Api/Operator/Ui.php b/src/Api/Operator/Ui.php index b14f84c9..1577dec3 100644 --- a/src/Api/Operator/Ui.php +++ b/src/Api/Operator/Ui.php @@ -7,23 +7,14 @@ class Ui extends \PleskX\Api\Operator { - /** - * @return array - */ - public function getNavigation() + public function getNavigation(): array { $response = $this->request('get-navigation'); return unserialize(base64_decode($response->navigation)); } - /** - * @param string $owner - * @param array $properties - * - * @return int - */ - public function createCustomButton($owner, $properties) + public function createCustomButton(string $owner, array $properties): int { $packet = $this->client->getPacket(); $buttonNode = $packet->addChild($this->wrapperTag)->addChild('create-custombutton'); @@ -39,24 +30,14 @@ public function createCustomButton($owner, $properties) return (int) $response->id; } - /** - * @param int $id - * - * @return Struct\CustomButton - */ - public function getCustomButton($id) + public function getCustomButton(int $id): Struct\CustomButton { $response = $this->request("get-custombutton.filter.custombutton-id=$id"); return new Struct\CustomButton($response); } - /** - * @param int $id - * - * @return bool - */ - public function deleteCustomButton($id) + public function deleteCustomButton(int $id): bool { return $this->deleteBy('custombutton-id', $id, 'delete-custombutton'); } diff --git a/src/Api/XmlResponse.php b/src/Api/XmlResponse.php index 073116a4..825ea671 100644 --- a/src/Api/XmlResponse.php +++ b/src/Api/XmlResponse.php @@ -15,7 +15,7 @@ class XmlResponse extends \SimpleXMLElement * * @return string */ - public function getValue($node) + public function getValue(string $node): string { return (string) $this->xpath('//' . $node)[0]; } From b2b7ebe7b6f1dc108217c5daea40e65137b8c1b6 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 28 Nov 2021 19:46:16 +0700 Subject: [PATCH 65/73] Update PHP deps to latest versions --- composer.lock | 214 ++++++++++++++++++++++++++------------------------ 1 file changed, 110 insertions(+), 104 deletions(-) diff --git a/composer.lock b/composer.lock index b6695290..9c968df9 100644 --- a/composer.lock +++ b/composer.lock @@ -175,24 +175,24 @@ }, { "name": "clue/stdio-react", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/clue/reactphp-stdio.git", - "reference": "5722686d3cc0cdf2ccedb6079bfd066220611f00" + "reference": "c73bcdc228eca627992c0088f7bc30b794fde8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/reactphp-stdio/zipball/5722686d3cc0cdf2ccedb6079bfd066220611f00", - "reference": "5722686d3cc0cdf2ccedb6079bfd066220611f00", + "url": "https://api.github.com/repos/clue/reactphp-stdio/zipball/c73bcdc228eca627992c0088f7bc30b794fde8da", + "reference": "c73bcdc228eca627992c0088f7bc30b794fde8da", "shasum": "" }, "require": { "clue/term-react": "^1.0 || ^0.1.1", "clue/utf8-react": "^1.0 || ^0.1", "php": ">=5.3", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3", - "react/stream": "^1.0 || ^0.7 || ^0.6" + "react/event-loop": "^1.2", + "react/stream": "^1.2" }, "require-dev": { "clue/arguments": "^2.0", @@ -235,7 +235,7 @@ ], "support": { "issues": "https://github.com/clue/reactphp-stdio/issues", - "source": "https://github.com/clue/reactphp-stdio/tree/v2.4.0" + "source": "https://github.com/clue/reactphp-stdio/tree/v2.5.0" }, "funding": [ { @@ -247,7 +247,7 @@ "type": "github" } ], - "time": "2020-11-20T14:28:39+00:00" + "time": "2021-10-25T08:01:22+00:00" }, { "name": "clue/term-react", @@ -460,16 +460,16 @@ }, { "name": "composer/semver", - "version": "3.2.5", + "version": "3.2.6", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "" }, "require": { @@ -521,7 +521,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "source": "https://github.com/composer/semver/tree/3.2.6" }, "funding": [ { @@ -537,7 +537,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2021-10-25T11:34:17+00:00" }, { "name": "composer/xdebug-handler", @@ -1035,16 +1035,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.0", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53" + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd", "shasum": "" }, "require": { @@ -1085,9 +1085,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1" }, - "time": "2021-09-20T12:20:58+00:00" + "time": "2021-11-03T20:52:16+00:00" }, { "name": "openlss/lib-array2xml", @@ -1308,16 +1308,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { @@ -1328,7 +1328,8 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -1358,22 +1359,22 @@ "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/master" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2020-09-03T19:13:55+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", - "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -1408,9 +1409,9 @@ "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.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2021-09-17T15:28:14+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", @@ -1481,23 +1482,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.7", + "version": "9.2.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" + "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", - "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", + "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.12.0", + "nikic/php-parser": "^4.13.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1546,7 +1547,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.9" }, "funding": [ { @@ -1554,7 +1555,7 @@ "type": "github" } ], - "time": "2021-09-17T05:39:03+00:00" + "time": "2021-11-19T15:21:02+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1902,20 +1903,20 @@ }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -1944,9 +1945,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/log", @@ -2587,16 +2588,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.3", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", "shasum": "" }, "require": { @@ -2645,14 +2646,14 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "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.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" }, "funding": [ { @@ -2660,7 +2661,7 @@ "type": "github" } ], - "time": "2020-09-28T05:24:23+00:00" + "time": "2021-11-11T14:18:36+00:00" }, { "name": "sebastian/global-state", @@ -3243,16 +3244,16 @@ }, { "name": "symfony/console", - "version": "v5.3.7", + "version": "v5.3.11", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" + "reference": "3e7ab8f5905058984899b05a4648096f558bfeba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", + "url": "https://api.github.com/repos/symfony/console/zipball/3e7ab8f5905058984899b05a4648096f558bfeba", + "reference": "3e7ab8f5905058984899b05a4648096f558bfeba", "shasum": "" }, "require": { @@ -3265,7 +3266,6 @@ "symfony/string": "^5.1" }, "conflict": { - "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -3322,7 +3322,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.7" + "source": "https://github.com/symfony/console/tree/v5.3.11" }, "funding": [ { @@ -3338,20 +3338,20 @@ "type": "tidelift" } ], - "time": "2021-08-25T20:02:16+00:00" + "time": "2021-11-21T19:41:05+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", "shasum": "" }, "require": { @@ -3360,7 +3360,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3389,7 +3389,7 @@ "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" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" }, "funding": [ { @@ -3405,7 +3405,7 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/finder", @@ -3957,16 +3957,16 @@ }, { "name": "symfony/process", - "version": "v5.3.7", + "version": "v5.3.12", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" + "reference": "e498803a6e95ede78e9d5646ad32a2255c033a6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", - "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", + "url": "https://api.github.com/repos/symfony/process/zipball/e498803a6e95ede78e9d5646ad32a2255c033a6a", + "reference": "e498803a6e95ede78e9d5646ad32a2255c033a6a", "shasum": "" }, "require": { @@ -3999,7 +3999,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.7" + "source": "https://github.com/symfony/process/tree/v5.3.12" }, "funding": [ { @@ -4015,25 +4015,29 @@ "type": "tidelift" } ], - "time": "2021-08-04T21:20:46+00:00" + "time": "2021-11-22T22:39:13+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.1" + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -4041,7 +4045,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4078,7 +4082,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" }, "funding": [ { @@ -4094,20 +4098,20 @@ "type": "tidelift" } ], - "time": "2021-04-01T10:43:52+00:00" + "time": "2021-11-04T16:48:04+00:00" }, { "name": "symfony/string", - "version": "v5.3.7", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", + "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", "shasum": "" }, "require": { @@ -4161,7 +4165,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.7" + "source": "https://github.com/symfony/string/tree/v5.3.10" }, "funding": [ { @@ -4177,20 +4181,20 @@ "type": "tidelift" } ], - "time": "2021-08-26T08:00:08+00:00" + "time": "2021-10-27T18:21:46+00:00" }, { "name": "symfony/yaml", - "version": "v5.3.6", + "version": "v5.3.11", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7" + "reference": "226638aa877bc4104e619a15f27d8141cd6b4e4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", - "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", + "url": "https://api.github.com/repos/symfony/yaml/zipball/226638aa877bc4104e619a15f27d8141cd6b4e4a", + "reference": "226638aa877bc4104e619a15f27d8141cd6b4e4a", "shasum": "" }, "require": { @@ -4236,7 +4240,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.3.6" + "source": "https://github.com/symfony/yaml/tree/v5.3.11" }, "funding": [ { @@ -4252,7 +4256,7 @@ "type": "tidelift" } ], - "time": "2021-07-29T06:20:01+00:00" + "time": "2021-11-20T16:42:42+00:00" }, { "name": "theseer/tokenizer", @@ -4306,16 +4310,16 @@ }, { "name": "vimeo/psalm", - "version": "4.10.0", + "version": "4.13.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "916b098b008f6de4543892b1e0651c1c3b92cbfa" + "reference": "5cf660f63b548ccd4a56f62d916ee4d6028e01a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/916b098b008f6de4543892b1e0651c1c3b92cbfa", - "reference": "916b098b008f6de4543892b1e0651c1c3b92cbfa", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/5cf660f63b548ccd4a56f62d916ee4d6028e01a3", + "reference": "5cf660f63b548ccd4a56f62d916ee4d6028e01a3", "shasum": "" }, "require": { @@ -4335,11 +4339,11 @@ "felixfbecker/advanced-json-rpc": "^3.0.3", "felixfbecker/language-server-protocol": "^1.5", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.12", + "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", "php": "^7.1|^8", "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", "webmozart/path-util": "^2.3" }, "provide": { @@ -4357,11 +4361,12 @@ "psalm/plugin-phpunit": "^0.16", "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0", + "symfony/process": "^4.3 || ^5.0 || ^6.0", "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { - "ext-igbinary": "^2.0.5" + "ext-curl": "In order to send data to shepherd", + "ext-igbinary": "^2.0.5 is required, used to serialize caching data" }, "bin": [ "psalm", @@ -4405,9 +4410,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.10.0" + "source": "https://github.com/vimeo/psalm/tree/4.13.1" }, - "time": "2021-09-04T21:00:09+00:00" + "time": "2021-11-23T23:52:49+00:00" }, { "name": "webmozart/assert", @@ -4515,6 +4520,7 @@ "issues": "https://github.com/webmozart/path-util/issues", "source": "https://github.com/webmozart/path-util/tree/2.3.0" }, + "abandoned": "symfony/filesystem", "time": "2015-12-17T08:42:14+00:00" }, { From f65d8fa297be0745e0a6aa7c70c43f320b0a585f Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Sun, 28 Nov 2021 21:12:19 +0700 Subject: [PATCH 66/73] Fix #63: Add an ability to set two IPs (v4 and v6) for webspace --- src/Api/Operator/Webspace.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index 360ade89..af952da2 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -87,7 +87,9 @@ public function create(array $properties, array $hostingProperties = null, strin } if (isset($properties['ip_address'])) { - $infoHosting->addChild('ip_address', $properties['ip_address']); + foreach ((array) $properties['ip_address'] as $ipAddress) { + $infoHosting->addChild('ip_address', $ipAddress); + } } } From b282679107776ff08205980ba3e6e5c52aa37912 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 19 Jan 2022 10:51:40 +0700 Subject: [PATCH 67/73] Use forced cast to proper response type (including SDK API use case) --- src/Api/Client.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index 48564e8b..f259569c 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -149,8 +149,9 @@ public function getPacket($version = null): SimpleXMLElement * @param int $mode * * @return XmlResponse + * @throws \Exception */ - public function request($request, $mode = self::RESPONSE_SHORT) + public function request($request, int $mode = self::RESPONSE_SHORT): XmlResponse { if ($request instanceof SimpleXMLElement) { $request = $request->asXml(); @@ -177,7 +178,8 @@ public function request($request, $mode = self::RESPONSE_SHORT) ? call_user_func($this->verifyResponseCallback, $xml) : $this->verifyResponse($xml); - return (self::RESPONSE_FULL == $mode) ? $xml : $xml->xpath('//result')[0]; + $result = (self::RESPONSE_FULL === $mode) ? $xml : $xml->xpath('//result')[0]; + return new XmlResponse((string) $result->asXML()); } /** From 37f798d3450bee10f8e0b4044175fb07c2abbb86 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 20 Jan 2022 11:06:13 +0700 Subject: [PATCH 68/73] TECH Update copyright year --- LICENSE | 2 +- phpunit.xml.dist | 2 +- src/Api/AbstractStruct.php | 2 +- src/Api/Client.php | 2 +- src/Api/Client/Exception.php | 2 +- src/Api/Exception.php | 2 +- src/Api/InternalClient.php | 2 +- src/Api/Operator.php | 2 +- src/Api/Operator/Aps.php | 2 +- src/Api/Operator/Certificate.php | 2 +- src/Api/Operator/Customer.php | 2 +- src/Api/Operator/Database.php | 2 +- src/Api/Operator/DatabaseServer.php | 2 +- src/Api/Operator/Dns.php | 2 +- src/Api/Operator/DnsTemplate.php | 2 +- src/Api/Operator/EventLog.php | 2 +- src/Api/Operator/Ip.php | 2 +- src/Api/Operator/Locale.php | 2 +- src/Api/Operator/LogRotation.php | 2 +- src/Api/Operator/Mail.php | 2 +- src/Api/Operator/PhpHandler.php | 2 +- src/Api/Operator/ProtectedDirectory.php | 2 +- src/Api/Operator/Reseller.php | 2 +- src/Api/Operator/ResellerPlan.php | 2 +- src/Api/Operator/SecretKey.php | 2 +- src/Api/Operator/Server.php | 2 +- src/Api/Operator/ServicePlan.php | 2 +- src/Api/Operator/ServicePlanAddon.php | 2 +- src/Api/Operator/Session.php | 2 +- src/Api/Operator/Site.php | 2 +- src/Api/Operator/SiteAlias.php | 2 +- src/Api/Operator/Subdomain.php | 2 +- src/Api/Operator/Ui.php | 2 +- src/Api/Operator/VirtualDirectory.php | 2 +- src/Api/Operator/Webspace.php | 2 +- src/Api/Struct/Certificate/Info.php | 2 +- src/Api/Struct/Customer/GeneralInfo.php | 2 +- src/Api/Struct/Customer/Info.php | 2 +- src/Api/Struct/Database/Info.php | 2 +- src/Api/Struct/Database/UserInfo.php | 2 +- src/Api/Struct/DatabaseServer/Info.php | 2 +- src/Api/Struct/Dns/Info.php | 2 +- src/Api/Struct/EventLog/DetailedEvent.php | 2 +- src/Api/Struct/EventLog/Event.php | 2 +- src/Api/Struct/Ip/Info.php | 2 +- src/Api/Struct/Locale/Info.php | 2 +- src/Api/Struct/Mail/GeneralInfo.php | 2 +- src/Api/Struct/Mail/Info.php | 2 +- src/Api/Struct/PhpHandler/Info.php | 2 +- src/Api/Struct/ProtectedDirectory/DataInfo.php | 2 +- src/Api/Struct/ProtectedDirectory/Info.php | 2 +- src/Api/Struct/ProtectedDirectory/UserInfo.php | 2 +- src/Api/Struct/Reseller/GeneralInfo.php | 2 +- src/Api/Struct/Reseller/Info.php | 2 +- src/Api/Struct/SecretKey/Info.php | 2 +- src/Api/Struct/Server/Admin.php | 2 +- src/Api/Struct/Server/GeneralInfo.php | 2 +- src/Api/Struct/Server/Preferences.php | 2 +- src/Api/Struct/Server/SessionPreferences.php | 2 +- src/Api/Struct/Server/Statistics.php | 2 +- src/Api/Struct/Server/Statistics/DiskSpace.php | 2 +- src/Api/Struct/Server/Statistics/LoadAverage.php | 2 +- src/Api/Struct/Server/Statistics/Memory.php | 2 +- src/Api/Struct/Server/Statistics/Objects.php | 2 +- src/Api/Struct/Server/Statistics/Other.php | 2 +- src/Api/Struct/Server/Statistics/Swap.php | 2 +- src/Api/Struct/Server/Statistics/Version.php | 2 +- src/Api/Struct/Server/UpdatesInfo.php | 2 +- src/Api/Struct/ServicePlan/Info.php | 2 +- src/Api/Struct/Session/Info.php | 2 +- src/Api/Struct/Site/GeneralInfo.php | 2 +- src/Api/Struct/Site/HostingInfo.php | 2 +- src/Api/Struct/Site/Info.php | 2 +- src/Api/Struct/SiteAlias/GeneralInfo.php | 2 +- src/Api/Struct/SiteAlias/Info.php | 2 +- src/Api/Struct/Subdomain/Info.php | 2 +- src/Api/Struct/Ui/CustomButton.php | 2 +- src/Api/Struct/Webspace/DiskUsage.php | 2 +- src/Api/Struct/Webspace/GeneralInfo.php | 2 +- src/Api/Struct/Webspace/HostingPropertyInfo.php | 2 +- src/Api/Struct/Webspace/Info.php | 2 +- src/Api/Struct/Webspace/Limit.php | 2 +- src/Api/Struct/Webspace/LimitDescriptor.php | 2 +- src/Api/Struct/Webspace/LimitInfo.php | 2 +- src/Api/Struct/Webspace/Limits.php | 2 +- src/Api/Struct/Webspace/PermissionDescriptor.php | 2 +- src/Api/Struct/Webspace/PermissionInfo.php | 2 +- src/Api/Struct/Webspace/PhpSettings.php | 2 +- src/Api/Struct/Webspace/PhysicalHostingDescriptor.php | 2 +- src/Api/XmlResponse.php | 2 +- tests/AbstractTestCase.php | 2 +- tests/ApiClientTest.php | 2 +- tests/CertificateTest.php | 2 +- tests/CustomerTest.php | 2 +- tests/DatabaseServerTest.php | 2 +- tests/DatabaseTest.php | 2 +- tests/DnsTemplateTest.php | 2 +- tests/DnsTest.php | 2 +- tests/EventLogTest.php | 2 +- tests/IpTest.php | 2 +- tests/LocaleTest.php | 2 +- tests/MailTest.php | 2 +- tests/PhpHandlerTest.php | 2 +- tests/ProtectedDirectoryTest.php | 2 +- tests/ResellerTest.php | 2 +- tests/SecretKeyTest.php | 2 +- tests/ServerTest.php | 2 +- tests/ServicePlanTest.php | 2 +- tests/SessionTest.php | 2 +- tests/SiteAliasTest.php | 2 +- tests/SiteTest.php | 2 +- tests/SubdomainTest.php | 2 +- tests/UiTest.php | 2 +- tests/Utility/KeyLimitChecker.php | 2 +- tests/Utility/PasswordProvider.php | 2 +- tests/WebspaceTest.php | 2 +- wait-for-plesk.sh | 2 +- 117 files changed, 117 insertions(+), 117 deletions(-) diff --git a/LICENSE b/LICENSE index 8113e2a4..914de1aa 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 1999-2021. Plesk International GmbH. +Copyright 1999-2022. Plesk International GmbH. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 40244388..d32b2193 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 1999-2021. Plesk International GmbH. --> +<!-- Copyright 1999-2022. Plesk International GmbH. --> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" verbose="true" colors="true"> <coverage processUncoveredFiles="true"> <include> diff --git a/src/Api/AbstractStruct.php b/src/Api/AbstractStruct.php index ea7a3917..042bd46c 100644 --- a/src/Api/AbstractStruct.php +++ b/src/Api/AbstractStruct.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Client.php b/src/Api/Client.php index f259569c..f622028f 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Client/Exception.php b/src/Api/Client/Exception.php index 0d26d30b..4ddf0b42 100644 --- a/src/Api/Client/Exception.php +++ b/src/Api/Client/Exception.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Client; diff --git a/src/Api/Exception.php b/src/Api/Exception.php index a7ba9663..6d5d1633 100644 --- a/src/Api/Exception.php +++ b/src/Api/Exception.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/InternalClient.php b/src/Api/InternalClient.php index 99044b1b..058d851c 100644 --- a/src/Api/InternalClient.php +++ b/src/Api/InternalClient.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Operator.php b/src/Api/Operator.php index 8cfb656e..778da474 100644 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api; diff --git a/src/Api/Operator/Aps.php b/src/Api/Operator/Aps.php index 9f4bde31..e9f2ca41 100644 --- a/src/Api/Operator/Aps.php +++ b/src/Api/Operator/Aps.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Certificate.php b/src/Api/Operator/Certificate.php index 25bc2b1f..b019bfc2 100644 --- a/src/Api/Operator/Certificate.php +++ b/src/Api/Operator/Certificate.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Customer.php b/src/Api/Operator/Customer.php index f927c594..e3ebdd28 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Database.php b/src/Api/Operator/Database.php index b2b64ef7..e44dc101 100644 --- a/src/Api/Operator/Database.php +++ b/src/Api/Operator/Database.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/DatabaseServer.php b/src/Api/Operator/DatabaseServer.php index 6b8066a0..bf286435 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Dns.php b/src/Api/Operator/Dns.php index ed3db23a..99b28421 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index 7c2d014c..49cb0048 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/EventLog.php b/src/Api/Operator/EventLog.php index 43adb05f..51881d3c 100644 --- a/src/Api/Operator/EventLog.php +++ b/src/Api/Operator/EventLog.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Ip.php b/src/Api/Operator/Ip.php index 1c1667bd..9476cd04 100644 --- a/src/Api/Operator/Ip.php +++ b/src/Api/Operator/Ip.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Locale.php b/src/Api/Operator/Locale.php index efe45e1e..867ff3d9 100644 --- a/src/Api/Operator/Locale.php +++ b/src/Api/Operator/Locale.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/LogRotation.php b/src/Api/Operator/LogRotation.php index ef0b60e1..f6ce2290 100644 --- a/src/Api/Operator/LogRotation.php +++ b/src/Api/Operator/LogRotation.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Mail.php b/src/Api/Operator/Mail.php index dadd0639..0a3343b5 100644 --- a/src/Api/Operator/Mail.php +++ b/src/Api/Operator/Mail.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/PhpHandler.php b/src/Api/Operator/PhpHandler.php index 1f54a689..4409d45f 100644 --- a/src/Api/Operator/PhpHandler.php +++ b/src/Api/Operator/PhpHandler.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ProtectedDirectory.php b/src/Api/Operator/ProtectedDirectory.php index a0dbb776..c4d2a7e0 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Reseller.php b/src/Api/Operator/Reseller.php index 147b468b..f0981d65 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ResellerPlan.php b/src/Api/Operator/ResellerPlan.php index 17d533fa..8c66f561 100644 --- a/src/Api/Operator/ResellerPlan.php +++ b/src/Api/Operator/ResellerPlan.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/SecretKey.php b/src/Api/Operator/SecretKey.php index b2be4cd5..78fcfb8e 100644 --- a/src/Api/Operator/SecretKey.php +++ b/src/Api/Operator/SecretKey.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Server.php b/src/Api/Operator/Server.php index 1a72d849..4a2ffb71 100644 --- a/src/Api/Operator/Server.php +++ b/src/Api/Operator/Server.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ServicePlan.php b/src/Api/Operator/ServicePlan.php index f9a1d887..8e0f38eb 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/ServicePlanAddon.php b/src/Api/Operator/ServicePlanAddon.php index 0b9e873c..7eee5799 100644 --- a/src/Api/Operator/ServicePlanAddon.php +++ b/src/Api/Operator/ServicePlanAddon.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Session.php b/src/Api/Operator/Session.php index b4713822..09d343c9 100644 --- a/src/Api/Operator/Session.php +++ b/src/Api/Operator/Session.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Site.php b/src/Api/Operator/Site.php index 273757bb..96955ce5 100644 --- a/src/Api/Operator/Site.php +++ b/src/Api/Operator/Site.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/SiteAlias.php b/src/Api/Operator/SiteAlias.php index fce9afc0..5b8281fa 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Subdomain.php b/src/Api/Operator/Subdomain.php index 5158993b..d0eb7681 100644 --- a/src/Api/Operator/Subdomain.php +++ b/src/Api/Operator/Subdomain.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Ui.php b/src/Api/Operator/Ui.php index 1577dec3..4fd3c608 100644 --- a/src/Api/Operator/Ui.php +++ b/src/Api/Operator/Ui.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/VirtualDirectory.php b/src/Api/Operator/VirtualDirectory.php index 504876a0..ab8677fc 100644 --- a/src/Api/Operator/VirtualDirectory.php +++ b/src/Api/Operator/VirtualDirectory.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index af952da2..67fae267 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Operator; diff --git a/src/Api/Struct/Certificate/Info.php b/src/Api/Struct/Certificate/Info.php index b12b146a..195bc145 100644 --- a/src/Api/Struct/Certificate/Info.php +++ b/src/Api/Struct/Certificate/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Certificate; diff --git a/src/Api/Struct/Customer/GeneralInfo.php b/src/Api/Struct/Customer/GeneralInfo.php index 32b7bf7b..cd73d088 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Customer; diff --git a/src/Api/Struct/Customer/Info.php b/src/Api/Struct/Customer/Info.php index 1a220589..3b20a16c 100644 --- a/src/Api/Struct/Customer/Info.php +++ b/src/Api/Struct/Customer/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Customer; diff --git a/src/Api/Struct/Database/Info.php b/src/Api/Struct/Database/Info.php index 4eb9a93e..6072624f 100644 --- a/src/Api/Struct/Database/Info.php +++ b/src/Api/Struct/Database/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Database; diff --git a/src/Api/Struct/Database/UserInfo.php b/src/Api/Struct/Database/UserInfo.php index 6419021b..ccc9de30 100644 --- a/src/Api/Struct/Database/UserInfo.php +++ b/src/Api/Struct/Database/UserInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Database; diff --git a/src/Api/Struct/DatabaseServer/Info.php b/src/Api/Struct/DatabaseServer/Info.php index 3793281a..ef887340 100644 --- a/src/Api/Struct/DatabaseServer/Info.php +++ b/src/Api/Struct/DatabaseServer/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\DatabaseServer; diff --git a/src/Api/Struct/Dns/Info.php b/src/Api/Struct/Dns/Info.php index 5558d61f..0b4dd7a2 100644 --- a/src/Api/Struct/Dns/Info.php +++ b/src/Api/Struct/Dns/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Dns; diff --git a/src/Api/Struct/EventLog/DetailedEvent.php b/src/Api/Struct/EventLog/DetailedEvent.php index 621412ce..9f545b16 100644 --- a/src/Api/Struct/EventLog/DetailedEvent.php +++ b/src/Api/Struct/EventLog/DetailedEvent.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\EventLog; diff --git a/src/Api/Struct/EventLog/Event.php b/src/Api/Struct/EventLog/Event.php index e179a324..672130a7 100644 --- a/src/Api/Struct/EventLog/Event.php +++ b/src/Api/Struct/EventLog/Event.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\EventLog; diff --git a/src/Api/Struct/Ip/Info.php b/src/Api/Struct/Ip/Info.php index 7c7ea68e..7d28e90c 100644 --- a/src/Api/Struct/Ip/Info.php +++ b/src/Api/Struct/Ip/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Ip; diff --git a/src/Api/Struct/Locale/Info.php b/src/Api/Struct/Locale/Info.php index f0323ac9..46f7528f 100644 --- a/src/Api/Struct/Locale/Info.php +++ b/src/Api/Struct/Locale/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Locale; diff --git a/src/Api/Struct/Mail/GeneralInfo.php b/src/Api/Struct/Mail/GeneralInfo.php index 878e0b0a..78429c10 100644 --- a/src/Api/Struct/Mail/GeneralInfo.php +++ b/src/Api/Struct/Mail/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Mail; diff --git a/src/Api/Struct/Mail/Info.php b/src/Api/Struct/Mail/Info.php index 58b22593..16c089ae 100644 --- a/src/Api/Struct/Mail/Info.php +++ b/src/Api/Struct/Mail/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Mail; diff --git a/src/Api/Struct/PhpHandler/Info.php b/src/Api/Struct/PhpHandler/Info.php index fc0ba8f7..567a525b 100644 --- a/src/Api/Struct/PhpHandler/Info.php +++ b/src/Api/Struct/PhpHandler/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\PhpHandler; diff --git a/src/Api/Struct/ProtectedDirectory/DataInfo.php b/src/Api/Struct/ProtectedDirectory/DataInfo.php index ec325630..41276be5 100644 --- a/src/Api/Struct/ProtectedDirectory/DataInfo.php +++ b/src/Api/Struct/ProtectedDirectory/DataInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\ProtectedDirectory; diff --git a/src/Api/Struct/ProtectedDirectory/Info.php b/src/Api/Struct/ProtectedDirectory/Info.php index ddf2f9d1..91a17f0b 100644 --- a/src/Api/Struct/ProtectedDirectory/Info.php +++ b/src/Api/Struct/ProtectedDirectory/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\ProtectedDirectory; diff --git a/src/Api/Struct/ProtectedDirectory/UserInfo.php b/src/Api/Struct/ProtectedDirectory/UserInfo.php index 1f6a5106..922a9016 100644 --- a/src/Api/Struct/ProtectedDirectory/UserInfo.php +++ b/src/Api/Struct/ProtectedDirectory/UserInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\ProtectedDirectory; diff --git a/src/Api/Struct/Reseller/GeneralInfo.php b/src/Api/Struct/Reseller/GeneralInfo.php index 804dd372..4dc6a4f1 100644 --- a/src/Api/Struct/Reseller/GeneralInfo.php +++ b/src/Api/Struct/Reseller/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Reseller; diff --git a/src/Api/Struct/Reseller/Info.php b/src/Api/Struct/Reseller/Info.php index f196294d..25b84a28 100644 --- a/src/Api/Struct/Reseller/Info.php +++ b/src/Api/Struct/Reseller/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Reseller; diff --git a/src/Api/Struct/SecretKey/Info.php b/src/Api/Struct/SecretKey/Info.php index 32686499..17b1aca7 100644 --- a/src/Api/Struct/SecretKey/Info.php +++ b/src/Api/Struct/SecretKey/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\SecretKey; diff --git a/src/Api/Struct/Server/Admin.php b/src/Api/Struct/Server/Admin.php index 7066ce53..49e8b1b7 100644 --- a/src/Api/Struct/Server/Admin.php +++ b/src/Api/Struct/Server/Admin.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/GeneralInfo.php b/src/Api/Struct/Server/GeneralInfo.php index 73c7a724..5dbc40d3 100644 --- a/src/Api/Struct/Server/GeneralInfo.php +++ b/src/Api/Struct/Server/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/Preferences.php b/src/Api/Struct/Server/Preferences.php index de2b362f..277d8b61 100644 --- a/src/Api/Struct/Server/Preferences.php +++ b/src/Api/Struct/Server/Preferences.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/SessionPreferences.php b/src/Api/Struct/Server/SessionPreferences.php index bf363bde..ef68c0d9 100644 --- a/src/Api/Struct/Server/SessionPreferences.php +++ b/src/Api/Struct/Server/SessionPreferences.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/Statistics.php b/src/Api/Struct/Server/Statistics.php index 65a5ee88..301b882f 100644 --- a/src/Api/Struct/Server/Statistics.php +++ b/src/Api/Struct/Server/Statistics.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/Server/Statistics/DiskSpace.php b/src/Api/Struct/Server/Statistics/DiskSpace.php index 35528474..b108a8cb 100644 --- a/src/Api/Struct/Server/Statistics/DiskSpace.php +++ b/src/Api/Struct/Server/Statistics/DiskSpace.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/Statistics/LoadAverage.php b/src/Api/Struct/Server/Statistics/LoadAverage.php index 8c733233..31792ea9 100644 --- a/src/Api/Struct/Server/Statistics/LoadAverage.php +++ b/src/Api/Struct/Server/Statistics/LoadAverage.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/Statistics/Memory.php b/src/Api/Struct/Server/Statistics/Memory.php index 48afaf58..771792cb 100644 --- a/src/Api/Struct/Server/Statistics/Memory.php +++ b/src/Api/Struct/Server/Statistics/Memory.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/Statistics/Objects.php b/src/Api/Struct/Server/Statistics/Objects.php index a6877666..881d230f 100644 --- a/src/Api/Struct/Server/Statistics/Objects.php +++ b/src/Api/Struct/Server/Statistics/Objects.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/Statistics/Other.php b/src/Api/Struct/Server/Statistics/Other.php index 3230a7f1..96cf89b2 100644 --- a/src/Api/Struct/Server/Statistics/Other.php +++ b/src/Api/Struct/Server/Statistics/Other.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/Statistics/Swap.php b/src/Api/Struct/Server/Statistics/Swap.php index ee1acdf9..6f0322e6 100644 --- a/src/Api/Struct/Server/Statistics/Swap.php +++ b/src/Api/Struct/Server/Statistics/Swap.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/Statistics/Version.php b/src/Api/Struct/Server/Statistics/Version.php index d3f84f5b..559d0ab7 100644 --- a/src/Api/Struct/Server/Statistics/Version.php +++ b/src/Api/Struct/Server/Statistics/Version.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server\Statistics; diff --git a/src/Api/Struct/Server/UpdatesInfo.php b/src/Api/Struct/Server/UpdatesInfo.php index 57eea6c8..45d7c8b6 100644 --- a/src/Api/Struct/Server/UpdatesInfo.php +++ b/src/Api/Struct/Server/UpdatesInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Server; diff --git a/src/Api/Struct/ServicePlan/Info.php b/src/Api/Struct/ServicePlan/Info.php index 8b3fbf9d..0dbc916c 100644 --- a/src/Api/Struct/ServicePlan/Info.php +++ b/src/Api/Struct/ServicePlan/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\ServicePlan; diff --git a/src/Api/Struct/Session/Info.php b/src/Api/Struct/Session/Info.php index 2ab3f401..5d86aaad 100644 --- a/src/Api/Struct/Session/Info.php +++ b/src/Api/Struct/Session/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Session; diff --git a/src/Api/Struct/Site/GeneralInfo.php b/src/Api/Struct/Site/GeneralInfo.php index 28e72f77..e36f97a8 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Site; diff --git a/src/Api/Struct/Site/HostingInfo.php b/src/Api/Struct/Site/HostingInfo.php index cab0fe0e..4aa2a356 100644 --- a/src/Api/Struct/Site/HostingInfo.php +++ b/src/Api/Struct/Site/HostingInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Site; diff --git a/src/Api/Struct/Site/Info.php b/src/Api/Struct/Site/Info.php index 0c2b6376..ee20cb69 100644 --- a/src/Api/Struct/Site/Info.php +++ b/src/Api/Struct/Site/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Site; diff --git a/src/Api/Struct/SiteAlias/GeneralInfo.php b/src/Api/Struct/SiteAlias/GeneralInfo.php index b2581c6c..117caf64 100644 --- a/src/Api/Struct/SiteAlias/GeneralInfo.php +++ b/src/Api/Struct/SiteAlias/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\SiteAlias; diff --git a/src/Api/Struct/SiteAlias/Info.php b/src/Api/Struct/SiteAlias/Info.php index 646e155b..2f2e2a29 100644 --- a/src/Api/Struct/SiteAlias/Info.php +++ b/src/Api/Struct/SiteAlias/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\SiteAlias; diff --git a/src/Api/Struct/Subdomain/Info.php b/src/Api/Struct/Subdomain/Info.php index 43e0595a..a468ec2c 100644 --- a/src/Api/Struct/Subdomain/Info.php +++ b/src/Api/Struct/Subdomain/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Subdomain; diff --git a/src/Api/Struct/Ui/CustomButton.php b/src/Api/Struct/Ui/CustomButton.php index 2a5edf3f..c4823730 100644 --- a/src/Api/Struct/Ui/CustomButton.php +++ b/src/Api/Struct/Ui/CustomButton.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Ui; diff --git a/src/Api/Struct/Webspace/DiskUsage.php b/src/Api/Struct/Webspace/DiskUsage.php index 23b2d489..039685cd 100644 --- a/src/Api/Struct/Webspace/DiskUsage.php +++ b/src/Api/Struct/Webspace/DiskUsage.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/GeneralInfo.php b/src/Api/Struct/Webspace/GeneralInfo.php index 5a702758..8640a6fd 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/HostingPropertyInfo.php b/src/Api/Struct/Webspace/HostingPropertyInfo.php index 3e1d3082..eb8c6633 100644 --- a/src/Api/Struct/Webspace/HostingPropertyInfo.php +++ b/src/Api/Struct/Webspace/HostingPropertyInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/Info.php b/src/Api/Struct/Webspace/Info.php index 4e928c5b..fd375d79 100644 --- a/src/Api/Struct/Webspace/Info.php +++ b/src/Api/Struct/Webspace/Info.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/Limit.php b/src/Api/Struct/Webspace/Limit.php index 655ea850..0d12fa14 100644 --- a/src/Api/Struct/Webspace/Limit.php +++ b/src/Api/Struct/Webspace/Limit.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/LimitDescriptor.php b/src/Api/Struct/Webspace/LimitDescriptor.php index 9526cbff..78f823ae 100644 --- a/src/Api/Struct/Webspace/LimitDescriptor.php +++ b/src/Api/Struct/Webspace/LimitDescriptor.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/LimitInfo.php b/src/Api/Struct/Webspace/LimitInfo.php index 162c2fc2..3772a115 100644 --- a/src/Api/Struct/Webspace/LimitInfo.php +++ b/src/Api/Struct/Webspace/LimitInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/Limits.php b/src/Api/Struct/Webspace/Limits.php index a8866f2f..098b1c60 100644 --- a/src/Api/Struct/Webspace/Limits.php +++ b/src/Api/Struct/Webspace/Limits.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PermissionDescriptor.php b/src/Api/Struct/Webspace/PermissionDescriptor.php index fea5f1e8..4e9ea444 100644 --- a/src/Api/Struct/Webspace/PermissionDescriptor.php +++ b/src/Api/Struct/Webspace/PermissionDescriptor.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PermissionInfo.php b/src/Api/Struct/Webspace/PermissionInfo.php index 42e5dfbf..3fff014d 100644 --- a/src/Api/Struct/Webspace/PermissionInfo.php +++ b/src/Api/Struct/Webspace/PermissionInfo.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PhpSettings.php b/src/Api/Struct/Webspace/PhpSettings.php index 05a72810..5e597297 100644 --- a/src/Api/Struct/Webspace/PhpSettings.php +++ b/src/Api/Struct/Webspace/PhpSettings.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php index 2331e48d..5df97da3 100644 --- a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php +++ b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api\Struct\Webspace; diff --git a/src/Api/XmlResponse.php b/src/Api/XmlResponse.php index 825ea671..95076354 100644 --- a/src/Api/XmlResponse.php +++ b/src/Api/XmlResponse.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskX\Api; diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index f25f8b03..35b62afe 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ApiClientTest.php b/tests/ApiClientTest.php index 7931731b..05df53e7 100644 --- a/tests/ApiClientTest.php +++ b/tests/ApiClientTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/CertificateTest.php b/tests/CertificateTest.php index fbb94a16..a65ee85a 100644 --- a/tests/CertificateTest.php +++ b/tests/CertificateTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/CustomerTest.php b/tests/CustomerTest.php index 5cffa152..3bd4f802 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DatabaseServerTest.php b/tests/DatabaseServerTest.php index 71b2e2f3..4dfa6ed7 100644 --- a/tests/DatabaseServerTest.php +++ b/tests/DatabaseServerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index f87ef721..19d963d5 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DnsTemplateTest.php b/tests/DnsTemplateTest.php index 69b06d0a..40e61ae2 100644 --- a/tests/DnsTemplateTest.php +++ b/tests/DnsTemplateTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/DnsTest.php b/tests/DnsTest.php index b7f84fee..634cd681 100644 --- a/tests/DnsTest.php +++ b/tests/DnsTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/EventLogTest.php b/tests/EventLogTest.php index bf2eb28b..7023dd43 100644 --- a/tests/EventLogTest.php +++ b/tests/EventLogTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/IpTest.php b/tests/IpTest.php index a9bc70f4..15a2ef2c 100644 --- a/tests/IpTest.php +++ b/tests/IpTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/LocaleTest.php b/tests/LocaleTest.php index a9a480a7..b86756bf 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/MailTest.php b/tests/MailTest.php index 4afd05ff..408d877a 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/PhpHandlerTest.php b/tests/PhpHandlerTest.php index 8c94c08e..ee632ccf 100644 --- a/tests/PhpHandlerTest.php +++ b/tests/PhpHandlerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ProtectedDirectoryTest.php b/tests/ProtectedDirectoryTest.php index 319c079b..6caa9875 100644 --- a/tests/ProtectedDirectoryTest.php +++ b/tests/ProtectedDirectoryTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ResellerTest.php b/tests/ResellerTest.php index 025a77a7..89043192 100644 --- a/tests/ResellerTest.php +++ b/tests/ResellerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php index be5dd1b7..9d6e92f0 100644 --- a/tests/SecretKeyTest.php +++ b/tests/SecretKeyTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 217d2315..1fb06533 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/ServicePlanTest.php b/tests/ServicePlanTest.php index 56bc96c0..04232dc0 100644 --- a/tests/ServicePlanTest.php +++ b/tests/ServicePlanTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SessionTest.php b/tests/SessionTest.php index a0a42faf..a013ce25 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SiteAliasTest.php b/tests/SiteAliasTest.php index 4538d104..6cb4f0a0 100644 --- a/tests/SiteAliasTest.php +++ b/tests/SiteAliasTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SiteTest.php b/tests/SiteTest.php index f53f1f52..739aaded 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/SubdomainTest.php b/tests/SubdomainTest.php index 8b5e1752..85bac57c 100644 --- a/tests/SubdomainTest.php +++ b/tests/SubdomainTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/UiTest.php b/tests/UiTest.php index 03a3d44e..f0754aad 100644 --- a/tests/UiTest.php +++ b/tests/UiTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/tests/Utility/KeyLimitChecker.php b/tests/Utility/KeyLimitChecker.php index 851e577f..c34450fd 100644 --- a/tests/Utility/KeyLimitChecker.php +++ b/tests/Utility/KeyLimitChecker.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest\Utility; diff --git a/tests/Utility/PasswordProvider.php b/tests/Utility/PasswordProvider.php index 22bd737e..5b1431a3 100644 --- a/tests/Utility/PasswordProvider.php +++ b/tests/Utility/PasswordProvider.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest\Utility; diff --git a/tests/WebspaceTest.php b/tests/WebspaceTest.php index 01e63323..c271549b 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceTest.php @@ -1,5 +1,5 @@ <?php -// Copyright 1999-2021. Plesk International GmbH. +// Copyright 1999-2022. Plesk International GmbH. namespace PleskXTest; diff --git a/wait-for-plesk.sh b/wait-for-plesk.sh index 2daeb0f2..df4fa987 100755 --- a/wait-for-plesk.sh +++ b/wait-for-plesk.sh @@ -1,5 +1,5 @@ #!/bin/bash -### Copyright 1999-2021. Plesk International GmbH. +### Copyright 1999-2022. Plesk International GmbH. while : ; do curl -ksL https://plesk:8443/ | grep "<title>Plesk" > /dev/null From 4bef1cd7f8bda46899124f4efa3e08060a0c211b Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Thu, 10 Mar 2022 17:22:20 +0600 Subject: [PATCH 69/73] Fix #110: correct processing of multiple IPs on webspace creation --- src/Api/Operator/Webspace.php | 6 +++++- tests/WebspaceTest.php | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Api/Operator/Webspace.php b/src/Api/Operator/Webspace.php index 67fae267..a3f0563b 100644 --- a/src/Api/Operator/Webspace.php +++ b/src/Api/Operator/Webspace.php @@ -75,7 +75,11 @@ public function create(array $properties, array $hostingProperties = null, strin $infoGeneral = $info->addChild('gen_setup'); foreach ($properties as $name => $value) { - $infoGeneral->addChild($name, $value); + if (is_array($value)) { + continue; + } else { + $infoGeneral->addChild($name, (string) $value); + } } if ($hostingProperties) { diff --git a/tests/WebspaceTest.php b/tests/WebspaceTest.php index c271549b..09c863ed 100644 --- a/tests/WebspaceTest.php +++ b/tests/WebspaceTest.php @@ -222,4 +222,22 @@ public function testSetProperties() static::$client->webspace()->delete('id', $webspace->id); } + + public function testIpsAsArray() + { + $webspace = static::$client->webspace()->create( + [ + 'name' => "test-ips.test", + 'ip_address' => [static::getIpAddress()], + ], + [ + 'ftp_login' => "u-ips", + 'ftp_password' => PasswordProvider::STRONG_PASSWORD, + ] + ); + + $this->assertGreaterThan(0, $webspace->id); + + static::$client->webspace()->delete('id', $webspace->id); + } } From 0120437e7cb6d38c246eb7ff7e38858aa6e41882 Mon Sep 17 00:00:00 2001 From: Alexandr Bashurov <abashurov@plesk.com> Date: Mon, 28 Mar 2022 20:25:14 +0700 Subject: [PATCH 70/73] BUGFIX EXTREST-143 Extend already set properties instead of overwriting them --- src/Api/Client.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index f622028f..74d274c7 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -361,8 +361,10 @@ private function arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = nul $el = is_int($key) && $parentEl ? $parentEl : $key; if (is_array($value)) { $this->arrayToXml($value, $this->isAssocArray($value) ? $xml->addChild($el) : $xml, $el); - } else { + } elseif(!isset($xml->{$el})) { $xml->{$el} = (string) $value; + } else { + $xml->{$el}[] = (string) $value; } } From 465c2074e17cc6b80ca675b2a63a4b3c1f1cb5ac Mon Sep 17 00:00:00 2001 From: Alexandr Bashurov <abashurov@plesk.com> Date: Mon, 28 Mar 2022 23:57:08 +0700 Subject: [PATCH 71/73] BUGFIX EXTREST-143 Fix incorrect line formatting --- src/Api/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index 74d274c7..0562d73c 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -361,7 +361,7 @@ private function arrayToXml(array $array, SimpleXMLElement $xml, $parentEl = nul $el = is_int($key) && $parentEl ? $parentEl : $key; if (is_array($value)) { $this->arrayToXml($value, $this->isAssocArray($value) ? $xml->addChild($el) : $xml, $el); - } elseif(!isset($xml->{$el})) { + } elseif (!isset($xml->{$el})) { $xml->{$el} = (string) $value; } else { $xml->{$el}[] = (string) $value; From 9f7a06fd130079eb5779c87408df077350187c96 Mon Sep 17 00:00:00 2001 From: Alexandr Bashurov <abashurov@plesk.com> Date: Tue, 29 Mar 2022 14:03:28 +0700 Subject: [PATCH 72/73] TECH Add a test for extended field values --- tests/MailTest.php | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/MailTest.php b/tests/MailTest.php index 408d877a..21505d99 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -47,6 +47,57 @@ public function testCreate() static::$client->mail()->delete('name', $mailname->name, static::$webspace->id); } + public function testCreateMultiForwarding() + { + $mailname = static::$client->request([ + 'mail' => [ + 'create' => [ + 'filter' => [ + 'site-id' => static::$webspace->id, + 'mailname' => [ + 'name' => 'test', + 'mailbox' => [ + 'enabled' => true, + ], + 'forwarding' => [ + 'enabled' => true, + 'address' => [ + 'user1@example.com', + 'user2@example.com', + ], + ], + 'alias' => [ + 'test1', + 'test2', + ], + 'password' => [ + 'value' => PasswordProvider::STRONG_PASSWORD, + ], + ], + ], + ], + ], + ]); + + $mailnameInfo = static::$client->request([ + 'mail' => [ + 'get_info' => [ + 'filter' => [ + 'site-id' => static::$webspace->id, + 'name' => 'test', + ], + 'forwarding' => null, + 'aliases' => null, + ], + ], + ]); + + $this->assertSame(2, count($mailnameInfo->mailname->forwarding->address)); + $this->assertSame(2, count($mailnameInfo->mailname->alias)); + + static::$client->mail()->delete('name', 'test', static::$webspace->id); + } + public function testDelete() { $mailname = static::$client->mail()->create('test', static::$webspace->id); From 9d134fb068a09a78c88c0733811f1e9ed462aa1f Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov <ayuzhakov@plesk.com> Date: Wed, 9 Nov 2022 18:02:44 +0200 Subject: [PATCH 73/73] Fix #116: correct handling of empty resellers list --- src/Api/Operator/Reseller.php | 4 ++++ tests/CustomerTest.php | 6 ++++++ tests/ResellerTest.php | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/src/Api/Operator/Reseller.php b/src/Api/Operator/Reseller.php index f0981d65..bd918144 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -69,6 +69,10 @@ public function getAll($field = null, $value = null): array $items = []; foreach ($response->xpath('//result') as $xmlResult) { + if (!$xmlResult->data) { + continue; + } + $item = new Struct\GeneralInfo($xmlResult->data); $item->id = (int) $xmlResult->id; $items[] = $item; diff --git a/tests/CustomerTest.php b/tests/CustomerTest.php index 3bd4f802..760ee45a 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerTest.php @@ -85,6 +85,12 @@ public function testGetAll() static::$client->customer()->delete('login', 'customer-b'); } + public function testGetAllEmpty() + { + $customersInfo = static::$client->customer()->getAll(); + $this->assertCount(0, $customersInfo); + } + public function testEnable() { $customer = static::$client->customer()->create($this->customerProperties); diff --git a/tests/ResellerTest.php b/tests/ResellerTest.php index 89043192..9c43f4db 100644 --- a/tests/ResellerTest.php +++ b/tests/ResellerTest.php @@ -74,4 +74,10 @@ public function testGetAll() static::$client->reseller()->delete('login', 'reseller-a'); static::$client->reseller()->delete('login', 'reseller-b'); } + + public function testGetAllEmpty() + { + $resellersInfo = static::$client->reseller()->getAll(); + $this->assertCount(0, $resellersInfo); + } }