diff --git a/composer.json b/composer.json index 3dcd933..4160b5e 100755 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": ">=8.0", - "utopia-php/cli": "0.19.*" + "utopia-php/cli": "0.16.*" }, "require-dev": { "phpunit/phpunit": "^9.3", diff --git a/composer.lock b/composer.lock index e41dcbf..ede4faa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,33 +4,31 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "981afa1d268dd00d4f47a3e027193a7c", + "content-hash": "48c2bbcd6ef1dc35e86875383889ffa9", "packages": [ { "name": "utopia-php/cli", - "version": "0.19.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cli.git", - "reference": "f8af1d6087f498bc1f0191750a118d357ded9948" + "reference": "5b936638c90c86d1bae83d0dbe81fe14d12ff8ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cli/zipball/f8af1d6087f498bc1f0191750a118d357ded9948", - "reference": "f8af1d6087f498bc1f0191750a118d357ded9948", + "url": "https://api.github.com/repos/utopia-php/cli/zipball/5b936638c90c86d1bae83d0dbe81fe14d12ff8ff", + "reference": "5b936638c90c86d1bae83d0dbe81fe14d12ff8ff", "shasum": "" }, "require": { "php": ">=7.4", - "utopia-php/di": "0.1.*", - "utopia-php/framework": "1.0.*" + "utopia-php/framework": "0.*.*" }, "require-dev": { "laravel/pint": "1.2.*", - "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.6", - "swoole/ide-helper": "4.8.8" + "vimeo/psalm": "4.0.1" }, "type": "library", "autoload": { @@ -53,79 +51,29 @@ ], "support": { "issues": "https://github.com/utopia-php/cli/issues", - "source": "https://github.com/utopia-php/cli/tree/0.19.0" - }, - "time": "2024-09-05T15:46:56+00:00" - }, - { - "name": "utopia-php/di", - "version": "0.1.0", - "source": { - "type": "git", - "url": "https://github.com/utopia-php/di.git", - "reference": "22490c95f7ac3898ed1c33f1b1b5dd577305ee31" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/utopia-php/di/zipball/22490c95f7ac3898ed1c33f1b1b5dd577305ee31", - "reference": "22490c95f7ac3898ed1c33f1b1b5dd577305ee31", - "shasum": "" - }, - "require": { - "php": ">=8.2" - }, - "require-dev": { - "laravel/pint": "^1.2", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.5.25", - "swoole/ide-helper": "4.8.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Utopia\\": "src/", - "Tests\\E2E\\": "tests/e2e" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A simple and lite library for managing dependency injections", - "keywords": [ - "framework", - "http", - "php", - "upf" - ], - "support": { - "issues": "https://github.com/utopia-php/di/issues", - "source": "https://github.com/utopia-php/di/tree/0.1.0" + "source": "https://github.com/utopia-php/cli/tree/0.16.0" }, - "time": "2024-08-08T14:35:19+00:00" + "time": "2023-08-05T13:13:08+00:00" }, { "name": "utopia-php/framework", - "version": "1.0.2", + "version": "0.34.3", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "fc63ec61c720190a5ea5bb484c615145850951e6" + "reference": "e3bbca07c1df4e908ea9d3ce4f59367a7696b66b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/fc63ec61c720190a5ea5bb484c615145850951e6", - "reference": "fc63ec61c720190a5ea5bb484c615145850951e6", + "url": "https://api.github.com/repos/utopia-php/http/zipball/e3bbca07c1df4e908ea9d3ce4f59367a7696b66b", + "reference": "e3bbca07c1df4e908ea9d3ce4f59367a7696b66b", "shasum": "" }, "require": { "ext-swoole": "*", - "php": ">=8.0", - "utopia-php/servers": "0.1.*" + "php": ">=8.0" }, "require-dev": { - "ext-xdebug": "*", "laravel/pint": "^1.2", "phpbench/phpbench": "^1.2", "phpstan/phpstan": "^1.10", @@ -135,7 +83,8 @@ "type": "library", "autoload": { "psr-4": { - "Utopia\\": "src/" + "Utopia\\": "src/", + "Tests\\E2E\\": "tests/e2e" } }, "notification-url": "https://packagist.org/downloads/", @@ -151,62 +100,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/1.0.2" - }, - "time": "2024-09-10T09:04:19+00:00" - }, - { - "name": "utopia-php/servers", - "version": "0.1.1", - "source": { - "type": "git", - "url": "https://github.com/utopia-php/servers.git", - "reference": "fd5c8d32778f265256c1936372a071b944f5ba8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/utopia-php/servers/zipball/fd5c8d32778f265256c1936372a071b944f5ba8a", - "reference": "fd5c8d32778f265256c1936372a071b944f5ba8a", - "shasum": "" - }, - "require": { - "php": ">=8.0", - "utopia-php/di": "0.1.*" - }, - "require-dev": { - "laravel/pint": "^0.2.3", - "phpstan/phpstan": "^1.8", - "phpunit/phpunit": "^9.5.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Utopia\\Servers\\": "src/Servers" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Team Appwrite", - "email": "team@appwrite.io" - } - ], - "description": "A base library for building Utopia style servers.", - "keywords": [ - "framework", - "php", - "servers", - "upf", - "utopia" - ], - "support": { - "issues": "https://github.com/utopia-php/servers/issues", - "source": "https://github.com/utopia-php/servers/tree/0.1.1" + "source": "https://github.com/utopia-php/http/tree/0.34.3" }, - "time": "2024-09-06T02:25:56+00:00" + "time": "2024-07-02T15:08:46+00:00" } ], "packages-dev": [ @@ -282,16 +178,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.1", + "version": "v1.18.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", "shasum": "" }, "require": { @@ -344,7 +240,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-09-24T17:22:50+00:00" + "time": "2024-11-20T09:33:46+00:00" }, { "name": "myclabs/deep-copy", diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..42a7861 --- /dev/null +++ b/pint.json @@ -0,0 +1,18 @@ +{ + "preset": "psr12", + "exclude": [ + ], + "rules": { + "array_indentation": true, + "single_import_per_statement": true, + "simplified_null_return": true, + "ordered_imports": { + "sort_algorithm": "alpha", + "imports_order": [ + "const", + "class", + "function" + ] + } + } +} diff --git a/src/Orchestration/Adapter.php b/src/Orchestration/Adapter.php index 9f62aba..c4cfd56 100644 --- a/src/Orchestration/Adapter.php +++ b/src/Orchestration/Adapter.php @@ -117,7 +117,8 @@ abstract public function run( string $hostname = '', bool $remove = false, string $network = '', - string $restart = self::RESTART_NO): string; + string $restart = self::RESTART_NO + ): string; /** * Execute Container diff --git a/src/Orchestration/Adapter/DockerAPI.php b/src/Orchestration/Adapter/DockerAPI.php index e5e76c9..0622719 100644 --- a/src/Orchestration/Adapter/DockerAPI.php +++ b/src/Orchestration/Adapter/DockerAPI.php @@ -445,7 +445,7 @@ public function list(array $filters = []): array $body = [ 'all' => true, - 'filters' => empty($filtersSorted) ? new stdClass : json_encode($filtersSorted), + 'filters' => empty($filtersSorted) ? new stdClass() : json_encode($filtersSorted), ]; $result = $this->call('http://localhost/containers/json'.'?'.\http_build_query($body), 'GET'); diff --git a/src/Orchestration/Adapter/DockerCLI.php b/src/Orchestration/Adapter/DockerCLI.php index dcb81c6..30663d2 100644 --- a/src/Orchestration/Adapter/DockerCLI.php +++ b/src/Orchestration/Adapter/DockerCLI.php @@ -306,7 +306,8 @@ public function list(array $filters = []): array * @param array $vars * @param array $labels */ - public function run(string $image, + public function run( + string $image, string $name, array $command = [], string $entrypoint = '', diff --git a/src/Orchestration/Exception/Orchestration.php b/src/Orchestration/Exception/Orchestration.php index 53fd57a..08b8349 100644 --- a/src/Orchestration/Exception/Orchestration.php +++ b/src/Orchestration/Exception/Orchestration.php @@ -2,4 +2,6 @@ namespace Utopia\Orchestration\Exception; -class Orchestration extends \Exception {} +class Orchestration extends \Exception +{ +} diff --git a/src/Orchestration/Exception/Timeout.php b/src/Orchestration/Exception/Timeout.php index 2340ce1..4a3c792 100644 --- a/src/Orchestration/Exception/Timeout.php +++ b/src/Orchestration/Exception/Timeout.php @@ -2,4 +2,6 @@ namespace Utopia\Orchestration\Exception; -class Timeout extends \Exception {} +class Timeout extends \Exception +{ +} diff --git a/tests/Orchestration/Adapter/DockerAPITest.php b/tests/Orchestration/Adapter/DockerAPITest.php index bc0cada..c10ecd3 100644 --- a/tests/Orchestration/Adapter/DockerAPITest.php +++ b/tests/Orchestration/Adapter/DockerAPITest.php @@ -27,7 +27,7 @@ public static function getOrchestration(): Orchestration return self::$orchestration; } - $orchestration = new Orchestration(new DockerAPI); + $orchestration = new Orchestration(new DockerAPI()); return self::$orchestration = $orchestration; } diff --git a/tests/Orchestration/Adapter/DockerCLITest.php b/tests/Orchestration/Adapter/DockerCLITest.php index 562d92d..214e53c 100644 --- a/tests/Orchestration/Adapter/DockerCLITest.php +++ b/tests/Orchestration/Adapter/DockerCLITest.php @@ -27,7 +27,7 @@ public static function getOrchestration(): Orchestration return self::$orchestration; } - $orchestration = new Orchestration(new DockerCLI); + $orchestration = new Orchestration(new DockerCLI()); return self::$orchestration = $orchestration; }