From 02d39965c72177818ad5fc703aac813e638ff613 Mon Sep 17 00:00:00 2001 From: Shimon Newman Date: Wed, 1 Mar 2023 16:07:12 +0200 Subject: [PATCH 1/7] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bce539b..94a3f96 100755 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require": { "php": ">=8.0", - "utopia-php/cli": "0.14.*" + "utopia-php/cli": "0.15.*" }, "require-dev": { "phpunit/phpunit": "^9.3", From 4914c21e83d8adcef98d306889bd3ef5bb4f871b Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 2 Mar 2023 16:59:34 +0200 Subject: [PATCH 2/7] composer.lock --- composer.lock | 226 +++++++++++++++++++++++++------------------------- 1 file changed, 112 insertions(+), 114 deletions(-) diff --git a/composer.lock b/composer.lock index 2839d45..f15dcc8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "61c6766ea435ba9e95b8efca270d15d4", + "content-hash": "a1a9ccbb8efcd2dbcb48fd4305387081", "packages": [ { "name": "utopia-php/cli", - "version": "0.14.0", + "version": "0.15.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cli.git", - "reference": "c30ef985a4e739758a0d95eb0706b357b6d8c086" + "reference": "ccb7c8125ffe0254fef8f25744bfa376eb7bd0ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cli/zipball/c30ef985a4e739758a0d95eb0706b357b6d8c086", - "reference": "c30ef985a4e739758a0d95eb0706b357b6d8c086", + "url": "https://api.github.com/repos/utopia-php/cli/zipball/ccb7c8125ffe0254fef8f25744bfa376eb7bd0ea", + "reference": "ccb7c8125ffe0254fef8f25744bfa376eb7bd0ea", "shasum": "" }, "require": { @@ -25,8 +25,10 @@ "utopia-php/framework": "0.*.*" }, "require-dev": { + "laravel/pint": "1.2.*", "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "^3.6" + "squizlabs/php_codesniffer": "^3.6", + "vimeo/psalm": "4.0.1" }, "type": "library", "autoload": { @@ -38,12 +40,6 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Eldad Fux", - "email": "eldad@appwrite.io" - } - ], "description": "A simple CLI library to manage command line applications", "keywords": [ "cli", @@ -55,30 +51,31 @@ ], "support": { "issues": "https://github.com/utopia-php/cli/issues", - "source": "https://github.com/utopia-php/cli/tree/0.14.0" + "source": "https://github.com/utopia-php/cli/tree/0.15.0" }, - "time": "2022-10-09T10:19:07+00:00" + "time": "2023-03-01T05:55:14+00:00" }, { "name": "utopia-php/framework", - "version": "0.25.0", + "version": "0.28.1", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "c524f681254255c8204fbf7919c53bf3b4982636" + "reference": "7f22c556fc5991e54e5811a68fb39809b21bda55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/c524f681254255c8204fbf7919c53bf3b4982636", - "reference": "c524f681254255c8204fbf7919c53bf3b4982636", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/7f22c556fc5991e54e5811a68fb39809b21bda55", + "reference": "7f22c556fc5991e54e5811a68fb39809b21bda55", "shasum": "" }, "require": { "php": ">=8.0.0" }, "require-dev": { + "laravel/pint": "^1.2", "phpunit/phpunit": "^9.5.25", - "vimeo/psalm": "^4.27.0" + "vimeo/psalm": "4.27.0" }, "type": "library", "autoload": { @@ -98,9 +95,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.25.0" + "source": "https://github.com/utopia-php/framework/tree/0.28.1" }, - "time": "2022-11-02T09:49:57+00:00" + "time": "2023-03-02T08:16:01+00:00" } ], "packages-dev": [ @@ -527,30 +524,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -577,7 +574,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -593,7 +590,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -698,16 +695,16 @@ }, { "name": "laravel/pint", - "version": "v1.2.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86" + "reference": "e48e3fadd7863d6b7d03464f5c4f211a828b890f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/1d276e4c803397a26cc337df908f55c2a4e90d86", - "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86", + "url": "https://api.github.com/repos/laravel/pint/zipball/e48e3fadd7863d6b7d03464f5c4f211a828b890f", + "reference": "e48e3fadd7863d6b7d03464f5c4f211a828b890f", "shasum": "" }, "require": { @@ -715,16 +712,16 @@ "ext-mbstring": "*", "ext-tokenizer": "*", "ext-xml": "*", - "php": "^8.0" + "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.11.0", - "illuminate/view": "^9.27", - "laravel-zero/framework": "^9.1.3", - "mockery/mockery": "^1.5.0", - "nunomaduro/larastan": "^2.2", - "nunomaduro/termwind": "^1.14.0", - "pestphp/pest": "^1.22.1" + "friendsofphp/php-cs-fixer": "^3.14.4", + "illuminate/view": "^10.0.0", + "laravel-zero/framework": "^10.0.0", + "mockery/mockery": "^1.5.1", + "nunomaduro/larastan": "^2.4.0", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^1.22.4" }, "bin": [ "builds/pint" @@ -760,7 +757,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2022-09-13T15:07:15+00:00" + "time": "2023-02-21T15:44:57+00:00" }, { "name": "myclabs/deep-copy", @@ -874,16 +871,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.2", + "version": "v4.15.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -924,9 +921,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2022-11-12T15:38:23+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "openlss/lib-array2xml", @@ -1259,23 +1256,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.18", + "version": "9.2.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a" + "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a", - "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e2b40518197a8c0d4b08bc34dfff1c99c508954", + "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1324,7 +1321,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.25" }, "funding": [ { @@ -1332,7 +1329,7 @@ "type": "github" } ], - "time": "2022-10-27T13:35:33+00:00" + "time": "2023-02-25T05:32:00+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1577,20 +1574,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.26", + "version": "9.6.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2" + "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/851867efcbb6a1b992ec515c71cdcf20d895e9d2", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9125ee085b6d95e78277dc07aa1f46f9e0607b8d", + "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1628,7 +1625,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -1659,7 +1656,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.26" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.4" }, "funding": [ { @@ -1675,7 +1672,7 @@ "type": "tidelift" } ], - "time": "2022-10-28T06:00:21+00:00" + "time": "2023-02-27T13:06:37+00:00" }, { "name": "psr/container", @@ -2146,16 +2143,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -2197,7 +2194,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -2205,7 +2202,7 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -2519,16 +2516,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -2567,10 +2564,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://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" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -2578,7 +2575,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -2637,16 +2634,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -2681,7 +2678,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -2689,7 +2686,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -2746,16 +2743,16 @@ }, { "name": "symfony/console", - "version": "v5.4.15", + "version": "v5.4.21", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669" + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ea59bb0edfaf9f28d18d8791410ee0355f317669", - "reference": "ea59bb0edfaf9f28d18d8791410ee0355f317669", + "url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", "shasum": "" }, "require": { @@ -2825,7 +2822,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.15" + "source": "https://github.com/symfony/console/tree/v5.4.21" }, "funding": [ { @@ -2841,20 +2838,20 @@ "type": "tidelift" } ], - "time": "2022-10-26T21:41:52+00:00" + "time": "2023-02-25T16:59:41+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.1", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", "shasum": "" }, "require": { @@ -2863,7 +2860,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -2892,7 +2889,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" }, "funding": [ { @@ -2908,7 +2905,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2023-03-01T10:25:55+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3404,16 +3401,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.1.1", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239" + "reference": "a8c9cedf55f314f3a186041d19537303766df09a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/925e713fe8fcacf6bc05e936edd8dd5441a21239", - "reference": "925e713fe8fcacf6bc05e936edd8dd5441a21239", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", + "reference": "a8c9cedf55f314f3a186041d19537303766df09a", "shasum": "" }, "require": { @@ -3429,7 +3426,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3469,7 +3466,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" }, "funding": [ { @@ -3485,20 +3482,20 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:18:58+00:00" + "time": "2023-03-01T10:32:47+00:00" }, { "name": "symfony/string", - "version": "v6.1.7", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "823f143370880efcbdfa2dbca946b3358c4707e5" + "reference": "67b8c1eec78296b85dc1c7d9743830160218993d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/823f143370880efcbdfa2dbca946b3358c4707e5", - "reference": "823f143370880efcbdfa2dbca946b3358c4707e5", + "url": "https://api.github.com/repos/symfony/string/zipball/67b8c1eec78296b85dc1c7d9743830160218993d", + "reference": "67b8c1eec78296b85dc1c7d9743830160218993d", "shasum": "" }, "require": { @@ -3514,6 +3511,7 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -3554,7 +3552,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.7" + "source": "https://github.com/symfony/string/tree/v6.2.7" }, "funding": [ { @@ -3570,7 +3568,7 @@ "type": "tidelift" } ], - "time": "2022-10-10T09:34:31+00:00" + "time": "2023-02-24T10:42:00+00:00" }, { "name": "theseer/tokenizer", @@ -3890,5 +3888,5 @@ "php": ">=8.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 3959e1c2c74a64e9942e3f3208a625b090e62a0e Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 2 Mar 2023 17:01:19 +0200 Subject: [PATCH 3/7] composer.lock --- src/Orchestration/Adapter.php | 44 ------------------ src/Orchestration/Adapter/DockerAPI.php | 41 ----------------- src/Orchestration/Adapter/DockerCLI.php | 36 --------------- src/Orchestration/Container.php | 12 ----- src/Orchestration/Container/Stats.php | 4 -- src/Orchestration/Network.php | 34 -------------- src/Orchestration/Orchestration.php | 46 ------------------- tests/Orchestration/Adapter/DockerAPITest.php | 5 -- tests/Orchestration/Adapter/DockerCLITest.php | 5 -- tests/Orchestration/Base.php | 19 -------- 10 files changed, 246 deletions(-) diff --git a/src/Orchestration/Adapter.php b/src/Orchestration/Adapter.php index fa01ee8..5f433c7 100644 --- a/src/Orchestration/Adapter.php +++ b/src/Orchestration/Adapter.php @@ -26,9 +26,6 @@ abstract class Adapter /** * Filter ENV vars - * - * @param string $string - * @return string */ public function filterEnvKey(string $string): string { @@ -37,43 +34,26 @@ public function filterEnvKey(string $string): string /** * Create Network - * - * @param string $name - * @return bool */ abstract public function createNetwork(string $name, bool $internal = false): bool; /** * Remove Network - * - * @param string $name - * @return bool */ abstract public function removeNetwork(string $name): bool; /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ abstract public function networkConnect(string $container, string $network): bool; /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ abstract public function networkDisconnect(string $container, string $network, bool $force = false): bool; /** * List Networks - * - * @return array */ abstract public function listNetworks(): array; @@ -88,9 +68,6 @@ abstract public function getStats(string $container = null, array $filters = []) /** * Pull Image - * - * @param string $image - * @return bool */ abstract public function pull(string $image): bool; @@ -108,17 +85,9 @@ abstract public function list(array $filters = []): array; * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name * @param string[] $command - * @param string $entrypoint - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @param string $hostname - * @param bool $remove - * @return string */ abstract public function run( string $image, @@ -136,29 +105,19 @@ abstract public function run( /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ abstract public function execute(string $name, array $command, string &$stdout, string &$stderr, array $vars = [], int $timeout = -1): bool; /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ abstract public function remove(string $name, bool $force): bool; /** * Set containers namespace * - * @param string $namespace * @return $this */ public function setNamespace(string $namespace): self @@ -171,7 +130,6 @@ public function setNamespace(string $namespace): self /** * Set max allowed CPU cores per container * - * @param int $cores * @return $this */ public function setCpus(int $cores): self @@ -184,7 +142,6 @@ public function setCpus(int $cores): self /** * Set max allowed memory in mb per container * - * @param int $mb * @return $this */ public function setMemory(int $mb): self @@ -197,7 +154,6 @@ public function setMemory(int $mb): self /** * Set max allowed swap memory in mb per container * - * @param int $mb * @return $this */ public function setSwap(int $mb): self diff --git a/src/Orchestration/Adapter/DockerAPI.php b/src/Orchestration/Adapter/DockerAPI.php index a32d916..3ede0d9 100644 --- a/src/Orchestration/Adapter/DockerAPI.php +++ b/src/Orchestration/Adapter/DockerAPI.php @@ -40,11 +40,8 @@ public function __construct(string $username = null, string $password = null, st /** * Create a request with cURL via the Docker socket * - * @param string $url - * @param string $method * @param array|bool|int|float|object|resource|string|null $body * @param string[] $headers - * @param int $timeout * @return (bool|mixed|string)[] * * @psalm-return array{response: mixed, code: mixed} @@ -95,8 +92,6 @@ protected function call(string $url, string $method, $body = null, array $header * Create a request with cURL via the Docker socket * but process a Docker Stream Response * - * @param string $url - * @param int $timeout * @return (bool|mixed|string)[] * * @psalm-return array{response: bool|string, code: mixed, stdout: mixed, stderr: mixed} @@ -179,10 +174,6 @@ protected function streamCall(string $url, int $timeout = -1): array /** * Create Network - * - * @param string $name - * @param bool $internal - * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -205,9 +196,6 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network - * - * @param string $name - * @return bool */ public function removeNetwork(string $name): bool { @@ -222,10 +210,6 @@ public function removeNetwork(string $name): bool /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -247,11 +231,6 @@ public function networkConnect(string $container, string $network): bool /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -328,8 +307,6 @@ public function getStats(string $container = null, array $filters = []): array /** * List Networks - * - * @return array */ public function listNetworks(): array { @@ -359,9 +336,6 @@ public function listNetworks(): array /** * Pull Image - * - * @param string $image - * @return bool */ public function pull(string $image): bool { @@ -427,15 +401,9 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name * @param string[] $command - * @param string $entrypoint - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @return string */ public function run( string $image, @@ -509,13 +477,8 @@ public function run( /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ public function execute( string $name, @@ -566,10 +529,6 @@ public function execute( /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ public function remove(string $name, bool $force = false): bool { diff --git a/src/Orchestration/Adapter/DockerCLI.php b/src/Orchestration/Adapter/DockerCLI.php index 1694753..024a9aa 100644 --- a/src/Orchestration/Adapter/DockerCLI.php +++ b/src/Orchestration/Adapter/DockerCLI.php @@ -33,10 +33,6 @@ public function __construct(string $username = null, string $password = null) /** * Create Network - * - * @param string $name - * @param bool $internal - * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -50,9 +46,6 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network - * - * @param string $name - * @return bool */ public function removeNetwork(string $name): bool { @@ -66,10 +59,6 @@ public function removeNetwork(string $name): bool /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -83,11 +72,6 @@ public function networkConnect(string $container, string $network): bool /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -214,8 +198,6 @@ private function parseIOStats(string $stats) /** * List Networks - * - * @return array */ public function listNetworks(): array { @@ -248,9 +230,6 @@ public function listNetworks(): array /** * Pull Image - * - * @param string $image - * @return bool */ public function pull(string $image): bool { @@ -322,15 +301,9 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name * @param string[] $command - * @param string $entrypoint - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @return string */ public function run(string $image, string $name, @@ -413,13 +386,8 @@ public function run(string $image, /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ public function execute( string $name, @@ -461,10 +429,6 @@ public function execute( /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ public function remove(string $name, bool $force = false): bool { diff --git a/src/Orchestration/Container.php b/src/Orchestration/Container.php index 65dc174..7d7ce64 100644 --- a/src/Orchestration/Container.php +++ b/src/Orchestration/Container.php @@ -5,9 +5,6 @@ class Container { /** - * @param string $name - * @param string $id - * @param string $status * @param array $labels */ public function __construct(string $name = '', string $id = '', string $status = '', array $labels = []) @@ -40,8 +37,6 @@ public function __construct(string $name = '', string $id = '', string $status = /** * Get the container's name - * - * @return string */ public function getName(): string { @@ -50,8 +45,6 @@ public function getName(): string /** * Get the container's ID - * - * @return string */ public function getId(): string { @@ -60,8 +53,6 @@ public function getId(): string /** * Get the container's status - * - * @return string */ public function getStatus(): string { @@ -81,7 +72,6 @@ public function getLabels(): array /** * Set the container's name * - * @param string $name * @return $this */ public function setName(string $name): self @@ -94,7 +84,6 @@ public function setName(string $name): self /** * Set the container's id * - * @param string $id * @return $this */ public function setId(string $id): self @@ -107,7 +96,6 @@ public function setId(string $id): self /** * Set the container's status * - * @param string $status * @return $this */ public function setStatus(string $status): self diff --git a/src/Orchestration/Container/Stats.php b/src/Orchestration/Container/Stats.php index 4580648..b63701b 100644 --- a/src/Orchestration/Container/Stats.php +++ b/src/Orchestration/Container/Stats.php @@ -28,10 +28,6 @@ class Stats protected array $networkIO; /** - * @param string $containerId - * @param string $containerName - * @param float $cpuUsage - * @param float $memoryUsage * @param array $diskIO * @param array $memoryIO * @param array $networkIO diff --git a/src/Orchestration/Network.php b/src/Orchestration/Network.php index b51d8e3..9f8cffa 100644 --- a/src/Orchestration/Network.php +++ b/src/Orchestration/Network.php @@ -24,12 +24,6 @@ class Network */ protected $scope; - /** - * @param string $name - * @param string $id - * @param string $driver - * @param string $scope - */ public function __construct(string $name = '', string $id = '', string $driver = '', string $scope = '') { $this->name = $name; @@ -38,42 +32,26 @@ public function __construct(string $name = '', string $id = '', string $driver = $this->scope = $scope; } - /** - * @return string - */ public function getName(): string { return $this->name; } - /** - * @return string - */ public function getId(): string { return $this->id; } - /** - * @return string - */ public function getDriver(): string { return $this->driver; } - /** - * @return string - */ public function getScope(): string { return $this->scope; } - /** - * @param string $name - * @return Network - */ public function setName(string $name): Network { $this->name = $name; @@ -81,10 +59,6 @@ public function setName(string $name): Network return $this; } - /** - * @param string $id - * @return Network - */ public function setId(string $id): Network { $this->id = $id; @@ -92,10 +66,6 @@ public function setId(string $id): Network return $this; } - /** - * @param string $driver - * @return Network - */ public function setDriver(string $driver): Network { $this->driver = $driver; @@ -103,10 +73,6 @@ public function setDriver(string $driver): Network return $this; } - /** - * @param string $scope - * @return Network - */ public function setScope(string $scope): Network { $this->scope = $scope; diff --git a/src/Orchestration/Orchestration.php b/src/Orchestration/Orchestration.php index bcbb774..d6f8f16 100644 --- a/src/Orchestration/Orchestration.php +++ b/src/Orchestration/Orchestration.php @@ -12,9 +12,6 @@ class Orchestration */ protected $adapter; - /** - * @param Adapter $adapter - */ public function __construct(Adapter $adapter) { $this->adapter = $adapter; @@ -30,7 +27,6 @@ public function __construct(Adapter $adapter) * * If there are no spaces detected in the first place it will just return the string as an array. * - * @param string $command * @return (false|string)[] */ public function parseCommandString(string $command): array @@ -79,10 +75,6 @@ public function parseCommandString(string $command): array /** * Create Network - * - * @param string $name - * @param bool $internal - * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -91,9 +83,6 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network - * - * @param string $name - * @return bool */ public function removeNetwork(string $name): bool { @@ -102,8 +91,6 @@ public function removeNetwork(string $name): bool /** * List Networks - * - * @return array */ public function listNetworks(): array { @@ -112,10 +99,6 @@ public function listNetworks(): array /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -136,11 +119,6 @@ public function getStats(string $container = null, array $filters = []): array /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -149,9 +127,6 @@ public function networkDisconnect(string $container, string $network, bool $forc /** * Pull Image - * - * @param string $image - * @return bool */ public function pull(string $image): bool { @@ -175,17 +150,9 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name - * @param string $entrypoint * @param string[] $command - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @param string $hostname - * @param bool $remove - * @return string */ public function run( string $image, @@ -206,13 +173,8 @@ public function run( /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ public function execute( string $name, @@ -227,10 +189,6 @@ public function execute( /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ public function remove(string $name, bool $force = false): bool { @@ -240,7 +198,6 @@ public function remove(string $name, bool $force = false): bool /** * Set containers namespace * - * @param string $namespace * @return $this */ public function setNamespace(string $namespace): self @@ -253,7 +210,6 @@ public function setNamespace(string $namespace): self /** * Set max allowed CPU cores per container * - * @param int $cores * @return $this */ public function setCpus(int $cores): self @@ -266,7 +222,6 @@ public function setCpus(int $cores): self /** * Set max allowed memory in mb per container * - * @param int $mb * @return $this */ public function setMemory(int $mb): self @@ -279,7 +234,6 @@ public function setMemory(int $mb): self /** * Set max allowed swap memory in mb per container * - * @param int $mb * @return $this */ public function setSwap(int $mb): self diff --git a/tests/Orchestration/Adapter/DockerAPITest.php b/tests/Orchestration/Adapter/DockerAPITest.php index 1b94955..26a4f1a 100644 --- a/tests/Orchestration/Adapter/DockerAPITest.php +++ b/tests/Orchestration/Adapter/DockerAPITest.php @@ -15,17 +15,12 @@ class DockerAPITest extends Base /** * Return name of adapter - * - * @return string */ public static function getAdapterName(): string { return 'Docker API'; } - /** - * @return Orchestration - */ public static function getOrchestration(): Orchestration { if (! is_null(self::$orchestration)) { diff --git a/tests/Orchestration/Adapter/DockerCLITest.php b/tests/Orchestration/Adapter/DockerCLITest.php index eb2197d..0f88880 100644 --- a/tests/Orchestration/Adapter/DockerCLITest.php +++ b/tests/Orchestration/Adapter/DockerCLITest.php @@ -15,17 +15,12 @@ class DockerCLITest extends Base /** * Return name of adapter - * - * @return string */ public static function getAdapterName(): string { return 'Docker CLI'; } - /** - * @return Orchestration - */ public static function getOrchestration(): Orchestration { if (! is_null(self::$orchestration)) { diff --git a/tests/Orchestration/Base.php b/tests/Orchestration/Base.php index 7a4255c..d540955 100644 --- a/tests/Orchestration/Base.php +++ b/tests/Orchestration/Base.php @@ -7,14 +7,8 @@ abstract class Base extends TestCase { - /** - * @return Orchestration - */ abstract protected static function getOrchestration(): Orchestration; - /** - * @return string - */ abstract protected static function getAdapterName(): string; /** @@ -52,7 +46,6 @@ public function testPullImage(): void } /** - * @return void * @depends testPullImage */ public function testCreateContainer(): void @@ -100,7 +93,6 @@ public function testCreateContainer(): void // Network Tests /** - * @return void * @depends testCreateContainer */ public function testCreateNetwork(): void @@ -111,7 +103,6 @@ public function testCreateNetwork(): void } /** - * @return void * @depends testCreateNetwork */ public function testListNetworks(): void @@ -130,7 +121,6 @@ public function testListNetworks(): void } /** - * @return void * @depends testCreateNetwork */ public function testnetworkConnect(): void @@ -141,7 +131,6 @@ public function testnetworkConnect(): void } /** - * @return void * @depends testnetworkConnect */ public function testnetworkDisconnect(): void @@ -152,7 +141,6 @@ public function testnetworkDisconnect(): void } /** - * @return void * @depends testCreateNetwork */ public function testRemoveNetwork(): void @@ -163,7 +151,6 @@ public function testRemoveNetwork(): void } /** - * @return void * @depends testCreateContainer */ public function testExecContainer(): void @@ -206,7 +193,6 @@ public function testExecContainer(): void } /** - * @return void * @depends testExecContainer */ public function testCheckVolume(): void @@ -228,7 +214,6 @@ public function testCheckVolume(): void } /** - * @return void * @depends testExecContainer */ public function testTimeoutContainer(): void @@ -322,7 +307,6 @@ public function testTimeoutContainer(): void } /** - * @return void * @depends testCreateContainer */ public function testListContainers(): void @@ -341,7 +325,6 @@ public function testListContainers(): void } /** - * @return void * @depends testCreateContainer */ public function testListFilters(): void @@ -352,7 +335,6 @@ public function testListFilters(): void } /** - * @return void * @depends testCreateContainer */ public function testRemoveContainer(): void @@ -448,7 +430,6 @@ public function testRunRemove(): void } /** - * @return void * @depends testPullImage */ public function testUsageStats(): void From ab2edaa6d22c55b69bf6412d2a2317419d1668ee Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 7 Mar 2023 11:05:54 +0200 Subject: [PATCH 4/7] composer.lock --- src/Orchestration/Adapter.php | 44 ++++++++++++++++++ src/Orchestration/Adapter/DockerAPI.php | 41 +++++++++++++++++ src/Orchestration/Adapter/DockerCLI.php | 36 +++++++++++++++ src/Orchestration/Container.php | 12 +++++ src/Orchestration/Container/Stats.php | 4 ++ src/Orchestration/Network.php | 34 ++++++++++++++ src/Orchestration/Orchestration.php | 46 +++++++++++++++++++ tests/Orchestration/Adapter/DockerAPITest.php | 5 ++ tests/Orchestration/Adapter/DockerCLITest.php | 5 ++ tests/Orchestration/Base.php | 19 ++++++++ 10 files changed, 246 insertions(+) diff --git a/src/Orchestration/Adapter.php b/src/Orchestration/Adapter.php index 5f433c7..fa01ee8 100644 --- a/src/Orchestration/Adapter.php +++ b/src/Orchestration/Adapter.php @@ -26,6 +26,9 @@ abstract class Adapter /** * Filter ENV vars + * + * @param string $string + * @return string */ public function filterEnvKey(string $string): string { @@ -34,26 +37,43 @@ public function filterEnvKey(string $string): string /** * Create Network + * + * @param string $name + * @return bool */ abstract public function createNetwork(string $name, bool $internal = false): bool; /** * Remove Network + * + * @param string $name + * @return bool */ abstract public function removeNetwork(string $name): bool; /** * Connect a container to a network + * + * @param string $container + * @param string $network + * @return bool */ abstract public function networkConnect(string $container, string $network): bool; /** * Disconnect a container from a network + * + * @param string $container + * @param string $network + * @param bool $force + * @return bool */ abstract public function networkDisconnect(string $container, string $network, bool $force = false): bool; /** * List Networks + * + * @return array */ abstract public function listNetworks(): array; @@ -68,6 +88,9 @@ abstract public function getStats(string $container = null, array $filters = []) /** * Pull Image + * + * @param string $image + * @return bool */ abstract public function pull(string $image): bool; @@ -85,9 +108,17 @@ abstract public function list(array $filters = []): array; * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * + * @param string $image + * @param string $name * @param string[] $command + * @param string $entrypoint + * @param string $workdir * @param string[] $volumes * @param array $vars + * @param string $mountFolder + * @param string $hostname + * @param bool $remove + * @return string */ abstract public function run( string $image, @@ -105,19 +136,29 @@ abstract public function run( /** * Execute Container * + * @param string $name * @param string[] $command + * @param string &$stdout + * @param string &$stderr * @param array $vars + * @param int $timeout + * @return bool */ abstract public function execute(string $name, array $command, string &$stdout, string &$stderr, array $vars = [], int $timeout = -1): bool; /** * Remove Container + * + * @param string $name + * @param bool $force + * @return bool */ abstract public function remove(string $name, bool $force): bool; /** * Set containers namespace * + * @param string $namespace * @return $this */ public function setNamespace(string $namespace): self @@ -130,6 +171,7 @@ public function setNamespace(string $namespace): self /** * Set max allowed CPU cores per container * + * @param int $cores * @return $this */ public function setCpus(int $cores): self @@ -142,6 +184,7 @@ public function setCpus(int $cores): self /** * Set max allowed memory in mb per container * + * @param int $mb * @return $this */ public function setMemory(int $mb): self @@ -154,6 +197,7 @@ public function setMemory(int $mb): self /** * Set max allowed swap memory in mb per container * + * @param int $mb * @return $this */ public function setSwap(int $mb): self diff --git a/src/Orchestration/Adapter/DockerAPI.php b/src/Orchestration/Adapter/DockerAPI.php index 3ede0d9..a32d916 100644 --- a/src/Orchestration/Adapter/DockerAPI.php +++ b/src/Orchestration/Adapter/DockerAPI.php @@ -40,8 +40,11 @@ public function __construct(string $username = null, string $password = null, st /** * Create a request with cURL via the Docker socket * + * @param string $url + * @param string $method * @param array|bool|int|float|object|resource|string|null $body * @param string[] $headers + * @param int $timeout * @return (bool|mixed|string)[] * * @psalm-return array{response: mixed, code: mixed} @@ -92,6 +95,8 @@ protected function call(string $url, string $method, $body = null, array $header * Create a request with cURL via the Docker socket * but process a Docker Stream Response * + * @param string $url + * @param int $timeout * @return (bool|mixed|string)[] * * @psalm-return array{response: bool|string, code: mixed, stdout: mixed, stderr: mixed} @@ -174,6 +179,10 @@ protected function streamCall(string $url, int $timeout = -1): array /** * Create Network + * + * @param string $name + * @param bool $internal + * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -196,6 +205,9 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network + * + * @param string $name + * @return bool */ public function removeNetwork(string $name): bool { @@ -210,6 +222,10 @@ public function removeNetwork(string $name): bool /** * Connect a container to a network + * + * @param string $container + * @param string $network + * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -231,6 +247,11 @@ public function networkConnect(string $container, string $network): bool /** * Disconnect a container from a network + * + * @param string $container + * @param string $network + * @param bool $force + * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -307,6 +328,8 @@ public function getStats(string $container = null, array $filters = []): array /** * List Networks + * + * @return array */ public function listNetworks(): array { @@ -336,6 +359,9 @@ public function listNetworks(): array /** * Pull Image + * + * @param string $image + * @return bool */ public function pull(string $image): bool { @@ -401,9 +427,15 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * + * @param string $image + * @param string $name * @param string[] $command + * @param string $entrypoint + * @param string $workdir * @param string[] $volumes * @param array $vars + * @param string $mountFolder + * @return string */ public function run( string $image, @@ -477,8 +509,13 @@ public function run( /** * Execute Container * + * @param string $name * @param string[] $command + * @param string &$stdout + * @param string &$stderr * @param array $vars + * @param int $timeout + * @return bool */ public function execute( string $name, @@ -529,6 +566,10 @@ public function execute( /** * Remove Container + * + * @param string $name + * @param bool $force + * @return bool */ public function remove(string $name, bool $force = false): bool { diff --git a/src/Orchestration/Adapter/DockerCLI.php b/src/Orchestration/Adapter/DockerCLI.php index 024a9aa..1694753 100644 --- a/src/Orchestration/Adapter/DockerCLI.php +++ b/src/Orchestration/Adapter/DockerCLI.php @@ -33,6 +33,10 @@ public function __construct(string $username = null, string $password = null) /** * Create Network + * + * @param string $name + * @param bool $internal + * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -46,6 +50,9 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network + * + * @param string $name + * @return bool */ public function removeNetwork(string $name): bool { @@ -59,6 +66,10 @@ public function removeNetwork(string $name): bool /** * Connect a container to a network + * + * @param string $container + * @param string $network + * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -72,6 +83,11 @@ public function networkConnect(string $container, string $network): bool /** * Disconnect a container from a network + * + * @param string $container + * @param string $network + * @param bool $force + * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -198,6 +214,8 @@ private function parseIOStats(string $stats) /** * List Networks + * + * @return array */ public function listNetworks(): array { @@ -230,6 +248,9 @@ public function listNetworks(): array /** * Pull Image + * + * @param string $image + * @return bool */ public function pull(string $image): bool { @@ -301,9 +322,15 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * + * @param string $image + * @param string $name * @param string[] $command + * @param string $entrypoint + * @param string $workdir * @param string[] $volumes * @param array $vars + * @param string $mountFolder + * @return string */ public function run(string $image, string $name, @@ -386,8 +413,13 @@ public function run(string $image, /** * Execute Container * + * @param string $name * @param string[] $command + * @param string &$stdout + * @param string &$stderr * @param array $vars + * @param int $timeout + * @return bool */ public function execute( string $name, @@ -429,6 +461,10 @@ public function execute( /** * Remove Container + * + * @param string $name + * @param bool $force + * @return bool */ public function remove(string $name, bool $force = false): bool { diff --git a/src/Orchestration/Container.php b/src/Orchestration/Container.php index 7d7ce64..65dc174 100644 --- a/src/Orchestration/Container.php +++ b/src/Orchestration/Container.php @@ -5,6 +5,9 @@ class Container { /** + * @param string $name + * @param string $id + * @param string $status * @param array $labels */ public function __construct(string $name = '', string $id = '', string $status = '', array $labels = []) @@ -37,6 +40,8 @@ public function __construct(string $name = '', string $id = '', string $status = /** * Get the container's name + * + * @return string */ public function getName(): string { @@ -45,6 +50,8 @@ public function getName(): string /** * Get the container's ID + * + * @return string */ public function getId(): string { @@ -53,6 +60,8 @@ public function getId(): string /** * Get the container's status + * + * @return string */ public function getStatus(): string { @@ -72,6 +81,7 @@ public function getLabels(): array /** * Set the container's name * + * @param string $name * @return $this */ public function setName(string $name): self @@ -84,6 +94,7 @@ public function setName(string $name): self /** * Set the container's id * + * @param string $id * @return $this */ public function setId(string $id): self @@ -96,6 +107,7 @@ public function setId(string $id): self /** * Set the container's status * + * @param string $status * @return $this */ public function setStatus(string $status): self diff --git a/src/Orchestration/Container/Stats.php b/src/Orchestration/Container/Stats.php index b63701b..4580648 100644 --- a/src/Orchestration/Container/Stats.php +++ b/src/Orchestration/Container/Stats.php @@ -28,6 +28,10 @@ class Stats protected array $networkIO; /** + * @param string $containerId + * @param string $containerName + * @param float $cpuUsage + * @param float $memoryUsage * @param array $diskIO * @param array $memoryIO * @param array $networkIO diff --git a/src/Orchestration/Network.php b/src/Orchestration/Network.php index 9f8cffa..b51d8e3 100644 --- a/src/Orchestration/Network.php +++ b/src/Orchestration/Network.php @@ -24,6 +24,12 @@ class Network */ protected $scope; + /** + * @param string $name + * @param string $id + * @param string $driver + * @param string $scope + */ public function __construct(string $name = '', string $id = '', string $driver = '', string $scope = '') { $this->name = $name; @@ -32,26 +38,42 @@ public function __construct(string $name = '', string $id = '', string $driver = $this->scope = $scope; } + /** + * @return string + */ public function getName(): string { return $this->name; } + /** + * @return string + */ public function getId(): string { return $this->id; } + /** + * @return string + */ public function getDriver(): string { return $this->driver; } + /** + * @return string + */ public function getScope(): string { return $this->scope; } + /** + * @param string $name + * @return Network + */ public function setName(string $name): Network { $this->name = $name; @@ -59,6 +81,10 @@ public function setName(string $name): Network return $this; } + /** + * @param string $id + * @return Network + */ public function setId(string $id): Network { $this->id = $id; @@ -66,6 +92,10 @@ public function setId(string $id): Network return $this; } + /** + * @param string $driver + * @return Network + */ public function setDriver(string $driver): Network { $this->driver = $driver; @@ -73,6 +103,10 @@ public function setDriver(string $driver): Network return $this; } + /** + * @param string $scope + * @return Network + */ public function setScope(string $scope): Network { $this->scope = $scope; diff --git a/src/Orchestration/Orchestration.php b/src/Orchestration/Orchestration.php index d6f8f16..bcbb774 100644 --- a/src/Orchestration/Orchestration.php +++ b/src/Orchestration/Orchestration.php @@ -12,6 +12,9 @@ class Orchestration */ protected $adapter; + /** + * @param Adapter $adapter + */ public function __construct(Adapter $adapter) { $this->adapter = $adapter; @@ -27,6 +30,7 @@ public function __construct(Adapter $adapter) * * If there are no spaces detected in the first place it will just return the string as an array. * + * @param string $command * @return (false|string)[] */ public function parseCommandString(string $command): array @@ -75,6 +79,10 @@ public function parseCommandString(string $command): array /** * Create Network + * + * @param string $name + * @param bool $internal + * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -83,6 +91,9 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network + * + * @param string $name + * @return bool */ public function removeNetwork(string $name): bool { @@ -91,6 +102,8 @@ public function removeNetwork(string $name): bool /** * List Networks + * + * @return array */ public function listNetworks(): array { @@ -99,6 +112,10 @@ public function listNetworks(): array /** * Connect a container to a network + * + * @param string $container + * @param string $network + * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -119,6 +136,11 @@ public function getStats(string $container = null, array $filters = []): array /** * Disconnect a container from a network + * + * @param string $container + * @param string $network + * @param bool $force + * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -127,6 +149,9 @@ public function networkDisconnect(string $container, string $network, bool $forc /** * Pull Image + * + * @param string $image + * @return bool */ public function pull(string $image): bool { @@ -150,9 +175,17 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * + * @param string $image + * @param string $name + * @param string $entrypoint * @param string[] $command + * @param string $workdir * @param string[] $volumes * @param array $vars + * @param string $mountFolder + * @param string $hostname + * @param bool $remove + * @return string */ public function run( string $image, @@ -173,8 +206,13 @@ public function run( /** * Execute Container * + * @param string $name * @param string[] $command + * @param string &$stdout + * @param string &$stderr * @param array $vars + * @param int $timeout + * @return bool */ public function execute( string $name, @@ -189,6 +227,10 @@ public function execute( /** * Remove Container + * + * @param string $name + * @param bool $force + * @return bool */ public function remove(string $name, bool $force = false): bool { @@ -198,6 +240,7 @@ public function remove(string $name, bool $force = false): bool /** * Set containers namespace * + * @param string $namespace * @return $this */ public function setNamespace(string $namespace): self @@ -210,6 +253,7 @@ public function setNamespace(string $namespace): self /** * Set max allowed CPU cores per container * + * @param int $cores * @return $this */ public function setCpus(int $cores): self @@ -222,6 +266,7 @@ public function setCpus(int $cores): self /** * Set max allowed memory in mb per container * + * @param int $mb * @return $this */ public function setMemory(int $mb): self @@ -234,6 +279,7 @@ public function setMemory(int $mb): self /** * Set max allowed swap memory in mb per container * + * @param int $mb * @return $this */ public function setSwap(int $mb): self diff --git a/tests/Orchestration/Adapter/DockerAPITest.php b/tests/Orchestration/Adapter/DockerAPITest.php index 26a4f1a..1b94955 100644 --- a/tests/Orchestration/Adapter/DockerAPITest.php +++ b/tests/Orchestration/Adapter/DockerAPITest.php @@ -15,12 +15,17 @@ class DockerAPITest extends Base /** * Return name of adapter + * + * @return string */ public static function getAdapterName(): string { return 'Docker API'; } + /** + * @return Orchestration + */ public static function getOrchestration(): Orchestration { if (! is_null(self::$orchestration)) { diff --git a/tests/Orchestration/Adapter/DockerCLITest.php b/tests/Orchestration/Adapter/DockerCLITest.php index 0f88880..eb2197d 100644 --- a/tests/Orchestration/Adapter/DockerCLITest.php +++ b/tests/Orchestration/Adapter/DockerCLITest.php @@ -15,12 +15,17 @@ class DockerCLITest extends Base /** * Return name of adapter + * + * @return string */ public static function getAdapterName(): string { return 'Docker CLI'; } + /** + * @return Orchestration + */ public static function getOrchestration(): Orchestration { if (! is_null(self::$orchestration)) { diff --git a/tests/Orchestration/Base.php b/tests/Orchestration/Base.php index d540955..7a4255c 100644 --- a/tests/Orchestration/Base.php +++ b/tests/Orchestration/Base.php @@ -7,8 +7,14 @@ abstract class Base extends TestCase { + /** + * @return Orchestration + */ abstract protected static function getOrchestration(): Orchestration; + /** + * @return string + */ abstract protected static function getAdapterName(): string; /** @@ -46,6 +52,7 @@ public function testPullImage(): void } /** + * @return void * @depends testPullImage */ public function testCreateContainer(): void @@ -93,6 +100,7 @@ public function testCreateContainer(): void // Network Tests /** + * @return void * @depends testCreateContainer */ public function testCreateNetwork(): void @@ -103,6 +111,7 @@ public function testCreateNetwork(): void } /** + * @return void * @depends testCreateNetwork */ public function testListNetworks(): void @@ -121,6 +130,7 @@ public function testListNetworks(): void } /** + * @return void * @depends testCreateNetwork */ public function testnetworkConnect(): void @@ -131,6 +141,7 @@ public function testnetworkConnect(): void } /** + * @return void * @depends testnetworkConnect */ public function testnetworkDisconnect(): void @@ -141,6 +152,7 @@ public function testnetworkDisconnect(): void } /** + * @return void * @depends testCreateNetwork */ public function testRemoveNetwork(): void @@ -151,6 +163,7 @@ public function testRemoveNetwork(): void } /** + * @return void * @depends testCreateContainer */ public function testExecContainer(): void @@ -193,6 +206,7 @@ public function testExecContainer(): void } /** + * @return void * @depends testExecContainer */ public function testCheckVolume(): void @@ -214,6 +228,7 @@ public function testCheckVolume(): void } /** + * @return void * @depends testExecContainer */ public function testTimeoutContainer(): void @@ -307,6 +322,7 @@ public function testTimeoutContainer(): void } /** + * @return void * @depends testCreateContainer */ public function testListContainers(): void @@ -325,6 +341,7 @@ public function testListContainers(): void } /** + * @return void * @depends testCreateContainer */ public function testListFilters(): void @@ -335,6 +352,7 @@ public function testListFilters(): void } /** + * @return void * @depends testCreateContainer */ public function testRemoveContainer(): void @@ -430,6 +448,7 @@ public function testRunRemove(): void } /** + * @return void * @depends testPullImage */ public function testUsageStats(): void From 941d08ab739cb67040e1c410b2e059da153141b1 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 7 Mar 2023 11:08:48 +0200 Subject: [PATCH 5/7] composer.lock --- src/Orchestration/Adapter.php | 44 ------------------ src/Orchestration/Adapter/DockerAPI.php | 41 ----------------- src/Orchestration/Adapter/DockerCLI.php | 36 --------------- src/Orchestration/Container.php | 12 ----- src/Orchestration/Container/Stats.php | 4 -- src/Orchestration/Network.php | 34 -------------- src/Orchestration/Orchestration.php | 46 ------------------- tests/Orchestration/Adapter/DockerAPITest.php | 5 -- tests/Orchestration/Adapter/DockerCLITest.php | 5 -- tests/Orchestration/Base.php | 19 -------- 10 files changed, 246 deletions(-) diff --git a/src/Orchestration/Adapter.php b/src/Orchestration/Adapter.php index fa01ee8..5f433c7 100644 --- a/src/Orchestration/Adapter.php +++ b/src/Orchestration/Adapter.php @@ -26,9 +26,6 @@ abstract class Adapter /** * Filter ENV vars - * - * @param string $string - * @return string */ public function filterEnvKey(string $string): string { @@ -37,43 +34,26 @@ public function filterEnvKey(string $string): string /** * Create Network - * - * @param string $name - * @return bool */ abstract public function createNetwork(string $name, bool $internal = false): bool; /** * Remove Network - * - * @param string $name - * @return bool */ abstract public function removeNetwork(string $name): bool; /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ abstract public function networkConnect(string $container, string $network): bool; /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ abstract public function networkDisconnect(string $container, string $network, bool $force = false): bool; /** * List Networks - * - * @return array */ abstract public function listNetworks(): array; @@ -88,9 +68,6 @@ abstract public function getStats(string $container = null, array $filters = []) /** * Pull Image - * - * @param string $image - * @return bool */ abstract public function pull(string $image): bool; @@ -108,17 +85,9 @@ abstract public function list(array $filters = []): array; * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name * @param string[] $command - * @param string $entrypoint - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @param string $hostname - * @param bool $remove - * @return string */ abstract public function run( string $image, @@ -136,29 +105,19 @@ abstract public function run( /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ abstract public function execute(string $name, array $command, string &$stdout, string &$stderr, array $vars = [], int $timeout = -1): bool; /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ abstract public function remove(string $name, bool $force): bool; /** * Set containers namespace * - * @param string $namespace * @return $this */ public function setNamespace(string $namespace): self @@ -171,7 +130,6 @@ public function setNamespace(string $namespace): self /** * Set max allowed CPU cores per container * - * @param int $cores * @return $this */ public function setCpus(int $cores): self @@ -184,7 +142,6 @@ public function setCpus(int $cores): self /** * Set max allowed memory in mb per container * - * @param int $mb * @return $this */ public function setMemory(int $mb): self @@ -197,7 +154,6 @@ public function setMemory(int $mb): self /** * Set max allowed swap memory in mb per container * - * @param int $mb * @return $this */ public function setSwap(int $mb): self diff --git a/src/Orchestration/Adapter/DockerAPI.php b/src/Orchestration/Adapter/DockerAPI.php index a32d916..3ede0d9 100644 --- a/src/Orchestration/Adapter/DockerAPI.php +++ b/src/Orchestration/Adapter/DockerAPI.php @@ -40,11 +40,8 @@ public function __construct(string $username = null, string $password = null, st /** * Create a request with cURL via the Docker socket * - * @param string $url - * @param string $method * @param array|bool|int|float|object|resource|string|null $body * @param string[] $headers - * @param int $timeout * @return (bool|mixed|string)[] * * @psalm-return array{response: mixed, code: mixed} @@ -95,8 +92,6 @@ protected function call(string $url, string $method, $body = null, array $header * Create a request with cURL via the Docker socket * but process a Docker Stream Response * - * @param string $url - * @param int $timeout * @return (bool|mixed|string)[] * * @psalm-return array{response: bool|string, code: mixed, stdout: mixed, stderr: mixed} @@ -179,10 +174,6 @@ protected function streamCall(string $url, int $timeout = -1): array /** * Create Network - * - * @param string $name - * @param bool $internal - * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -205,9 +196,6 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network - * - * @param string $name - * @return bool */ public function removeNetwork(string $name): bool { @@ -222,10 +210,6 @@ public function removeNetwork(string $name): bool /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -247,11 +231,6 @@ public function networkConnect(string $container, string $network): bool /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -328,8 +307,6 @@ public function getStats(string $container = null, array $filters = []): array /** * List Networks - * - * @return array */ public function listNetworks(): array { @@ -359,9 +336,6 @@ public function listNetworks(): array /** * Pull Image - * - * @param string $image - * @return bool */ public function pull(string $image): bool { @@ -427,15 +401,9 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name * @param string[] $command - * @param string $entrypoint - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @return string */ public function run( string $image, @@ -509,13 +477,8 @@ public function run( /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ public function execute( string $name, @@ -566,10 +529,6 @@ public function execute( /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ public function remove(string $name, bool $force = false): bool { diff --git a/src/Orchestration/Adapter/DockerCLI.php b/src/Orchestration/Adapter/DockerCLI.php index 1694753..024a9aa 100644 --- a/src/Orchestration/Adapter/DockerCLI.php +++ b/src/Orchestration/Adapter/DockerCLI.php @@ -33,10 +33,6 @@ public function __construct(string $username = null, string $password = null) /** * Create Network - * - * @param string $name - * @param bool $internal - * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -50,9 +46,6 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network - * - * @param string $name - * @return bool */ public function removeNetwork(string $name): bool { @@ -66,10 +59,6 @@ public function removeNetwork(string $name): bool /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -83,11 +72,6 @@ public function networkConnect(string $container, string $network): bool /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -214,8 +198,6 @@ private function parseIOStats(string $stats) /** * List Networks - * - * @return array */ public function listNetworks(): array { @@ -248,9 +230,6 @@ public function listNetworks(): array /** * Pull Image - * - * @param string $image - * @return bool */ public function pull(string $image): bool { @@ -322,15 +301,9 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name * @param string[] $command - * @param string $entrypoint - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @return string */ public function run(string $image, string $name, @@ -413,13 +386,8 @@ public function run(string $image, /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ public function execute( string $name, @@ -461,10 +429,6 @@ public function execute( /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ public function remove(string $name, bool $force = false): bool { diff --git a/src/Orchestration/Container.php b/src/Orchestration/Container.php index 65dc174..7d7ce64 100644 --- a/src/Orchestration/Container.php +++ b/src/Orchestration/Container.php @@ -5,9 +5,6 @@ class Container { /** - * @param string $name - * @param string $id - * @param string $status * @param array $labels */ public function __construct(string $name = '', string $id = '', string $status = '', array $labels = []) @@ -40,8 +37,6 @@ public function __construct(string $name = '', string $id = '', string $status = /** * Get the container's name - * - * @return string */ public function getName(): string { @@ -50,8 +45,6 @@ public function getName(): string /** * Get the container's ID - * - * @return string */ public function getId(): string { @@ -60,8 +53,6 @@ public function getId(): string /** * Get the container's status - * - * @return string */ public function getStatus(): string { @@ -81,7 +72,6 @@ public function getLabels(): array /** * Set the container's name * - * @param string $name * @return $this */ public function setName(string $name): self @@ -94,7 +84,6 @@ public function setName(string $name): self /** * Set the container's id * - * @param string $id * @return $this */ public function setId(string $id): self @@ -107,7 +96,6 @@ public function setId(string $id): self /** * Set the container's status * - * @param string $status * @return $this */ public function setStatus(string $status): self diff --git a/src/Orchestration/Container/Stats.php b/src/Orchestration/Container/Stats.php index 4580648..b63701b 100644 --- a/src/Orchestration/Container/Stats.php +++ b/src/Orchestration/Container/Stats.php @@ -28,10 +28,6 @@ class Stats protected array $networkIO; /** - * @param string $containerId - * @param string $containerName - * @param float $cpuUsage - * @param float $memoryUsage * @param array $diskIO * @param array $memoryIO * @param array $networkIO diff --git a/src/Orchestration/Network.php b/src/Orchestration/Network.php index b51d8e3..9f8cffa 100644 --- a/src/Orchestration/Network.php +++ b/src/Orchestration/Network.php @@ -24,12 +24,6 @@ class Network */ protected $scope; - /** - * @param string $name - * @param string $id - * @param string $driver - * @param string $scope - */ public function __construct(string $name = '', string $id = '', string $driver = '', string $scope = '') { $this->name = $name; @@ -38,42 +32,26 @@ public function __construct(string $name = '', string $id = '', string $driver = $this->scope = $scope; } - /** - * @return string - */ public function getName(): string { return $this->name; } - /** - * @return string - */ public function getId(): string { return $this->id; } - /** - * @return string - */ public function getDriver(): string { return $this->driver; } - /** - * @return string - */ public function getScope(): string { return $this->scope; } - /** - * @param string $name - * @return Network - */ public function setName(string $name): Network { $this->name = $name; @@ -81,10 +59,6 @@ public function setName(string $name): Network return $this; } - /** - * @param string $id - * @return Network - */ public function setId(string $id): Network { $this->id = $id; @@ -92,10 +66,6 @@ public function setId(string $id): Network return $this; } - /** - * @param string $driver - * @return Network - */ public function setDriver(string $driver): Network { $this->driver = $driver; @@ -103,10 +73,6 @@ public function setDriver(string $driver): Network return $this; } - /** - * @param string $scope - * @return Network - */ public function setScope(string $scope): Network { $this->scope = $scope; diff --git a/src/Orchestration/Orchestration.php b/src/Orchestration/Orchestration.php index bcbb774..d6f8f16 100644 --- a/src/Orchestration/Orchestration.php +++ b/src/Orchestration/Orchestration.php @@ -12,9 +12,6 @@ class Orchestration */ protected $adapter; - /** - * @param Adapter $adapter - */ public function __construct(Adapter $adapter) { $this->adapter = $adapter; @@ -30,7 +27,6 @@ public function __construct(Adapter $adapter) * * If there are no spaces detected in the first place it will just return the string as an array. * - * @param string $command * @return (false|string)[] */ public function parseCommandString(string $command): array @@ -79,10 +75,6 @@ public function parseCommandString(string $command): array /** * Create Network - * - * @param string $name - * @param bool $internal - * @return bool */ public function createNetwork(string $name, bool $internal = false): bool { @@ -91,9 +83,6 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network - * - * @param string $name - * @return bool */ public function removeNetwork(string $name): bool { @@ -102,8 +91,6 @@ public function removeNetwork(string $name): bool /** * List Networks - * - * @return array */ public function listNetworks(): array { @@ -112,10 +99,6 @@ public function listNetworks(): array /** * Connect a container to a network - * - * @param string $container - * @param string $network - * @return bool */ public function networkConnect(string $container, string $network): bool { @@ -136,11 +119,6 @@ public function getStats(string $container = null, array $filters = []): array /** * Disconnect a container from a network - * - * @param string $container - * @param string $network - * @param bool $force - * @return bool */ public function networkDisconnect(string $container, string $network, bool $force = false): bool { @@ -149,9 +127,6 @@ public function networkDisconnect(string $container, string $network, bool $forc /** * Pull Image - * - * @param string $image - * @return bool */ public function pull(string $image): bool { @@ -175,17 +150,9 @@ public function list(array $filters = []): array * Creates and runs a new container, On success it will return a string containing the container ID. * On fail it will throw an exception. * - * @param string $image - * @param string $name - * @param string $entrypoint * @param string[] $command - * @param string $workdir * @param string[] $volumes * @param array $vars - * @param string $mountFolder - * @param string $hostname - * @param bool $remove - * @return string */ public function run( string $image, @@ -206,13 +173,8 @@ public function run( /** * Execute Container * - * @param string $name * @param string[] $command - * @param string &$stdout - * @param string &$stderr * @param array $vars - * @param int $timeout - * @return bool */ public function execute( string $name, @@ -227,10 +189,6 @@ public function execute( /** * Remove Container - * - * @param string $name - * @param bool $force - * @return bool */ public function remove(string $name, bool $force = false): bool { @@ -240,7 +198,6 @@ public function remove(string $name, bool $force = false): bool /** * Set containers namespace * - * @param string $namespace * @return $this */ public function setNamespace(string $namespace): self @@ -253,7 +210,6 @@ public function setNamespace(string $namespace): self /** * Set max allowed CPU cores per container * - * @param int $cores * @return $this */ public function setCpus(int $cores): self @@ -266,7 +222,6 @@ public function setCpus(int $cores): self /** * Set max allowed memory in mb per container * - * @param int $mb * @return $this */ public function setMemory(int $mb): self @@ -279,7 +234,6 @@ public function setMemory(int $mb): self /** * Set max allowed swap memory in mb per container * - * @param int $mb * @return $this */ public function setSwap(int $mb): self diff --git a/tests/Orchestration/Adapter/DockerAPITest.php b/tests/Orchestration/Adapter/DockerAPITest.php index 1b94955..26a4f1a 100644 --- a/tests/Orchestration/Adapter/DockerAPITest.php +++ b/tests/Orchestration/Adapter/DockerAPITest.php @@ -15,17 +15,12 @@ class DockerAPITest extends Base /** * Return name of adapter - * - * @return string */ public static function getAdapterName(): string { return 'Docker API'; } - /** - * @return Orchestration - */ public static function getOrchestration(): Orchestration { if (! is_null(self::$orchestration)) { diff --git a/tests/Orchestration/Adapter/DockerCLITest.php b/tests/Orchestration/Adapter/DockerCLITest.php index eb2197d..0f88880 100644 --- a/tests/Orchestration/Adapter/DockerCLITest.php +++ b/tests/Orchestration/Adapter/DockerCLITest.php @@ -15,17 +15,12 @@ class DockerCLITest extends Base /** * Return name of adapter - * - * @return string */ public static function getAdapterName(): string { return 'Docker CLI'; } - /** - * @return Orchestration - */ public static function getOrchestration(): Orchestration { if (! is_null(self::$orchestration)) { diff --git a/tests/Orchestration/Base.php b/tests/Orchestration/Base.php index 7a4255c..d540955 100644 --- a/tests/Orchestration/Base.php +++ b/tests/Orchestration/Base.php @@ -7,14 +7,8 @@ abstract class Base extends TestCase { - /** - * @return Orchestration - */ abstract protected static function getOrchestration(): Orchestration; - /** - * @return string - */ abstract protected static function getAdapterName(): string; /** @@ -52,7 +46,6 @@ public function testPullImage(): void } /** - * @return void * @depends testPullImage */ public function testCreateContainer(): void @@ -100,7 +93,6 @@ public function testCreateContainer(): void // Network Tests /** - * @return void * @depends testCreateContainer */ public function testCreateNetwork(): void @@ -111,7 +103,6 @@ public function testCreateNetwork(): void } /** - * @return void * @depends testCreateNetwork */ public function testListNetworks(): void @@ -130,7 +121,6 @@ public function testListNetworks(): void } /** - * @return void * @depends testCreateNetwork */ public function testnetworkConnect(): void @@ -141,7 +131,6 @@ public function testnetworkConnect(): void } /** - * @return void * @depends testnetworkConnect */ public function testnetworkDisconnect(): void @@ -152,7 +141,6 @@ public function testnetworkDisconnect(): void } /** - * @return void * @depends testCreateNetwork */ public function testRemoveNetwork(): void @@ -163,7 +151,6 @@ public function testRemoveNetwork(): void } /** - * @return void * @depends testCreateContainer */ public function testExecContainer(): void @@ -206,7 +193,6 @@ public function testExecContainer(): void } /** - * @return void * @depends testExecContainer */ public function testCheckVolume(): void @@ -228,7 +214,6 @@ public function testCheckVolume(): void } /** - * @return void * @depends testExecContainer */ public function testTimeoutContainer(): void @@ -322,7 +307,6 @@ public function testTimeoutContainer(): void } /** - * @return void * @depends testCreateContainer */ public function testListContainers(): void @@ -341,7 +325,6 @@ public function testListContainers(): void } /** - * @return void * @depends testCreateContainer */ public function testListFilters(): void @@ -352,7 +335,6 @@ public function testListFilters(): void } /** - * @return void * @depends testCreateContainer */ public function testRemoveContainer(): void @@ -448,7 +430,6 @@ public function testRunRemove(): void } /** - * @return void * @depends testPullImage */ public function testUsageStats(): void From cb766a5cae84fdc11d610ea2fdf2e642bccd4474 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 7 Mar 2023 12:54:04 +0200 Subject: [PATCH 6/7] composer.lock --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fca9c5e..9cc367e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/orchestration.svg) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord) -Utopia framework orchestration library is simple and lite library for abstracting the interaction with multiple container orchestrators. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io). +Utopia framework orchestration library is simple and lite library for abstracting the interaction with multiple container orchestrators. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io). Although this library is part of the [Utopia Framework](https://github.com/utopia-php/framework) project it is dependency free and can be used as standalone with any other PHP project or framework. From c014846d54c5efb8f24a7250bc67a43fbcab7f64 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 7 Mar 2023 13:01:20 +0200 Subject: [PATCH 7/7] composer.lock --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cc367e..fca9c5e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![Total Downloads](https://img.shields.io/packagist/dt/utopia-php/orchestration.svg) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord)](https://appwrite.io/discord) -Utopia framework orchestration library is simple and lite library for abstracting the interaction with multiple container orchestrators. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io). +Utopia framework orchestration library is simple and lite library for abstracting the interaction with multiple container orchestrators. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io). Although this library is part of the [Utopia Framework](https://github.com/utopia-php/framework) project it is dependency free and can be used as standalone with any other PHP project or framework.