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 diff --git a/.gitignore b/.gitignore index 6949a608..e7710589 100755 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ .idea /nbproject/ /.phpunit.result.cache -/php/tests/node_modules/ +/coverage.xml \ No newline at end of file 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/.travis.yml b/.travis.yml deleted file mode 100644 index e38b9d80..00000000 --- a/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -services: docker - -script: - - docker-compose run tests diff --git a/Dockerfile b/Dockerfile index 66fbb3ef..b114ff79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM php:7.3-cli +FROM php:7.4-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/LICENSE b/LICENSE index 0176136a..914de1aa 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 1999-2020. 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/README.md b/README.md index eaa886c1..8cf9126c 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ ## 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) -[![StyleCI](https://styleci.io/repos/26514840/shield?branch=master)](https://styleci.io/repos/26514840) +[![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) +[![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 31fd9ac4..b056e4b8 100755 --- a/composer.json +++ b/composer.json @@ -14,21 +14,27 @@ } ], "require": { - "php": "^7.3", + "php": "^7.4 || ^8.0", "ext-curl": "*", "ext-xml": "*", "ext-simplexml": "*" }, "require-dev": { - "phpunit/phpunit": "^8", - "spatie/phpunit-watcher": "^1.22" + "phpunit/phpunit": "^9", + "spatie/phpunit-watcher": "^1.22", + "vimeo/psalm": "^4.10", + "squizlabs/php_codesniffer": "^3.6" }, "config": { "process-timeout": 0 }, "scripts": { "test": "phpunit", - "test:watch": "phpunit-watcher watch" + "test:watch": "phpunit-watcher watch", + "lint": [ + "psalm", + "phpcs" + ] }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 392b946c..9c968df9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,34 +4,200 @@ "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": "d10c51a90b73fb910cfb5516625446f8", "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.3.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/clue/reactphp-stdio.git", - "reference": "5f42a3a5a29f52432f0f68b57890353e8ca65069" + "reference": "c73bcdc228eca627992c0088f7bc30b794fde8da" }, "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/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", "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 +215,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 +233,34 @@ "stdio", "stdout" ], - "time": "2019-08-28T12:01:30+00:00" + "support": { + "issues": "https://github.com/clue/reactphp-stdio/issues", + "source": "https://github.com/clue/reactphp-stdio/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-10-25T08:01:22+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 +268,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 +284,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 +306,34 @@ "vt100", "xterm" ], - "time": "2018-07-09T08:20:33+00:00" + "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", + "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 +341,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 +357,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,43 +369,58 @@ "utf-8", "utf8" ], - "time": "2017-07-06T07:43:22+00:00" + "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", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-11-06T11:48:09+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.3.0", + "name": "composer/package-versions-deprecated", + "version": "1.11.99.4", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b174585d1fe49ceed21928a945138948cb394600" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", + "reference": "b174585d1fe49ceed21928a945138948cb394600", "shasum": "" }, "require": { - "php": "^7.1" + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" }, - "type": "library", + "type": "composer-plugin", "extra": { + "class": "PackageVersions\\Installer", "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "PackageVersions\\": "src/PackageVersions" } }, "notification-url": "https://packagist.org/downloads/", @@ -221,42 +430,64 @@ "authors": [ { "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" + "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": "2019-10-21T16:45:58+00:00" + "time": "2021-09-13T08:41:34+00:00" }, { - "name": "evenement/evenement", - "version": "v3.0.1", + "name": "composer/semver", + "version": "3.2.6", "source": { "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" + "url": "https://github.com/composer/semver.git", + "reference": "83e511e247de329283478496f7a1e114c9517506" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", + "reference": "83e511e247de329283478496f7a1e114c9517506", "shasum": "" }, "require": { - "php": ">=7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { - "psr-0": { - "Evenement": "src" + "psr-4": { + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -265,51 +496,75 @@ ], "authors": [ { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" + "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": "Événement is a very simple event dispatching library for PHP", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "event-dispatcher", - "event-emitter" + "semantic", + "semver", + "validation", + "versioning" ], - "time": "2017-07-23T21:35:13+00:00" + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.6" + }, + "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-10-25T11:34:17+00:00" }, { - "name": "jolicode/jolinotif", - "version": "v2.0.2", + "name": "composer/xdebug-handler", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/jolicode/JoliNotif.git", - "reference": "0b5f786c5f181b3916df616ca191892713257662" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/0b5f786c5f181b3916df616ca191892713257662", - "reference": "0b5f786c5f181b3916df616ca191892713257662", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", "shasum": "" }, "require": { - "php": ">=7.0", - "symfony/process": "~3.3|~4.0" + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.0", - "symfony/phpunit-bridge": "^3.3" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, - "bin": [ - "jolinotif" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { - "Joli\\JoliNotif\\": "src/" + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -318,306 +573,325 @@ ], "authors": [ { - "name": "Loïck Piera", - "email": "pyrech@gmail.com" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Send desktop notifications on Windows, Linux, MacOS.", + "description": "Restarts a process without Xdebug.", "keywords": [ - "MAC", - "growl", - "linux", - "notification", - "windows" + "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": "2019-02-26T18:10:50+00:00" + "time": "2021-07-31T17:03:58+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.9.4", + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", "shasum": "" }, "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" + "php": ">=5.3.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" }, "type": "library", "autoload": { "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] + "XdgBaseDir\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2019-12-15T19:12:40+00:00" + "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": "phar-io/manifest", - "version": "1.0.3", + "name": "doctrine/instantiator", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { - "ext-dom": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^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.0.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "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" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { - "name": "phar-io/version", - "version": "2.0.1", + "name": "evenement/evenement", + "version": "v3.0.1", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "url": "https://github.com/igorw/evenement.git", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "Evenement": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "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": "phpdocumentor/reflection-common", - "version": "2.0.0", + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", "shasum": "" }, "require": { - "php": ">=7.1" + "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": "~6" + "phpunit/phpunit": "^7.0 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "AdvancedJsonRpc\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "ISC" ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Felix Becker", + "email": "felix.b@outlook.com" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2018-08-07T13:53:10+00:00" + "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": "phpdocumentor/reflection-docblock", - "version": "4.3.4", + "name": "felixfbecker/language-server-protocol", + "version": "1.5.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", "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" + "php": ">=7.1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpdocumentor/type-resolver": "0.4.*", - "phpunit/phpunit": "^6.4" + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "LanguageServerProtocol\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "ISC" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Felix Becker", + "email": "felix.b@outlook.com" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-12-28T18:55:12+00:00" + "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": "phpdocumentor/type-resolver", - "version": "1.0.1", + "name": "jolicode/jolinotif", + "version": "v2.3.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "url": "https://github.com/jolicode/JoliNotif.git", + "reference": "9cca717bbc47aa2ffeca51d77daa13b824a489ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/jolicode/JoliNotif/zipball/9cca717bbc47aa2ffeca51d77daa13b824a489ee", + "reference": "9cca717bbc47aa2ffeca51d77daa13b824a489ee", "shasum": "" }, "require": { - "php": "^7.1", - "phpdocumentor/reflection-common": "^2.0" + "php": ">=7.0", + "symfony/process": "^3.3|^4.0|^5.0" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "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" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "2.3.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "Joli\\JoliNotif\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -626,169 +900,174 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Loïck Piera", + "email": "pyrech@gmail.com" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "description": "Send desktop notifications on Windows, Linux, MacOS.", + "keywords": [ + "MAC", + "growl", + "linux", + "notification", + "windows" + ], + "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": "phpspec/prophecy", - "version": "1.10.1", + "name": "myclabs/deep-copy", + "version": "1.10.2", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "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" + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" - } + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2019-12-22T21:05:45+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "7.0.10", + "name": "netresearch/jsonmapper", + "version": "v4.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", - "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", "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", - "theseer/tokenizer": "^1.1.3" + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "squizlabs/php_codesniffer": "~3.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "JsonMapper": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "OSL-3.0" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2019-11-20T13:55:58+00:00" + "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": "phpunit/php-file-iterator", - "version": "2.0.2", + "name": "nikic/php-parser", + "version": "v4.13.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd", "shasum": "" }, "require": { - "php": "^7.1" + "ext-tokenizer": "*", + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "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": "2.0.x-dev" + "dev-master": "4.9-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -796,84 +1075,98 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nikita Popov" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "A PHP parser written in PHP", "keywords": [ - "filesystem", - "iterator" + "parser", + "php" ], - "time": "2018-09-13T20:33:42+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1" + }, + "time": "2021-11-03T20:52:16+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "openlss/lib-array2xml", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.2" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "LSS": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "Apache-2.0" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "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": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", "keywords": [ - "template" + "array", + "array conversion", + "xml", + "xml conversion" ], - "time": "2015-06-21T13:50:34+00:00" + "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": "phpunit/php-timer", - "version": "2.1.2", + "name": "phar-io/manifest", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -887,45 +1180,46 @@ ], "authors": [ { - "name": "Sebastian Bergmann", + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", - "role": "lead" + "role": "Developer" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2019-06-07T04:22:29+00:00" + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "3.1.1", + "name": "phar-io/version", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -936,127 +1230,116 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2019-09-17T06:23:10+00:00" + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" }, { - "name": "phpunit/phpunit", - "version": "8.5.1", + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7870c78da3c5e4883eaef36ae47853ebb3cb86f2", - "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2.0", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.1", - "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" - }, - "require-dev": { - "ext-pdo": "*" + "php": "^7.2 || ^8.0" }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "8.5-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", "keywords": [ - "phpunit", - "testing", - "xunit" + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ], - "time": "2019-12-25T14:49:39+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" }, { - "name": "psr/container", - "version": "1.0.0", + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { - "php": ">=5.3.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": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1065,133 +1348,178 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" }, { - "name": "react/event-loop", - "version": "v1.1.1", + "name": "phpdocumentor/type-resolver", + "version": "1.5.1", "source": { "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "6d24de090cd59cfc830263cfba965be77b563c13" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/6d24de090cd59cfc830263cfba965be77b563c13", - "reference": "6d24de090cd59cfc830263cfba965be77b563c13", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" - }, - "suggest": { - "ext-event": "~1.0 for ExtEventLoop", - "ext-pcntl": "For signal handling support when using the StreamSelectLoop", - "ext-uv": "* for ExtUvLoop" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, "autoload": { "psr-4": { - "React\\EventLoop\\": "src" + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": [ - "asynchronous", - "event-loop" + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } ], - "time": "2020-01-01T18:39:52+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + }, + "time": "2021-10-02T14:08:47+00:00" }, { - "name": "react/stream", - "version": "v1.1.0", + "name": "phpspec/prophecy", + "version": "1.14.0", "source": { "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "50426855f7a77ddf43b9266c22320df5bf6c6ce6" + "url": "https://github.com/phpspec/prophecy.git", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/50426855f7a77ddf43b9266c22320df5bf6c6ce6", - "reference": "50426855f7a77ddf43b9266c22320df5bf6c6ce6", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "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" + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, "autoload": { "psr-4": { - "React\\Stream\\": "src" + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", "keywords": [ - "event-driven", - "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" ], - "time": "2019-01-01T16:15:09+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": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "name": "phpunit/php-code-coverage", + "version": "9.2.9", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b" }, "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/php-code-coverage/zipball/f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", + "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -1206,34 +1534,48 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "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" + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.9" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-19T15:21:02+00:00" }, { - "name": "sebastian/comparator", - "version": "3.0.2", + "name": "phpunit/php-file-iterator", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -1251,57 +1593,58 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "comparator", - "compare", - "equality" + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2018-07-12T15:12:46+00:00" + "time": "2020-09-28T05:57:25+00:00" }, { - "name": "sebastian/diff", - "version": "3.0.2", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" }, - "type": "library", + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1314,52 +1657,53 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2019-02-04T06:01:07+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "sebastian/environment", - "version": "4.2.3", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1374,44 +1718,51 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2019-11-20T08:46:58+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "sebastian/exporter", - "version": "3.1.2", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1426,68 +1777,94 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "export", - "exporter" + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2019-09-14T09:02:43+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "sebastian/global-state", - "version": "3.0.0", + "name": "phpunit/phpunit", + "version": "9.5.10", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { - "php": "^7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { - "ext-uopz": "*" + "ext-soap": "*", + "ext-xdebug": "*" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "9.5-dev" } }, "autoload": { "classmap": [ "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1497,227 +1874,315 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", "keywords": [ - "global state" + "phpunit", + "testing", + "xunit" ], - "time": "2019-02-01T05:30:01+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:38:51+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "3.0.3", + "name": "psr/container", + "version": "1.1.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" + "php": ">=7.4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "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" + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" }, { - "name": "sebastian/object-reflector", - "version": "1.1.1", + "name": "psr/log", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "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" + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" }, { - "name": "sebastian/recursion-context", - "version": "3.0.0", + "name": "react/event-loop", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "be6dee480fc4692cec0504e65eb486e3be1aa6f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/be6dee480fc4692cec0504e65eb486e3be1aa6f2", + "reference": "be6dee480fc4692cec0504e65eb486e3be1aa6f2", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } + "suggest": { + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop", + "ext-uv": "* for ExtUvLoop" }, + "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\EventLoop\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "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": "sebastian/resource-operations", - "version": "2.0.1", + "name": "react/stream", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + "url": "https://github.com/reactphp/stream.git", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", "shasum": "" }, "require": { - "php": "^7.1" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, + "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\Stream\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "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": "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" - }, - { - "name": "sebastian/type", - "version": "1.1.3", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "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", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", "shasum": "" }, "require": { - "php": "^7.2" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1736,31 +2201,44 @@ "role": "lead" } ], - "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" + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1779,222 +2257,1495 @@ "role": "lead" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" }, { - "name": "spatie/phpunit-watcher", - "version": "1.22.0", + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/spatie/phpunit-watcher.git", - "reference": "dee58ae54d3bc4eccc2b3d7006444f535a693f18" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/dee58ae54d3bc4eccc2b3d7006444f535a693f18", - "reference": "dee58ae54d3bc4eccc2b3d7006444f535a693f18", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "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", - "yosymfony/resource-watcher": "^2.0" - }, - "conflict": { - "yosymfony/resource-watcher": "<2.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^9.3" }, - "bin": [ - "phpunit-watcher" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { - "psr-4": { - "Spatie\\PhpUnitWatcher\\": "src" + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" } ], - "description": "Automatically rerun PHPUnit tests when source code changes", - "homepage": "https://github.com/spatie/phpunit-watcher", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ - "phpunit-watcher", - "spatie" + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2020-01-04T22:46:42+00:00" + "time": "2020-10-26T15:49:45+00:00" }, { - "name": "symfony/console", - "version": "v5.0.2", + "name": "sebastian/complexity", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47" + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fe6e3cd889ca64172d7a742a2eb058541404ef47", - "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", "shasum": "" }, "require": { - "php": "^7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" + "nikic/php-parser": "^4.7", + "php": ">=7.3" }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "provide": { - "psr/log-implementation": "1.0" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "autoload": { + "classmap": [ + "src/" + ] }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2019-12-17T13:20:22+00:00" + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" }, { - "name": "symfony/finder", - "version": "v5.0.2", + "name": "sebastian/environment", + "version": "5.1.3", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "17874dd8ab9a19422028ad56172fb294287a701b" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/17874dd8ab9a19422028ad56172fb294287a701b", - "reference": "17874dd8ab9a19422028ad56172fb294287a701b", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "spatie/phpunit-watcher", + "version": "1.23.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/phpunit-watcher.git", + "reference": "548be41abab87336ef95cef5bf5cbd564bce5c26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/phpunit-watcher/zipball/548be41abab87336ef95cef5bf5cbd564bce5c26", + "reference": "548be41abab87336ef95cef5bf5cbd564bce5c26", + "shasum": "" + }, + "require": { + "clue/stdio-react": "^2.4", + "jolicode/jolinotif": "^2.2", + "php": "^7.2 | ^8.0", + "symfony/console": "^5.2", + "symfony/finder": "^5.2", + "symfony/process": "^5.2", + "symfony/yaml": "^5.2", + "yosymfony/resource-watcher": "^2.0" + }, + "conflict": { + "yosymfony/resource-watcher": "<2.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 | ^9.0" + }, + "bin": [ + "phpunit-watcher" + ], + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\PhpUnitWatcher\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Automatically rerun PHPUnit tests when source code changes", + "homepage": "https://github.com/spatie/phpunit-watcher", + "keywords": [ + "phpunit-watcher", + "spatie" + ], + "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": "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.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "3e7ab8f5905058984899b05a4648096f558bfeba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/3e7ab8f5905058984899b05a4648096f558bfeba", + "reference": "3e7ab8f5905058984899b05a4648096f558bfeba", + "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.16", + "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" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.3.11" + }, + "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-11-21T19:41:05+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.3.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "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", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-04T21:20:46+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2019-11-18T17:27:11+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { - "ext-ctype": "For best performance" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" @@ -2006,56 +3757,78 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", + "mbstring", "polyfill", - "portable" + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, + "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": "2019-11-27T13:56:44+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", + "name": "symfony/polyfill-php73", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2072,43 +3845,63 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", "polyfill", "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.13.1", + "name": "symfony/polyfill-php80", + "version": "v1.23.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, "files": [ "bootstrap.php" @@ -2122,6 +3915,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2131,7 +3928,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2139,31 +3936,44 @@ "portable", "shim" ], - "time": "2019-11-27T16:25:15+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, + "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-07-28T13:41:28+00:00" }, { "name": "symfony/process", - "version": "v4.4.2", + "version": "v5.3.12", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b" + "reference": "e498803a6e95ede78e9d5646ad32a2255c033a6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b84501ad50adb72a94fb460a5b5c91f693e99c9b", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b", + "url": "https://api.github.com/repos/symfony/process/zipball/e498803a6e95ede78e9d5646ad32a2255c033a6a", + "reference": "e498803a6e95ede78e9d5646ad32a2255c033a6a", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" @@ -2186,27 +3996,48 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", - "time": "2019-12-06T10:06:46+00:00" + "support": { + "source": "https://github.com/symfony/process/tree/v5.3.12" + }, + "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-11-22T22:39:13+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" }, "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/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", "shasum": "" }, "require": { - "php": "^7.2.5", - "psr/container": "^1.0" + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -2214,7 +4045,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2246,24 +4081,125 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T16:48:04+00:00" + }, + { + "name": "symfony/string", + "version": "v5.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "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", + "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": "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", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.3.10" + }, + "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-10-27T18:21:46+00:00" }, { "name": "symfony/yaml", - "version": "v5.0.2", + "version": "v5.3.11", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "847661e77afa48d99ecfa508e8b60f0b029a19c0" + "reference": "226638aa877bc4104e619a15f27d8141cd6b4e4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/847661e77afa48d99ecfa508e8b60f0b029a19c0", - "reference": "847661e77afa48d99ecfa508e8b60f0b029a19c0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/226638aa877bc4104e619a15f27d8141cd6b4e4a", + "reference": "226638aa877bc4104e619a15f27d8141cd6b4e4a", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -2275,12 +4211,10 @@ "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" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -2303,29 +4237,46 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", - "time": "2019-12-10T11:06:55+00:00" + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.3.11" + }, + "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-11-20T16:42:42+00:00" }, { "name": "theseer/tokenizer", - "version": "1.1.3", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -2345,33 +4296,155 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+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": "vimeo/psalm", + "version": "4.13.1", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "5cf660f63b548ccd4a56f62d916ee4d6028e01a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/5cf660f63b548ccd4a56f62d916ee4d6028e01a3", + "reference": "5cf660f63b548ccd4a56f62d916ee4d6028e01a3", + "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.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 || ^6.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 || ^6.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" + }, + "suggest": { + "ext-curl": "In order to send data to shepherd", + "ext-igbinary": "^2.0.5 is required, used to serialize caching data" + }, + "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.13.1" + }, + "time": "2021-11-23T23:52:49+00:00" }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.10.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "vimeo/psalm": "<3.6.0" + "phpstan/phpstan": "<0.12.20", + "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/" @@ -2393,7 +4466,62 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+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": "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" + }, + "abandoned": "symfony/filesystem", + "time": "2015-12-17T08:42:14+00:00" }, { "name": "yosymfony/resource-watcher", @@ -2446,6 +4574,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" } ], @@ -2455,10 +4587,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3", + "php": "^7.4 || ^8.0", "ext-curl": "*", "ext-xml": "*", "ext-simplexml": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.1.0" } diff --git a/docker-compose.yml b/docker-compose.yml index 0862227d..a0332132 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,21 +1,31 @@ version: '2' services: plesk: - image: plesk/plesk + 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: REMOTE_URL: https://plesk:8443 - REMOTE_PASSWORD: changeme - command: bash -c "cd /opt/api-php-lib && composer install && ./wait-for-plesk.sh && composer test -- --testdox" + REMOTE_PASSWORD: changeme1Q** + command: > + bash -c "cd /opt/api-php-lib + && composer install + && ./wait-for-plesk.sh + && composer lint + && composer test -- --testdox" depends_on: - plesk links: - plesk volumes: - .:/opt/api-php-lib - 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 @@ + + + src + tests + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bd75a98d..d32b2193 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,25 +1,23 @@ - - - - - ./tests - - - - - - ./src - - - - - - - - + + + + + ./src + + + + + + + + ./tests + + + + + + + + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 00000000..43b6fdac --- /dev/null +++ b/psalm.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + diff --git a/src/Api/Struct.php b/src/Api/AbstractStruct.php similarity index 58% rename from src/Api/Struct.php rename to src/Api/AbstractStruct.php index aa5a1377..042bd46c 100644 --- a/src/Api/Struct.php +++ b/src/Api/AbstractStruct.php @@ -1,13 +1,19 @@ {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,9 +66,9 @@ protected function _initScalarProperties($apiResponse, array $properties) * * @return string */ - private function _underToCamel($under) + 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 0e7a1c9e..78095614 100755 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -1,5 +1,5 @@ _host = $host; - $this->_port = $port; - $this->_protocol = $protocol; + $this->host = $host; + $this->port = $port; + $this->protocol = $protocol; } /** @@ -48,10 +49,10 @@ 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; + $this->login = $login; + $this->password = $password; } /** @@ -59,9 +60,19 @@ public function setCredentials($login, $password) * * @param string $secretKey */ - public function setSecretKey($secretKey) + public function setSecretKey(string $secretKey): void { - $this->_secretKey = $secretKey; + $this->secretKey = $secretKey; + } + + /** + * Set proxy server for requests. + * + * @param string $proxy + */ + public function setProxy(string $proxy): void + { + $this->proxy = $proxy; } /** @@ -69,19 +80,20 @@ public function setSecretKey($secretKey) * * @param string $version */ - public function setVersion($version) + 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) + public function setVerifyResponse(callable $function = null): void { - $this->_verifyResponseCallback = $function; + $this->verifyResponseCallback = $function; } /** @@ -89,9 +101,9 @@ public function setVerifyResponse(callable $function = null) * * @return string */ - public function getHost() + public function getHost(): string { - return $this->_host; + return $this->host; } /** @@ -99,9 +111,9 @@ public function getHost() * * @return int */ - public function getPort() + public function getPort(): int { - return $this->_port; + return $this->port; } /** @@ -109,9 +121,9 @@ public function getPort() * * @return string */ - public function getProtocol() + public function getProtocol(): string { - return $this->_protocol; + return $this->protocol; } /** @@ -121,11 +133,11 @@ public function getProtocol() * * @return SimpleXMLElement */ - public function getPacket($version = null) + public function getPacket($version = null): SimpleXMLElement { - $protocolVersion = !is_null($version) ? $version : $this->_version; + $protocolVersion = !is_null($version) ? $version : $this->version; $content = ""; - $content .= ''; + $content .= ''; return new SimpleXMLElement($content); } @@ -137,8 +149,9 @@ public function getPacket($version = null) * @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(); @@ -146,25 +159,27 @@ 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); - $xml = \pm_ApiRpc::getService($version)->call($requestXml->children()[0]->asXml(), $this->_login); + /** @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 - ? 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]; + $result = (self::RESPONSE_FULL === $mode) ? $xml : $xml->xpath('//result')[0]; + return new XmlResponse((string) $result->asXML()); } /** @@ -176,18 +191,22 @@ 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); + } + $result = curl_exec($curl); if (false === $result) { @@ -196,22 +215,20 @@ 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 */ - public function multiRequest($requests, $mode = self::RESPONSE_SHORT) + public function multiRequest(array $requests, $mode = self::RESPONSE_SHORT): array { $requestXml = $this->getPacket(); @@ -220,24 +237,33 @@ public function multiRequest($requests, $mode = self::RESPONSE_SHORT) 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); } } - $responses[] = $this->request($request); } - if ('sdk' == $this->_protocol) { + 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); @@ -255,18 +281,18 @@ public function multiRequest($requests, $mode = self::RESPONSE_SHORT) * * @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; @@ -279,7 +305,7 @@ protected function _getHeaders() * * @throws Exception */ - protected function _verifyResponse($xml) + 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); @@ -299,20 +325,22 @@ protected function _verifyResponse($xml) * @param string $request * @param SimpleXMLElement $xml * - * @return string + * @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) { - if ( strpos( $part, '=') !== false ) { - list($name, $value) = explode('=', $part); - $node = $node->addChild($name, $value); - } else { - $node = $node->addChild($part); - } + // phpcs:ignore + @list($name, $value) = explode('=', $part); + if ($part !== $lastParts) { + $node = $node->addChild($name); + } else { + $node->{$name} = (string) $value; + } } return $xml->asXML(); @@ -327,14 +355,16 @@ 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); + } elseif (!isset($xml->{$el})) { + $xml->{$el} = (string) $value; } else { - $xml->addChild($el, $value); + $xml->{$el}[] = (string) $value; } } @@ -346,7 +376,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); } @@ -354,231 +384,154 @@ protected function _isAssocArray(array $array) /** * @param string $name * - * @return \PleskX\Api\Operator + * @return mixed */ - protected function _getOperator($name) + private function getOperator(string $name) { - if (!isset($this->_operatorsCache[$name])) { - $className = '\\PleskX\\Api\\Operator\\'.$name; - $this->_operatorsCache[$name] = new $className($this); + if (!isset($this->operatorsCache[$name])) { + $className = '\\PleskX\\Api\\Operator\\' . $name; + /** @psalm-suppress InvalidStringClass */ + $this->operatorsCache[$name] = new $className($this); } - return $this->_operatorsCache[$name]; + return $this->operatorsCache[$name]; } - /** - * @return Operator\Server - */ - public function server() + public function server(): Operator\Server { - return $this->_getOperator('Server'); + return $this->getOperator('Server'); } - /** - * @return Operator\Customer - */ - public function customer() + public function customer(): Operator\Customer { - return $this->_getOperator('Customer'); + return $this->getOperator('Customer'); } - /** - * @return Operator\Webspace - */ - public function webspace() + public function webspace(): Operator\Webspace { - return $this->_getOperator('Webspace'); + return $this->getOperator('Webspace'); } /** - * @return Operator\PhpHandler + * @return Operator\Subdomain */ - public function phpHandler() + public function subdomain(): Operator\Subdomain { - return $this->_getOperator('PhpHandler'); + return $this->getOperator('Subdomain'); } - /** - * @return Operator\Subdomain - */ - public function subdomain() + public function dns(): Operator\Dns { - return $this->_getOperator('Subdomain'); + return $this->getOperator('Dns'); } - /** - * @return Operator\Dns - */ - public function dns() + public function dnsTemplate(): Operator\DnsTemplate { - return $this->_getOperator('Dns'); + return $this->getOperator('DnsTemplate'); } - /** - * @return Operator\DnsTemplate - */ - public function dnsTemplate() + public function databaseServer(): Operator\DatabaseServer { - return $this->_getOperator('DnsTemplate'); + return $this->getOperator('DatabaseServer'); } - /** - * @return Operator\DatabaseServer - */ - public function databaseServer() + public function mail(): Operator\Mail { - return $this->_getOperator('DatabaseServer'); + return $this->getOperator('Mail'); } - /** - * @return Operator\Mail - */ - public function mail() + public function certificate(): Operator\Certificate { - return $this->_getOperator('Mail'); + return $this->getOperator('Certificate'); } - /** - * @return Operator\Certificate - */ - public function certificate() + public function siteAlias(): Operator\SiteAlias { - return $this->_getOperator('Certificate'); + return $this->getOperator('SiteAlias'); } - /** - * @return Operator\SiteAlias - */ - public function siteAlias() + public function ip(): Operator\Ip { - return $this->_getOperator('SiteAlias'); + return $this->getOperator('Ip'); } - /** - * @return Operator\Ip - */ - public function ip() + public function eventLog(): Operator\EventLog { - return $this->_getOperator('Ip'); + return $this->getOperator('EventLog'); } - /** - * @return Operator\EventLog - */ - public function eventLog() + public function secretKey(): Operator\SecretKey { - return $this->_getOperator('EventLog'); + return $this->getOperator('SecretKey'); } - /** - * @return Operator\SecretKey - */ - public function secretKey() + public function ui(): Operator\Ui { - return $this->_getOperator('SecretKey'); + return $this->getOperator('Ui'); } - /** - * @return Operator\Ui - */ - public function ui() + public function servicePlan(): Operator\ServicePlan { - return $this->_getOperator('Ui'); + return $this->getOperator('ServicePlan'); } - /** - * @return Operator\ServicePlan - */ - public function servicePlan() + public function virtualDirectory(): Operator\VirtualDirectory { - return $this->_getOperator('ServicePlan'); + return $this->getOperator('VirtualDirectory'); } - /** - * @return Operator\VirtualDirectory - */ - public function virtualDirectory() + public function database(): Operator\Database { - return $this->_getOperator('VirtualDirectory'); + return $this->getOperator('Database'); } - /** - * @return Operator\Database - */ - public function database() + public function session(): Operator\Session { - return $this->_getOperator('Database'); + return $this->getOperator('Session'); } - /** - * @return Operator\Session - */ - public function session() + public function locale(): Operator\Locale { - return $this->_getOperator('Session'); + return $this->getOperator('Locale'); } - /** - * @return Operator\Locale - */ - public function locale() + public function logRotation(): Operator\LogRotation { - return $this->_getOperator('Locale'); + return $this->getOperator('LogRotation'); } - /** - * @return Operator\LogRotation - */ - public function logRotation() + public function protectedDirectory(): Operator\ProtectedDirectory { - return $this->_getOperator('LogRotation'); + return $this->getOperator('ProtectedDirectory'); } - /** - * @return Operator\ProtectedDirectory - */ - public function protectedDirectory() + public function reseller(): Operator\Reseller { - return $this->_getOperator('ProtectedDirectory'); + return $this->getOperator('Reseller'); } - /** - * @return Operator\Reseller - */ - public function reseller() + public function resellerPlan(): Operator\ResellerPlan { - return $this->_getOperator('Reseller'); + return $this->getOperator('ResellerPlan'); } - /** - * @return Operator\ResellerPlan - */ - public function resellerPlan() + public function aps(): Operator\Aps { - return $this->_getOperator('ResellerPlan'); + return $this->getOperator('Aps'); } - /** - * @return Operator\Aps - */ - public function aps() + public function servicePlanAddon(): Operator\ServicePlanAddon { - return $this->_getOperator('Aps'); + return $this->getOperator('ServicePlanAddon'); } - /** - * @return Operator\ServicePlanAddon - */ - public function servicePlanAddon() + public function site(): Operator\Site { - return $this->_getOperator('ServicePlanAddon'); + return $this->getOperator('Site'); } - /** - * @return Operator\Site - */ - public function site() + public function phpHandler(): Operator\PhpHandler { - return $this->_getOperator('Site'); + return $this->getOperator('PhpHandler'); } } diff --git a/src/Api/Client/Exception.php b/src/Api/Client/Exception.php index a59475dd..4ddf0b42 100644 --- a/src/Api/Client/Exception.php +++ b/src/Api/Client/Exception.php @@ -1,5 +1,5 @@ _login = $login; + $this->login = $login; } } diff --git a/src/Api/Operator.php b/src/Api/Operator.php index af1aabcc..3cc0ec5d 100755 --- a/src/Api/Operator.php +++ b/src/Api/Operator.php @@ -1,24 +1,21 @@ _client = $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)); + $this->wrapperTag = end($classNameParts); + $this->wrapperTag = strtolower(preg_replace('/([a-z])([A-Z])/', '\1-\2', $this->wrapperTag)); } } @@ -30,9 +27,9 @@ public function __construct($client) * * @return XmlResponse */ - public function request($request, $mode = Client::RESPONSE_SHORT) + public function request($request, $mode = Client::RESPONSE_SHORT): XmlResponse { - $wrapperTag = $this->_wrapperTag; + $wrapperTag = $this->wrapperTag; if (is_array($request)) { $request = [$wrapperTag => $request]; @@ -42,7 +39,7 @@ public function request($request, $mode = Client::RESPONSE_SHORT) $request = "<$wrapperTag>$request"; } - return $this->_client->request($request, $mode); + return $this->client->request($request, $mode); } /** @@ -52,9 +49,15 @@ 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.filter.$field=$value"); + $response = $this->request([ + $deleteMethodName => [ + 'filter' => [ + $field => $value, + ], + ], + ]); return 'ok' === (string) $response->status; } @@ -66,28 +69,36 @@ protected function _delete($field, $value, $deleteMethodName = 'del') * @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'); + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get'); $filterTag = $getTag->addChild('filter'); if (!is_null($field)) { - $filterTag->addChild($field, $value); + $filterTag->{$field} = (string) $value; } $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) { if (!is_null($filter) && !$filter($xmlResult->data->$infoTag)) { continue; } - $items[] = new $structClass($xmlResult->data->$infoTag); + 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; + } + $items[] = $item; } return $items; diff --git a/src/Api/Operator/Aps.php b/src/Api/Operator/Aps.php index 145456fb..e9f2ca41 100644 --- a/src/Api/Operator/Aps.php +++ b/src/Api/Operator/Aps.php @@ -1,5 +1,5 @@ _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->addChild($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 8c54dc5d..e3ebdd28 100644 --- a/src/Api/Operator/Customer.php +++ b/src/Api/Operator/Customer.php @@ -1,5 +1,5 @@ _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->addChild($name, $value); + $info->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -32,9 +27,9 @@ public function create($properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -43,9 +38,9 @@ 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); + $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); return reset($items); } @@ -53,8 +48,52 @@ public function get($field, $value) /** * @return Struct\GeneralInfo[] */ - public function getAll() + public function getAll(): array + { + 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->_getItems(Struct\GeneralInfo::class, 'gen_info'); + 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_info'); + 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/Operator/Database.php b/src/Api/Operator/Database.php index 4f9d8318..e44dc101 100644 --- a/src/Api/Operator/Database.php +++ b/src/Api/Operator/Database.php @@ -1,62 +1,42 @@ _process('add-db', $properties)); + 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)); + 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); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild($command); foreach ($properties as $name => $value) { if (false !== strpos($value, '&')) { $info->$name = $value; continue; } - $info->addChild($name, $value); + $info->{$name} = $value; } - return $this->_client->request($packet); + 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); + $response = $this->process('set-db-user', $properties); return 'ok' === (string) $response->status; } @@ -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,9 +73,9 @@ public function getUser($field, $value) * * @return Struct\Info[] */ - public function getAll($field, $value) + public function getAll(string $field, $value): array { - $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); @@ -110,9 +90,9 @@ public function getAll($field, $value) * * @return Struct\UserInfo[] */ - public function getAllUsers($field, $value) + public function getAllUsers(string $field, $value): array { - $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); @@ -126,21 +106,17 @@ public function getAllUsers($field, $value) * @param string $field * @param int|string $value * - * @return \PleskX\Api\XmlResponse + * @return XmlResponse */ - private function _get($command, $field, $value) + private function getBy(string $command, string $field, $value): XmlResponse { - $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'); - if (!is_null($field)) { - $filterTag->addChild($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); } /** @@ -149,9 +125,9 @@ private function _get($command, $field, $value) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { - return $this->_delete($field, $value, 'del-db'); + return $this->deleteBy($field, $value, 'del-db'); } /** @@ -160,8 +136,8 @@ public function delete($field, $value) * * @return bool */ - public function deleteUser($field, $value) + public function deleteUser(string $field, $value): bool { - 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 f4856925..bf286435 100644 --- a/src/Api/Operator/DatabaseServer.php +++ b/src/Api/Operator/DatabaseServer.php @@ -1,5 +1,5 @@ request('get-supported-types'); @@ -25,9 +22,9 @@ public function getSupportedTypes() * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value): Struct\Info { - $items = $this->_get($field, $value); + $items = $this->getBy($field, $value); return reset($items); } @@ -35,28 +32,28 @@ public function get($field, $value) /** * @return Struct\Info[] */ - public function getAll() + public function getAll(): array { - return $this->_get(); + return $this->getBy(); } /** * @param string|null $field * @param int|string|null $value * - * @return Struct\Info|Struct\Info[] + * @return Struct\Info[] */ - private function _get($field = null, $value = null) + private function getBy($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, $value); + $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 8b7e3f04..99b28421 100644 --- a/src/Api/Operator/Dns.php +++ b/src/Api/Operator/Dns.php @@ -1,5 +1,5 @@ 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)); + } + /** - * @param array $properties + * Send multiply records by one request. * - * @return Struct\Info + * @param array $records + * + * @return \SimpleXMLElement[] */ - public function create($properties) + public function bulkCreate(array $records): array { - $packet = $this->_client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec'); + $packet = $this->client->getPacket(); - foreach ($properties as $name => $value) { - $info->addChild($name, $value); + foreach ($records as $properties) { + $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); + $items = []; + foreach ($response->xpath('//result') as $xmlResult) { + $items[] = $xmlResult; } - return new Struct\Info($this->_client->request($packet)); + return $items; } /** @@ -30,7 +53,7 @@ public function create($properties) * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value): Struct\Info { $items = $this->getAll($field, $value); @@ -43,17 +66,15 @@ 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'); + $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); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); $items = []; foreach ($response->xpath('//result') as $xmlResult) { $item = new Struct\Info($xmlResult->data); @@ -70,8 +91,33 @@ public function getAll($field, $value) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool + { + return $this->deleteBy($field, $value, 'del_rec'); + } + + /** + * Delete multiply records by one request. + * + * @param array $recordIds + * + * @return \SimpleXMLElement[] + */ + public function bulkDelete(array $recordIds): array { - return $this->_delete($field, $value, 'del_rec'); + $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/src/Api/Operator/DnsTemplate.php b/src/Api/Operator/DnsTemplate.php index 97a56bfb..49cb0048 100644 --- a/src/Api/Operator/DnsTemplate.php +++ b/src/Api/Operator/DnsTemplate.php @@ -1,5 +1,5 @@ _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->addChild($name, $value); + $info->{$name} = $value; } - return new Struct\Info($this->_client->request($packet)); + return new Struct\Info($this->client->request($packet)); } /** * @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); @@ -46,18 +46,18 @@ 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'); + $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->{$field} = (string) $value; } $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); @@ -74,14 +74,14 @@ 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); + $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 c3a0d69d..51881d3c 100644 --- a/src/Api/Operator/EventLog.php +++ b/src/Api/Operator/EventLog.php @@ -1,5 +1,5 @@ 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 8d8ddf17..9476cd04 100644 --- a/src/Api/Operator/Ip.php +++ b/src/Api/Operator/Ip.php @@ -1,5 +1,5 @@ _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 66d1c51c..867ff3d9 100644 --- a/src/Api/Operator/Locale.php +++ b/src/Api/Operator/Locale.php @@ -1,5 +1,5 @@ _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/LogRotation.php b/src/Api/Operator/LogRotation.php index 602e86a3..f6ce2290 100644 --- a/src/Api/Operator/LogRotation.php +++ b/src/Api/Operator/LogRotation.php @@ -1,5 +1,5 @@ _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', $siteId); + $filter->addChild('site-id', (string) $siteId); $mailname = $filter->addChild('mailname'); $mailname->addChild('name', $name); if ($mailbox) { $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); + $response = $this->client->request($packet); return new Struct\Info($response->mailname); } @@ -43,14 +37,53 @@ public function create($name, $siteId, $mailbox = false, $password = '') * * @return bool */ - public function delete($field, $value, $siteId) + public function delete(string $field, $value, int $siteId): bool { - $packet = $this->_client->getPacket(); - $filter = $packet->addChild($this->_wrapperTag)->addChild('remove')->addChild('filter'); - $filter->addChild('site-id', $siteId); - $filter->addChild($field, $value); - $response = $this->_client->request($packet); + $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); return 'ok' === (string) $response->status; } + + public function get(string $name, int $siteId): Struct\GeneralInfo + { + $items = $this->getAll($siteId, $name); + + return reset($items); + } + + /** + * @param int $siteId + * @param string|null $name + * + * @return Struct\GeneralInfo[] + */ + public function getAll(int $siteId, $name = null): array + { + $packet = $this->client->getPacket(); + $getTag = $packet->addChild($this->wrapperTag)->addChild('get_info'); + + $filterTag = $getTag->addChild('filter'); + $filterTag->addChild('site-id', (string) $siteId); + if (!is_null($name)) { + $filterTag->addChild('name', $name); + } + + $response = $this->client->request($packet, 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/Operator/PhpHandler.php b/src/Api/Operator/PhpHandler.php index d4846052..37ce7faa 100755 --- a/src/Api/Operator/PhpHandler.php +++ b/src/Api/Operator/PhpHandler.php @@ -1,5 +1,5 @@ _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, $value); + $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); @@ -37,17 +37,17 @@ 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'); + $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); + $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 7630fa82..c4d2a7e0 100644 --- a/src/Api/Operator/ProtectedDirectory.php +++ b/src/Api/Operator/ProtectedDirectory.php @@ -1,31 +1,26 @@ _client->getPacket(); - $info = $packet->addChild($this->_wrapperTag)->addChild('add'); + $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); - return new Struct\Info($this->_client->request($packet)); + return new Struct\Info($this->client->request($packet)); } /** @@ -34,18 +29,18 @@ public function add($name, $siteId, $header = '') * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { - return $this->_delete($field, $value, 'delete'); + return $this->deleteBy($field, $value, 'delete'); } /** * @param string $field * @param int|string $value * - * @return Struct\DataInfo|false + * @return Struct\DataInfo */ - public function get($field, $value) + public function get(string $field, $value): Struct\DataInfo { $items = $this->getAll($field, $value); @@ -58,9 +53,9 @@ 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); + $response = $this->getBy('get', $field, $value); $items = []; foreach ($response->xpath('//result/data') as $xmlResult) { $items[] = new Struct\DataInfo($xmlResult); @@ -78,14 +73,14 @@ public function getAll($field, $value) */ 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->addChild('pd-id', $protectedDirectory->id); - $info->addChild('login', $login); - $info->addChild('password', $password); + $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)); } /** @@ -96,28 +91,24 @@ 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'); } /** - * @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 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'); - if (!is_null($field)) { - $filterTag->addChild($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 baf51c66..bd918144 100644 --- a/src/Api/Operator/Reseller.php +++ b/src/Api/Operator/Reseller.php @@ -1,5 +1,5 @@ _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->addChild($name, $value); + $info->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -32,9 +27,9 @@ public function create($properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { - return $this->_delete($field, $value); + 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,24 +51,28 @@ 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'); + $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); } $datasetTag = $getTag->addChild('dataset'); $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) { + if (!$xmlResult->data) { + continue; + } + $item = new Struct\GeneralInfo($xmlResult->data); $item->id = (int) $xmlResult->id; $items[] = $item; diff --git a/src/Api/Operator/ResellerPlan.php b/src/Api/Operator/ResellerPlan.php index 54aeb069..8c66f561 100644 --- a/src/Api/Operator/ResellerPlan.php +++ b/src/Api/Operator/ResellerPlan.php @@ -1,5 +1,5 @@ _client->getPacket(); - $packet->addChild($this->_wrapperTag)->addChild('create')->addChild('ip_address', $ipAddress); - $response = $this->_client->request($packet); + $packet = $this->client->getPacket(); + $createTag = $packet->addChild($this->wrapperTag)->addChild('create'); + + if ('' !== $ipAddress) { + $createTag->addChild('ip_address', $ipAddress); + } + + if ('' !== $description) { + $createTag->addChild('description', $description); + } + + $response = $this->client->request($packet); return (string) $response->key; } - /** - * @param string $keyId - * - * @return bool - */ - public function delete($keyId) + public function delete(string $keyId): bool { - return $this->_delete('key', $keyId, 'delete'); + 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->_get($keyId); + $items = $this->getBy($keyId); return reset($items); } @@ -48,9 +42,9 @@ public function get($keyId) /** * @return Struct\Info[] */ - public function getAll() + public function getAll(): array { - return $this->_get(); + return $this->getBy(); } /** @@ -58,17 +52,17 @@ public function getAll() * * @return Struct\Info[] */ - public function _get($keyId = null) + public function getBy($keyId = null): array { - $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 8e99e03f..6ce53b13 100755 --- a/src/Api/Operator/Server.php +++ b/src/Api/Operator/Server.php @@ -1,48 +1,42 @@ _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() + public function getGeneralInfo(): Struct\GeneralInfo { - return new Struct\GeneralInfo($this->_getInfo('gen_info')); + return new Struct\GeneralInfo($this->getInfo('gen_info')); } - public function getPreferences() + public function getPreferences(): Struct\Preferences { - return new Struct\Preferences($this->_getInfo('prefs')); + return new Struct\Preferences($this->getInfo('prefs')); } - public function getAdmin() + public function getAdmin(): Struct\Admin { - return new Struct\Admin($this->_getInfo('admin')); + return new Struct\Admin($this->getInfo('admin')); } - /** - * @return array - */ - public function getKeyInfo() + 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; @@ -51,13 +45,10 @@ public function getKeyInfo() return $keyInfo; } - /** - * @return array - */ - public function getComponents() + 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; @@ -66,13 +57,10 @@ public function getComponents() return $components; } - /** - * @return array - */ - public function getServiceStates() + public function getServiceStates(): array { $states = []; - $statesXml = $this->_getInfo('services_state'); + $statesXml = $this->getInfo('services_state'); foreach ($statesXml->srv as $service) { $states[(string) $service->id] = [ @@ -85,18 +73,15 @@ public function getServiceStates() return $states; } - public function getSessionPreferences() + public function getSessionPreferences(): Struct\SessionPreferences { - return new Struct\SessionPreferences($this->_getInfo('session_setup')); + return new Struct\SessionPreferences($this->getInfo('session_setup')); } - /** - * @return array - */ - public function getShells() + 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; @@ -105,28 +90,22 @@ public function getShells() return $shells; } - /** - * @return array - */ - public function getNetworkInterfaces() + public function getNetworkInterfaces(): array { - $interfacesXml = $this->_getInfo('interfaces'); + $interfacesXml = $this->getInfo('interfaces'); return (array) $interfacesXml->interface; } - public function getStatistics() + public function getStatistics(): Struct\Statistics { - return new Struct\Statistics($this->_getInfo('stat')); + return new Struct\Statistics($this->getInfo('stat')); } - /** - * @return array - */ - public function getSiteIsolationConfig() + 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; @@ -135,40 +114,29 @@ public function getSiteIsolationConfig() return $config; } - public function getUpdatesInfo() + public function getUpdatesInfo(): Struct\UpdatesInfo { - return new Struct\UpdatesInfo($this->_getInfo('updates')); + return new Struct\UpdatesInfo($this->getInfo('updates')); } - /** - * @param string $login - * @param string $clientIp - * - * @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'); + $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; } - /** - * @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); - $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 0fd04927..3f1a598a 100644 --- a/src/Api/Operator/ServicePlan.php +++ b/src/Api/Operator/ServicePlan.php @@ -1,5 +1,5 @@ request(['add' => $properties]); + + return new Struct\Info($response); + } + + /** + * @param string $field + * @param int|string $value + * + * @return bool + */ + public function delete(string $field, $value): bool + { + return $this->deleteBy($field, $value); + } + /** * Restituisce i dettagli di un servizio a listino * @param string $field @@ -14,9 +32,9 @@ class ServicePlan extends \PleskX\Api\Operator * * @return Struct\Info */ - public function get($field, $value) + public function get(string $field, $value): Struct\Info { - $items = $this->_get($field, $value); + $items = $this->getBy($field, $value); return reset($items); } @@ -24,28 +42,28 @@ public function get($field, $value) /** * @return Struct\Info[] */ - public function getAll() + public function getAll(): array { - return $this->_get(); + return $this->getBy(); } /** * @param string|null $field * @param int|string|null $value * - * @return Struct\Info|Struct\Info[] + * @return Struct\Info[] */ - private function _get($field = null, $value = null) + private function getBy($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, $value); + $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/ServicePlanAddon.php b/src/Api/Operator/ServicePlanAddon.php index e92741cf..7eee5799 100644 --- a/src/Api/Operator/ServicePlanAddon.php +++ b/src/Api/Operator/ServicePlanAddon.php @@ -1,5 +1,5 @@ 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', ''); + + $response = $this->client->request($packet); + + return (string) $response->id; + } + /** * @return Struct\Info[] */ - public function get() + public function get(): array { $sessions = []; $response = $this->request('get'); @@ -22,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 6a2d073d..d930f220 100755 --- a/src/Api/Operator/Site.php +++ b/src/Api/Operator/Site.php @@ -1,5 +1,5 @@ _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) { if (!is_scalar($value)) { continue; } - $infoGeneral->addChild($name, $value); + $infoGeneral->{$name} = (string) $value; } // set hosting properties @@ -32,12 +27,12 @@ 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; } } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -48,9 +43,9 @@ public function create(array $properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -59,9 +54,9 @@ 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); + $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); return reset($items); } @@ -72,11 +67,17 @@ 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, 'hosting', $field, $value, function ($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); } @@ -85,9 +86,9 @@ public function getHosting($field, $value) /** * @return Struct\GeneralInfo[] */ - public function getAll() + public function getAll(): array { - 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 caf5c808..5b8281fa 100644 --- a/src/Api/Operator/SiteAlias.php +++ b/src/Api/Operator/SiteAlias.php @@ -1,5 +1,5 @@ _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'); 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); } } $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); } @@ -38,9 +32,20 @@ public function create(array $properties, array $preferences = []) * @param string $field * @param int|string $value * - * @return Struct\Info + * @return bool + */ + public function delete(string $field, $value): bool + { + return $this->deleteBy($field, $value, 'delete'); + } + + /** + * @param string $field + * @param int|string $value + * + * @return Struct\GeneralInfo */ - public function get($field, $value) + public function get(string $field, $value): Struct\GeneralInfo { $items = $this->getAll($field, $value); @@ -51,19 +56,19 @@ 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) + 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, $value); + $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 bc659ca5..d0eb7681 100644 --- a/src/Api/Operator/Subdomain.php +++ b/src/Api/Operator/Subdomain.php @@ -1,5 +1,5 @@ _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)) { 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); + $response = $this->client->request($packet); return new Struct\Info($response); } @@ -40,9 +35,9 @@ public function create($properties) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { - return $this->_delete($field, $value); + 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); @@ -64,17 +59,17 @@ 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'); + $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); + $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 d963299b..4fd3c608 100644 --- a/src/Api/Operator/Ui.php +++ b/src/Api/Operator/Ui.php @@ -1,5 +1,5 @@ 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'); + $packet = $this->client->getPacket(); + $buttonNode = $packet->addChild($this->wrapperTag)->addChild('create-custombutton'); $buttonNode->addChild('owner')->addChild($owner); $propertiesNode = $buttonNode->addChild('properties'); foreach ($properties as $name => $value) { - $propertiesNode->addChild($name, $value); + $propertiesNode->{$name} = $value; } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); 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->_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 259e050a..ab8677fc 100644 --- a/src/Api/Operator/VirtualDirectory.php +++ b/src/Api/Operator/VirtualDirectory.php @@ -1,9 +1,9 @@ request('get-permission-descriptor.filter'); @@ -21,14 +23,14 @@ public function getPermissionDescriptor() * informazioni come il codice del parametro, il data type, i permessi di scrittura, ... * @return \PleskX\Api\Struct\Webspace\LimitDescriptor */ - 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'); @@ -41,15 +43,15 @@ 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'); + $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); + $response = $this->client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); return new Struct\PhpSettings($response); } @@ -61,62 +63,56 @@ public function getPhpSettings($field, $value) * * @return Struct\Limits */ -// public function getLimits($field, $value) -// { -// $items = $this->_getItems(Struct\Limits::class, 'limits', $field, $value); -// -// return reset($items); -// } - - - /** - * Restituisce i limiti massimi per una subscription - * @param int $guid L'identificativo universale della subscription - * @return Struct\Limit - */ - public function getLimits( $guid ) + public function getLimits(string $field, $value): Struct\Limits { - $items = $this->_getItems(Struct\Limit::class, 'limits', 'guid', $guid ); + $items = $this->getItems(Struct\Limits::class, 'limits', $field, $value); + return reset($items); } /** * @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'); + $packet = $this->client->getPacket(); + $info = $packet->addChild($this->wrapperTag)->addChild('add'); $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) { $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'])) { - $infoHosting->addChild('ip_address', $properties['ip_address']); + foreach ((array) $properties['ip_address'] as $ipAddress) { + $infoHosting->addChild('ip_address', $ipAddress); + } } } - if ($planName) { + if ('' !== $planName) { $info->addChild('plan-name', $planName); } - $response = $this->_client->request($packet); + $response = $this->client->request($packet); - return new Struct\Info($response); + return new Struct\Info($response, $properties['name'] ?? ''); } @@ -127,15 +123,15 @@ public function create(array $properties, array $hostingProperties = null, $plan */ public function getStatus( $webspaceId ) { - $packet = $this->_client->getPacket(); - $getterTag = $packet->addChild( $this->_wrapperTag )->addChild( 'get' ); + $packet = $this->client->getPacket(); + $getterTag = $packet->addChild( $this->wrapperTag )->addChild( 'get' ); $filterTag = $getterTag->addChild( 'filter' ); $filterTag->addChild( 'id', $webspaceId ); $getterTag->addChild( 'dataset' )->addChild( 'gen_info' ); - $response = $this->_client->request( $packet ); + $response = $this->client->request( $packet ); if( !isset( $response->data->gen_info->status ) ) { return null; @@ -153,8 +149,8 @@ public function getStatus( $webspaceId ) */ public function setStatus( array $filters, $status ) { - $packet = $this->_client->getPacket(); - $setterTag = $packet->addChild( $this->_wrapperTag )->addChild( 'set' ); + $packet = $this->client->getPacket(); + $setterTag = $packet->addChild( $this->wrapperTag )->addChild( 'set' ); if ( !empty( $filters ) ) { $filterTag = $setterTag->addChild( 'filter' ); foreach ( $filters as $key => $value ) { @@ -163,7 +159,7 @@ public function setStatus( array $filters, $status ) } $valuesTag = $setterTag->addChild( 'values' ); $valuesTag->addChild( 'gen_setup' )->addChild( 'status', $status ); - $response = $this->_client->request( $packet ); + $response = $this->client->request( $packet ); return 'ok' === (string)$response->status; } @@ -176,8 +172,8 @@ public function setStatus( array $filters, $status ) */ public function updateFtpPassword( array $filters, $newPassword ) { - $packet = $this->_client->getPacket(); - $setterTag = $packet->addChild( $this->_wrapperTag )->addChild( 'set' ); + $packet = $this->client->getPacket(); + $setterTag = $packet->addChild( $this->wrapperTag )->addChild( 'set' ); if ( !empty( $filters ) ) { $filterTag = $setterTag->addChild( 'filter' ); foreach ( $filters as $key => $value ) { @@ -192,7 +188,7 @@ public function updateFtpPassword( array $filters, $newPassword ) $property->addChild('name', 'ftp_password'); $property->addChild('value', $newPassword); - $response = $this->_client->request( $packet ); + $response = $this->client->request( $packet ); return 'ok' === (string)$response->status; } @@ -203,9 +199,9 @@ public function updateFtpPassword( array $filters, $newPassword ) * * @return bool */ - public function delete($field, $value) + public function delete(string $field, $value): bool { - return $this->_delete($field, $value); + return $this->deleteBy($field, $value); } /** @@ -214,9 +210,9 @@ 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); + $items = $this->getItems(Struct\GeneralInfo::class, 'gen_info', $field, $value); return reset($items); } @@ -229,7 +225,7 @@ public function get($field, $value) */ public function getHostingSettings( $guid ) { - $items = $this->_getItems(Struct\HostingSetting::class, 'hosting', 'guid', $guid ); + $items = $this->getItems(Struct\HostingSetting::class, 'hosting', 'guid', $guid ); return reset($items); } @@ -241,15 +237,15 @@ public function getHostingSettings( $guid ) */ public function getPlanGuid( $guid ) { - $packet = $this->_client->getPacket(); - $getterTag = $packet->addChild( $this->_wrapperTag )->addChild( 'get' ); + $packet = $this->client->getPacket(); + $getterTag = $packet->addChild( $this->wrapperTag )->addChild( 'get' ); $filterTag = $getterTag->addChild( 'filter' ); $filterTag->addChild( 'guid', $guid ); $getterTag->addChild( 'dataset' )->addChild( 'subscriptions' ); - $response = $this->_client->request( $packet ); + $response = $this->client->request( $packet ); $guidPropertyName = 'plan-guid'; @@ -284,14 +280,14 @@ public function getIdByName( $name ) { * @return XmlResponse */ public function switchSubscription( $webspaceId, $planGuid ) { - $packet = $this->_client->getPacket(); + $packet = $this->client->getPacket(); - $switchSubscriptionTag = $packet->addChild( $this->_wrapperTag )->addChild( 'switch-subscription' ); + $switchSubscriptionTag = $packet->addChild( $this->wrapperTag )->addChild( 'switch-subscription' ); $switchSubscriptionTag->addChild( 'filter' )->addChild( 'id', $webspaceId ); $switchSubscriptionTag->addChild( 'plan-guid', $planGuid ); - $response = $this->_client->request( $packet ); + $response = $this->client->request( $packet ); return $response; } @@ -302,20 +298,9 @@ public function switchSubscription( $webspaceId, $planGuid ) { * Tali subscription potrebbero anche essere in uno stato non attivo * @return Struct\GeneralInfo[] */ - public function getAll() + public function getAll(): array { - return $this->_getItems(Struct\GeneralInfo::class, 'gen_info'); - } - - - /** - * Restituisce tutte le subscriptions (servizi attivati) presenti sul server. - * Tali subscription potrebbero anche essere in uno stato non attivo - * @return Struct\CompleteGeneralInfo[] - */ - public function getCompleteList() - { - return $this->_getItems( Struct\CompleteGeneralInfo::class, 'gen_info' ); + return $this->getItems(Struct\GeneralInfo::class, 'gen_info'); } @@ -325,9 +310,9 @@ public function getCompleteList() * * @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); + $items = $this->getItems(Struct\DiskUsage::class, 'disk_usage', $field, $value); return reset($items); } @@ -339,8 +324,8 @@ public function getDiskUsage($field, $value) * @return bool */ public function setCurrentCertificate( $filters, $certificateName ) { - $packet = $this->_client->getPacket(); - $setterTag = $packet->addChild( $this->_wrapperTag )->addChild( 'set' ); + $packet = $this->client->getPacket(); + $setterTag = $packet->addChild( $this->wrapperTag )->addChild( 'set' ); if ( !empty( $filters ) ) { $filterTag = $setterTag->addChild( 'filter' ); foreach ( $filters as $key => $value ) { @@ -355,7 +340,7 @@ public function setCurrentCertificate( $filters, $certificateName ) { $property->addChild('name', 'certificate_name'); $property->addChild('value', $certificateName); - $response = $this->_client->request( $packet ); + $response = $this->client->request( $packet ); return 'ok' === (string)$response->status; } @@ -366,8 +351,8 @@ public function setCurrentCertificate( $filters, $certificateName ) { * @return string|null */ public function getCurrentCertificate( $filters ) { - $packet = $this->_client->getPacket(); - $getterTag = $packet->addChild( $this->_wrapperTag )->addChild( 'get' ); + $packet = $this->client->getPacket(); + $getterTag = $packet->addChild( $this->wrapperTag )->addChild( 'get' ); if ( !empty( $filters ) ) { $filterTag = $getterTag->addChild( 'filter' ); @@ -379,7 +364,7 @@ public function getCurrentCertificate( $filters ) { $getterTag->addChild( 'dataset' )->addChild( 'hosting' ); - $response = $this->_client->request( $packet ); + $response = $this->client->request( $packet ); $responseProperties = $response->data->hosting->vrt_hst->property; foreach( $responseProperties as $property ) { @@ -390,4 +375,48 @@ public function getCurrentCertificate( $filters ) { return null; } + + /** + * @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/Certificate/Info.php b/src/Api/Struct/Certificate/Info.php index 4fff03ea..195bc145 100644 --- a/src/Api/Struct/Certificate/Info.php +++ b/src/Api/Struct/Certificate/Info.php @@ -1,19 +1,18 @@ _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 b5bc28d2..cd73d088 100644 --- a/src/Api/Struct/Customer/GeneralInfo.php +++ b/src/Api/Struct/Customer/GeneralInfo.php @@ -1,55 +1,32 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['cname' => 'company'], ['pname' => 'personalName'], 'login', @@ -65,5 +42,7 @@ public function __construct($apiResponse) 'external-id', 'description', ]); + + $this->enabled = '0' === (string) $apiResponse->status; } } diff --git a/src/Api/Struct/Customer/Info.php b/src/Api/Struct/Customer/Info.php index 6374cf00..3b20a16c 100644 --- a/src/Api/Struct/Customer/Info.php +++ b/src/Api/Struct/Customer/Info.php @@ -1,19 +1,18 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); diff --git a/src/Api/Struct/Database/Info.php b/src/Api/Struct/Database/Info.php index 0126393e..6072624f 100644 --- a/src/Api/Struct/Database/Info.php +++ b/src/Api/Struct/Database/Info.php @@ -1,31 +1,22 @@ _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 9f8f0c00..ccc9de30 100644 --- a/src/Api/Struct/Database/UserInfo.php +++ b/src/Api/Struct/Database/UserInfo.php @@ -1,22 +1,19 @@ _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 3186fb2b..ef887340 100644 --- a/src/Api/Struct/DatabaseServer/Info.php +++ b/src/Api/Struct/DatabaseServer/Info.php @@ -1,25 +1,20 @@ _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 76486278..0b4dd7a2 100644 --- a/src/Api/Struct/Dns/Info.php +++ b/src/Api/Struct/Dns/Info.php @@ -1,34 +1,23 @@ _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 7a61f0be..9f545b16 100644 --- a/src/Api/Struct/EventLog/DetailedEvent.php +++ b/src/Api/Struct/EventLog/DetailedEvent.php @@ -1,34 +1,23 @@ _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 a9469e6a..672130a7 100644 --- a/src/Api/Struct/EventLog/Event.php +++ b/src/Api/Struct/EventLog/Event.php @@ -1,25 +1,20 @@ _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 d681fc92..7d28e90c 100644 --- a/src/Api/Struct/Ip/Info.php +++ b/src/Api/Struct/Ip/Info.php @@ -1,25 +1,20 @@ _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 44a35f13..46f7528f 100644 --- a/src/Api/Struct/Locale/Info.php +++ b/src/Api/Struct/Locale/Info.php @@ -1,22 +1,19 @@ _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 new file mode 100644 index 00000000..78429c10 --- /dev/null +++ b/src/Api/Struct/Mail/GeneralInfo.php @@ -0,0 +1,22 @@ +initScalarProperties($apiResponse, [ + 'id', + 'name', + 'description', + ]); + } +} diff --git a/src/Api/Struct/Mail/Info.php b/src/Api/Struct/Mail/Info.php index 3396369b..16c089ae 100644 --- a/src/Api/Struct/Mail/Info.php +++ b/src/Api/Struct/Mail/Info.php @@ -1,19 +1,18 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'name', ]); diff --git a/src/Api/Struct/PhpHandler/Info.php b/src/Api/Struct/PhpHandler/Info.php index 8cc0c4aa..567a525b 100644 --- a/src/Api/Struct/PhpHandler/Info.php +++ b/src/Api/Struct/PhpHandler/Info.php @@ -1,45 +1,26 @@ _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 7ca83d93..41276be5 100644 --- a/src/Api/Struct/ProtectedDirectory/DataInfo.php +++ b/src/Api/Struct/ProtectedDirectory/DataInfo.php @@ -1,21 +1,18 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'name', 'header', ]); diff --git a/src/Api/Struct/ProtectedDirectory/Info.php b/src/Api/Struct/ProtectedDirectory/Info.php index 0152b16a..91a17f0b 100644 --- a/src/Api/Struct/ProtectedDirectory/Info.php +++ b/src/Api/Struct/ProtectedDirectory/Info.php @@ -1,18 +1,17 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', ]); } diff --git a/src/Api/Struct/ProtectedDirectory/UserInfo.php b/src/Api/Struct/ProtectedDirectory/UserInfo.php index da93c296..922a9016 100644 --- a/src/Api/Struct/ProtectedDirectory/UserInfo.php +++ b/src/Api/Struct/ProtectedDirectory/UserInfo.php @@ -1,16 +1,17 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', ]); } diff --git a/src/Api/Struct/Reseller/GeneralInfo.php b/src/Api/Struct/Reseller/GeneralInfo.php index e7db41c2..4dc6a4f1 100644 --- a/src/Api/Struct/Reseller/GeneralInfo.php +++ b/src/Api/Struct/Reseller/GeneralInfo.php @@ -1,25 +1,20 @@ _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 3a0addc9..25b84a28 100644 --- a/src/Api/Struct/Reseller/Info.php +++ b/src/Api/Struct/Reseller/Info.php @@ -1,19 +1,18 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); diff --git a/src/Api/Struct/SecretKey/Info.php b/src/Api/Struct/SecretKey/Info.php index 32a7ba49..17b1aca7 100644 --- a/src/Api/Struct/SecretKey/Info.php +++ b/src/Api/Struct/SecretKey/Info.php @@ -1,25 +1,20 @@ _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 53760331..49e8b1b7 100644 --- a/src/Api/Struct/Server/Admin.php +++ b/src/Api/Struct/Server/Admin.php @@ -1,22 +1,19 @@ _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 fb74f435..5dbc40d3 100644 --- a/src/Api/Struct/Server/GeneralInfo.php +++ b/src/Api/Struct/Server/GeneralInfo.php @@ -1,22 +1,19 @@ _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 9f8535e6..277d8b61 100644 --- a/src/Api/Struct/Server/Preferences.php +++ b/src/Api/Struct/Server/Preferences.php @@ -1,22 +1,19 @@ _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 44e23b56..ef68c0d9 100644 --- a/src/Api/Struct/Server/SessionPreferences.php +++ b/src/Api/Struct/Server/SessionPreferences.php @@ -1,16 +1,17 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'login_timeout', ]); } diff --git a/src/Api/Struct/Server/Statistics.php b/src/Api/Struct/Server/Statistics.php index 26c0f60d..301b882f 100644 --- a/src/Api/Struct/Server/Statistics.php +++ b/src/Api/Struct/Server/Statistics.php @@ -1,9 +1,11 @@ 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..b108a8cb --- /dev/null +++ b/src/Api/Struct/Server/Statistics/DiskSpace.php @@ -0,0 +1,22 @@ +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..31792ea9 --- /dev/null +++ b/src/Api/Struct/Server/Statistics/LoadAverage.php @@ -0,0 +1,20 @@ +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..771792cb --- /dev/null +++ b/src/Api/Struct/Server/Statistics/Memory.php @@ -0,0 +1,28 @@ +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 8ef48022..881d230f 100644 --- a/src/Api/Struct/Server/Statistics/Objects.php +++ b/src/Api/Struct/Server/Statistics/Objects.php @@ -1,21 +1,38 @@ _initScalarProperties($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..96cf89b2 --- /dev/null +++ b/src/Api/Struct/Server/Statistics/Other.php @@ -0,0 +1,22 @@ +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..6f0322e6 --- /dev/null +++ b/src/Api/Struct/Server/Statistics/Swap.php @@ -0,0 +1,22 @@ +initScalarProperties($apiResponse, [ + 'total', + 'used', + 'free', + ]); + } +} diff --git a/src/Api/Struct/Server/Statistics/Version.php b/src/Api/Struct/Server/Statistics/Version.php index 56675743..559d0ab7 100644 --- a/src/Api/Struct/Server/Statistics/Version.php +++ b/src/Api/Struct/Server/Statistics/Version.php @@ -1,21 +1,28 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ ['plesk_name' => 'internalName'], ['plesk_version' => 'version'], + ['plesk_build' => 'build'], + ['plesk_os' => 'osName'], + ['plesk_os_version' => 'osVersion'], + ['os_release' => 'osRelease'], ]); } } diff --git a/src/Api/Struct/Server/UpdatesInfo.php b/src/Api/Struct/Server/UpdatesInfo.php index 79f899c0..45d7c8b6 100644 --- a/src/Api/Struct/Server/UpdatesInfo.php +++ b/src/Api/Struct/Server/UpdatesInfo.php @@ -1,19 +1,18 @@ _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 3b3edd23..0dbc916c 100644 --- a/src/Api/Struct/ServicePlan/Info.php +++ b/src/Api/Struct/ServicePlan/Info.php @@ -1,25 +1,20 @@ _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 cbb4d964..5d86aaad 100644 --- a/src/Api/Struct/Session/Info.php +++ b/src/Api/Struct/Session/Info.php @@ -1,31 +1,22 @@ _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 1a31fbdd..e36f97a8 100644 --- a/src/Api/Struct/Site/GeneralInfo.php +++ b/src/Api/Struct/Site/GeneralInfo.php @@ -1,33 +1,40 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ + ['cr_date' => 'creationDate'], 'name', 'ascii-name', 'status', + 'real_size', 'guid', 'description', + 'webspace-guid', + 'webspace-id', ]); + + foreach ($apiResponse->dns_ip_address as $ip) { + $this->ipAddresses[] = (string) $ip; + } } } diff --git a/src/Api/Struct/Site/HostingInfo.php b/src/Api/Struct/Site/HostingInfo.php index cc981a02..4aa2a356 100644 --- a/src/Api/Struct/Site/HostingInfo.php +++ b/src/Api/Struct/Site/HostingInfo.php @@ -1,22 +1,21 @@ 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 a2b74107..ee20cb69 100644 --- a/src/Api/Struct/Site/Info.php +++ b/src/Api/Struct/Site/Info.php @@ -1,19 +1,18 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); diff --git a/src/Api/Struct/SiteAlias/GeneralInfo.php b/src/Api/Struct/SiteAlias/GeneralInfo.php index 732fb088..117caf64 100644 --- a/src/Api/Struct/SiteAlias/GeneralInfo.php +++ b/src/Api/Struct/SiteAlias/GeneralInfo.php @@ -1,22 +1,19 @@ _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 133cb0ed..2f2e2a29 100644 --- a/src/Api/Struct/SiteAlias/Info.php +++ b/src/Api/Struct/SiteAlias/Info.php @@ -1,19 +1,18 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'status', ]); diff --git a/src/Api/Struct/Subdomain/Info.php b/src/Api/Struct/Subdomain/Info.php index 672c1e6d..a468ec2c 100644 --- a/src/Api/Struct/Subdomain/Info.php +++ b/src/Api/Struct/Subdomain/Info.php @@ -1,26 +1,21 @@ 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 ece61a32..c4823730 100644 --- a/src/Api/Struct/Ui/CustomButton.php +++ b/src/Api/Struct/Ui/CustomButton.php @@ -1,38 +1,25 @@ _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 80d7f257..039685cd 100644 --- a/src/Api/Struct/Webspace/DiskUsage.php +++ b/src/Api/Struct/Webspace/DiskUsage.php @@ -1,47 +1,27 @@ _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 d9be8f1a..8640a6fd 100644 --- a/src/Api/Struct/Webspace/GeneralInfo.php +++ b/src/Api/Struct/Webspace/GeneralInfo.php @@ -1,25 +1,45 @@ _initScalarProperties($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; + } + + $this->enabled = '0' === (string) $apiResponse->status; } } diff --git a/src/Api/Struct/Webspace/HostingPropertyInfo.php b/src/Api/Struct/Webspace/HostingPropertyInfo.php index a663546c..eb8c6633 100644 --- a/src/Api/Struct/Webspace/HostingPropertyInfo.php +++ b/src/Api/Struct/Webspace/HostingPropertyInfo.php @@ -1,22 +1,19 @@ _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 a39d709a..fd375d79 100644 --- a/src/Api/Struct/Webspace/Info.php +++ b/src/Api/Struct/Webspace/Info.php @@ -1,21 +1,22 @@ _initScalarProperties($apiResponse, [ + $this->initScalarProperties($apiResponse, [ 'id', 'guid', ]); + $this->name = $name; } } diff --git a/src/Api/Struct/Webspace/Limit.php b/src/Api/Struct/Webspace/Limit.php index cda9efee..bb8ddf77 100755 --- a/src/Api/Struct/Webspace/Limit.php +++ b/src/Api/Struct/Webspace/Limit.php @@ -2,21 +2,18 @@ namespace PleskX\Api\Struct\Webspace; -class Limit extends \PleskX\Api\Struct +use PleskX\Api\AbstractStruct; + +class Limit extends AbstractStruct { - /** @var array */ - public $properties; + public string $name; + public string $value; - public function __construct($apiResponse) + public function __construct(\SimpleXMLElement $apiResponse) { - $this->properties = []; - - if( !isset( $apiResponse->limit ) ) { - return; - } - - foreach ($apiResponse->limit as $propertyInfo) { - $this->properties[reset( $propertyInfo->name)] = reset( $propertyInfo->value ); - } + $this->initScalarProperties($apiResponse, [ + 'name', + 'value', + ]); } } \ No newline at end of file diff --git a/src/Api/Struct/Webspace/LimitDescriptor.php b/src/Api/Struct/Webspace/LimitDescriptor.php index 36b32d12..78f823ae 100644 --- a/src/Api/Struct/Webspace/LimitDescriptor.php +++ b/src/Api/Struct/Webspace/LimitDescriptor.php @@ -1,14 +1,15 @@ limits = []; diff --git a/src/Api/Struct/Webspace/LimitInfo.php b/src/Api/Struct/Webspace/LimitInfo.php index 718f221a..3772a115 100644 --- a/src/Api/Struct/Webspace/LimitInfo.php +++ b/src/Api/Struct/Webspace/LimitInfo.php @@ -1,22 +1,19 @@ _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 36564826..098b1c60 100644 --- a/src/Api/Struct/Webspace/Limits.php +++ b/src/Api/Struct/Webspace/Limits.php @@ -1,19 +1,18 @@ _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 959afb0e..4e9ea444 100644 --- a/src/Api/Struct/Webspace/PermissionDescriptor.php +++ b/src/Api/Struct/Webspace/PermissionDescriptor.php @@ -1,14 +1,15 @@ permissions = []; diff --git a/src/Api/Struct/Webspace/PermissionInfo.php b/src/Api/Struct/Webspace/PermissionInfo.php index 8ea83ddd..3fff014d 100644 --- a/src/Api/Struct/Webspace/PermissionInfo.php +++ b/src/Api/Struct/Webspace/PermissionInfo.php @@ -1,22 +1,19 @@ _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 f16f16ee..5e597297 100644 --- a/src/Api/Struct/Webspace/PhpSettings.php +++ b/src/Api/Struct/Webspace/PhpSettings.php @@ -1,14 +1,15 @@ properties = []; diff --git a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php index acf032b0..5df97da3 100644 --- a/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php +++ b/src/Api/Struct/Webspace/PhysicalHostingDescriptor.php @@ -1,14 +1,15 @@ properties = []; diff --git a/src/Api/XmlResponse.php b/src/Api/XmlResponse.php index 5b11ef49..95076354 100644 --- a/src/Api/XmlResponse.php +++ b/src/Api/XmlResponse.php @@ -1,5 +1,5 @@ xpath('//'.$node)[0]; + return (string) $this->xpath('//' . $node)[0]; } } diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php new file mode 100644 index 00000000..35b62afe --- /dev/null +++ b/tests/AbstractTestCase.php @@ -0,0 +1,94 @@ +setCredentials($login, $password); + + $proxy = getenv('REMOTE_PROXY'); + if ($proxy) { + static::$client->setProxy($proxy); + } + } + + public static function tearDownAfterClass(): void + { + foreach (self::$webspaces as $webspace) { + try { + 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); + // phpcs:ignore + } catch (\Exception $e) { + } + } + } + + protected static function getIpAddress(): string + { + $ips = static::$client->ip()->get(); + $ipInfo = reset($ips); + + return $ipInfo->ipAddress; + } + + protected static function createWebspace(): \PleskX\Api\Struct\Webspace\Info + { + $id = uniqid(); + $webspace = static::$client->webspace()->create( + [ + 'name' => "test{$id}.test", + 'ip_address' => static::getIpAddress(), + ], + [ + 'ftp_login' => "u{$id}", + 'ftp_password' => PasswordProvider::STRONG_PASSWORD, + ] + ); + self::$webspaces[] = $webspace; + + return $webspace; + } + + protected static function createServicePlan(): \PleskX\Api\Struct\ServicePlan\Info + { + $id = uniqid(); + $servicePlan = static::$client->servicePlan()->create(['name' => "test{$id}plan"]); + + self::$servicePlans[] = $servicePlan; + + return $servicePlan; + } +} diff --git a/tests/ApiClientTest.php b/tests/ApiClientTest.php index eb9f8133..05df53e7 100644 --- a/tests/ApiClientTest.php +++ b/tests/ApiClientTest.php @@ -1,20 +1,20 @@ 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(''); + static::$client->request(''); } 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/CertificateTest.php index 4b2e79cf..a65ee85a 100644 --- a/tests/CertificateTest.php +++ b/tests/CertificateTest.php @@ -1,13 +1,13 @@ certificate()->generate([ + $certificate = static::$client->certificate()->generate([ 'bits' => 2048, 'country' => 'RU', 'state' => 'NSO', diff --git a/tests/CustomerTest.php b/tests/CustomerTest.php index 961f1153..760ee45a 100644 --- a/tests/CustomerTest.php +++ b/tests/CustomerTest.php @@ -1,18 +1,18 @@ _customerProperties = [ + $this->customerProperties = [ 'cname' => 'Plesk', 'pname' => 'John Smith', 'login' => 'john-unit-test', @@ -25,54 +25,55 @@ 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); $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); + 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) { @@ -80,7 +81,48 @@ 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 testGetAllEmpty() + { + $customersInfo = static::$client->customer()->getAll(); + $this->assertCount(0, $customersInfo); + } + + 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); + } + + 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); } } diff --git a/tests/DatabaseServerTest.php b/tests/DatabaseServerTest.php index 1f6eeef4..4dfa6ed7 100644 --- a/tests/DatabaseServerTest.php +++ b/tests/DatabaseServerTest.php @@ -1,27 +1,27 @@ 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/DatabaseTest.php b/tests/DatabaseTest.php index 2e63b809..19d963d5 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -1,234 +1,223 @@ _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); } - /** - * @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); + $database = static::$client->database()->create($params); $this->assertIsInt($database->id); $this->assertGreaterThan(0, $database->id); 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); + $user = static::$client->database()->createUser($params); $this->assertIsInt($user->id); $this->assertGreaterThan(0, $user->id); diff --git a/tests/DnsTemplateTest.php b/tests/DnsTemplateTest.php index 7eafebff..40e61ae2 100644 --- a/tests/DnsTemplateTest.php +++ b/tests/DnsTemplateTest.php @@ -1,74 +1,71 @@ 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', ]); - $this->assertInternalType('integer', $dns->id); + $this->assertIsInt($dns->id); $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/DnsTest.php b/tests/DnsTest.php index 5feadcac..634cd681 100644 --- a/tests/DnsTest.php +++ b/tests/DnsTest.php @@ -1,24 +1,22 @@ 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 +31,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,41 +39,99 @@ 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); + } + + /** + * @return \SimpleXMLElement[] + */ + public function testBulkCreate(): array + { + $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 \SimpleXMLElement[] $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([ + $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) { @@ -87,19 +143,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/EventLogTest.php b/tests/EventLogTest.php index d0e4c7d4..7023dd43 100644 --- a/tests/EventLogTest.php +++ b/tests/EventLogTest.php @@ -1,13 +1,13 @@ 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/IpTest.php index 683aa5f1..15a2ef2c 100644 --- a/tests/IpTest.php +++ b/tests/IpTest.php @@ -1,16 +1,16 @@ ip()->get(); + $ips = static::$client->ip()->get(); $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/LocaleTest.php b/tests/LocaleTest.php index f450d722..b86756bf 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleTest.php @@ -1,13 +1,13 @@ 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/MailTest.php index f2bb6d49..21505d99 100644 --- a/tests/MailTest.php +++ b/tests/MailTest.php @@ -1,29 +1,24 @@ 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,20 +33,104 @@ 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 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); + $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); + + $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); + } + + 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); + } } diff --git a/tests/PhpHandlerTest.php b/tests/PhpHandlerTest.php index 5b8f753a..ee632ccf 100644 --- a/tests/PhpHandlerTest.php +++ b/tests/PhpHandlerTest.php @@ -1,21 +1,20 @@ phpHandler()->get(null, null); + $handler = static::$client->phpHandler()->get(); - $this->assertIsObject($handler); $this->assertObjectHasAttribute('type', $handler); } public function testGetAll() { - $handlers = static::$_client->phpHandler()->getAll(); + $handlers = static::$client->phpHandler()->getAll(); $this->assertIsArray($handlers); $this->assertNotEmpty($handlers); @@ -31,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/ProtectedDirectoryTest.php b/tests/ProtectedDirectoryTest.php index 80dfd3c7..6caa9875 100644 --- a/tests/ProtectedDirectoryTest.php +++ b/tests/ProtectedDirectoryTest.php @@ -1,29 +1,28 @@ protectedDirectory()->add('/', static::$webspace->id); + $protectedDirectory = static::$client->protectedDirectory()->add('/', static::$webspace->id); $this->assertIsObject($protectedDirectory); $this->assertGreaterThan(0, $protectedDirectory->id); - static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); + static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); } public function testAddInvalidDirectory() @@ -31,25 +30,25 @@ public function testAddInvalidDirectory() $this->expectException(\PleskX\Api\Exception::class); $this->expectExceptionCode(1019); - static::$_client->protectedDirectory()->add('', static::$webspace->id); + static::$client->protectedDirectory()->add('', static::$webspace->id); } public function testDelete() { - $protectedDirectory = static::$_client->protectedDirectory()->add('/', static::$webspace->id); + $protectedDirectory = static::$client->protectedDirectory()->add('/', static::$webspace->id); - $result = static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); + $result = static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); $this->assertTrue($result); } public function testGetById() { - $protectedDirectory = static::$_client->protectedDirectory()->add('test', static::$webspace->id); + $protectedDirectory = static::$client->protectedDirectory()->add('test', static::$webspace->id); - $foundDirectory = static::$_client->protectedDirectory()->get('id', $protectedDirectory->id); + $foundDirectory = static::$client->protectedDirectory()->get('id', $protectedDirectory->id); $this->assertEquals('test', $foundDirectory->name); - static::$_client->protectedDirectory()->delete('id', $protectedDirectory->id); + static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); } public function testGetUnknownDirectory() @@ -58,27 +57,35 @@ public function testGetUnknownDirectory() $this->expectExceptionCode(1013); $nonExistentDirectoryId = 99999999; - static::$_client->protectedDirectory()->get('id', $nonExistentDirectoryId); + static::$client->protectedDirectory()->get('id', $nonExistentDirectoryId); } public function testAddUser() { - $protectedDirectory = static::$_client->protectedDirectory()->add('/', static::$webspace->id); + $protectedDirectory = static::$client->protectedDirectory()->add('/', static::$webspace->id); - $user = static::$_client->protectedDirectory()->addUser($protectedDirectory, 'john', PasswordProvider::STRONG_PASSWORD); + $user = static::$client->protectedDirectory()->addUser( + $protectedDirectory, + 'john', + PasswordProvider::STRONG_PASSWORD + ); $this->assertGreaterThan(0, $user->id); - static::$_client->protectedDirectory()->delete('id', $protectedDirectory->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); + $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); + static::$client->protectedDirectory()->delete('id', $protectedDirectory->id); } } diff --git a/tests/ResellerTest.php b/tests/ResellerTest.php index 50a96b24..9c43f4db 100644 --- a/tests/ResellerTest.php +++ b/tests/ResellerTest.php @@ -1,18 +1,18 @@ _resellerProperties = [ + $this->resellerProperties = [ 'pname' => 'John Reseller', 'login' => 'reseller-unit-test', 'passwd' => PasswordProvider::STRONG_PASSWORD, @@ -21,56 +21,63 @@ 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'); + } + + public function testGetAllEmpty() + { + $resellersInfo = static::$client->reseller()->getAll(); + $this->assertCount(0, $resellersInfo); } } diff --git a/tests/SecretKeyTest.php b/tests/SecretKeyTest.php index 7ac6a313..9d6e92f0 100644 --- a/tests/SecretKeyTest.php +++ b/tests/SecretKeyTest.php @@ -1,38 +1,68 @@ 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); - static::$_client->secretKey()->delete($keyId); + $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); + $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); - static::$_client->secretKey()->delete($keyId); + 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'); + $keyIds[] = static::$client->secretKey()->create('192.168.0.1'); + $keyIds[] = static::$client->secretKey()->create('192.168.0.2'); - $keys = static::$_client->secretKey()->getAll(); + $keys = static::$client->secretKey()->getAll(); $this->assertGreaterThanOrEqual(2, count($keys)); $keyIpAddresses = array_map(function ($key) { @@ -42,17 +72,17 @@ public function testGetAll() $this->assertContains('192.168.0.2', $keyIpAddresses); foreach ($keyIds as $keyId) { - static::$_client->secretKey()->delete($keyId); + static::$client->secretKey()->delete($keyId); } } public function testDelete() { - $keyId = static::$_client->secretKey()->create('192.168.0.1'); - static::$_client->secretKey()->delete($keyId); + $keyId = static::$client->secretKey()->create('192.168.0.1'); + static::$client->secretKey()->delete($keyId); try { - static::$_client->secretKey()->get($keyId); + static::$client->secretKey()->get($keyId); $this->fail("Secret key $keyId was not deleted."); } catch (Exception $exception) { $this->assertEquals(1013, $exception->getCode()); @@ -61,12 +91,12 @@ public function testDelete() public function testListEmpty() { - $keys = static::$_client->secretKey()->getAll(); + $keys = static::$client->secretKey()->getAll(); foreach ($keys as $key) { - static::$_client->secretKey()->delete($key->key); + static::$client->secretKey()->delete($key->key); } - $keys = static::$_client->secretKey()->getAll(); + $keys = static::$client->secretKey()->getAll(); $this->assertEquals(0, count($keys)); } } diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 419002ae..1fb06533 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -1,28 +1,31 @@ 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->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); } 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,21 +86,33 @@ 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); $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() { - $config = static::$_client->server()->getSiteIsolationConfig(); + $config = static::$client->server()->getSiteIsolationConfig(); $this->assertIsArray($config); $this->assertGreaterThan(0, count($config)); $this->assertArrayHasKey('php', $config); @@ -105,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/ServicePlanTest.php index 6a29c09b..04232dc0 100644 --- a/tests/ServicePlanTest.php +++ b/tests/ServicePlanTest.php @@ -1,22 +1,80 @@ 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() { - $servicePlans = static::$_client->servicePlan()->getAll(); + 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 testCreateComplexServicePlan() + { + $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', + ], + ], + ], + ]; + + $servicePlan = static::$client->servicePlan()->create($properties); + $this->assertGreaterThan(0, $servicePlan->id); + + static::$client->servicePlan()->delete('id', $servicePlan->id); + } } diff --git a/tests/SessionTest.php b/tests/SessionTest.php index acebe286..a013ce25 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -1,14 +1,22 @@ session()->create('admin', '127.0.0.1'); + + $this->assertIsString($sessionToken); + $this->assertGreaterThan(10, strlen($sessionToken)); + } + 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]; @@ -19,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/SiteAliasTest.php b/tests/SiteAliasTest.php new file mode 100644 index 00000000..6cb4f0a0 --- /dev/null +++ b/tests/SiteAliasTest.php @@ -0,0 +1,70 @@ + $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/SiteTest.php b/tests/SiteTest.php index 9cb3c960..739aaded 100644 --- a/tests/SiteTest.php +++ b/tests/SiteTest.php @@ -1,78 +1,83 @@ 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 = []): \PleskX\Api\Struct\Site\Info { $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)); - static::$_client->site()->delete('id', $site->id); + $siteGuid = $siteInfo->guid; + $siteInfo = static::$client->site()->get('guid', $siteGuid); + $this->assertEquals($site->id, $siteInfo->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() @@ -82,26 +87,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(); + $this->assertEmpty($sitesInfo); } } diff --git a/tests/SubdomainTest.php b/tests/SubdomainTest.php index c5d77367..85bac57c 100644 --- a/tests/SubdomainTest.php +++ b/tests/SubdomainTest.php @@ -1,32 +1,24 @@ webspace()->get('id', static::$webspace->id); + static::$webspace = static::createWebspace(); + $webspaceInfo = static::$client->webspace()->get('id', static::$webspace->id); static::$webspaceName = $webspaceInfo->name; } - /** - * @param string $name - * - * @return \PleskX\Api\Struct\Subdomain\Info - */ - private function _createSubdomain($name) + private function createSubdomain(string $name): \PleskX\Api\Struct\Subdomain\Info { - return static::$_client->subdomain()->create([ + return static::$client->subdomain()->create([ 'parent' => static::$webspaceName, 'name' => $name, 'property' => [ @@ -37,52 +29,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/TestCase.php b/tests/TestCase.php deleted file mode 100644 index c5c855e4..00000000 --- a/tests/TestCase.php +++ /dev/null @@ -1,72 +0,0 @@ -setCredentials($login, $password); - } - - public static function tearDownAfterClass(): void - { - foreach (self::$webspaces as $webspace) { - try { - static::$_client->webspace()->delete('id', $webspace->id); - } catch (\Exception $e) { - } - } - } - - /** - * @return string - */ - protected static function _getIpAddress() - { - $ips = static::$_client->ip()->get(); - $ipInfo = reset($ips); - - return $ipInfo->ipAddress; - } - - /** - * @return \PleskX\Api\Struct\Webspace\Info - */ - protected static function _createWebspace() - { - $id = uniqid(); - $webspace = static::$_client->webspace()->create( - [ - 'name' => "test{$id}.test", - 'ip_address' => static::_getIpAddress(), - ], [ - 'ftp_login' => "u{$id}", - 'ftp_password' => PasswordProvider::STRONG_PASSWORD, - ] - ); - self::$webspaces[] = $webspace; - - return $webspace; - } -} diff --git a/tests/UiTest.php b/tests/UiTest.php index 717b5a23..f0754aad 100644 --- a/tests/UiTest.php +++ b/tests/UiTest.php @@ -1,11 +1,11 @@ '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 0fff84d4..c34450fd 100644 --- a/tests/Utility/KeyLimitChecker.php +++ b/tests/Utility/KeyLimitChecker.php @@ -1,13 +1,13 @@ 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,45 +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); $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'; }); @@ -95,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' => [ @@ -113,7 +121,7 @@ public function testRequestCreateWebspace() 'value' => PasswordProvider::STRONG_PASSWORD, ], ], - 'ip_address' => static::_getIpAddress(), + 'ip_address' => static::getIpAddress(), ], ], 'limits' => [ @@ -157,21 +165,79 @@ 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); + $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); + } + + 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); + } + + 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); + static::$client->webspace()->delete('id', $webspace->id); } } diff --git a/wait-for-plesk.sh b/wait-for-plesk.sh index 98c90dd8..df4fa987 100755 --- a/wait-for-plesk.sh +++ b/wait-for-plesk.sh @@ -1,8 +1,8 @@ #!/bin/bash -### Copyright 1999-2020. Plesk International GmbH. +### Copyright 1999-2022. 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