From 4b0ea7991d9494f11ff99b366bb816c7a8324fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 26 Nov 2024 10:11:35 +0000 Subject: [PATCH] Fix formatting --- pint.json | 18 ++++++++++++++++++ src/Orchestration/Adapter.php | 3 ++- src/Orchestration/Adapter/DockerAPI.php | 2 +- src/Orchestration/Adapter/DockerCLI.php | 3 ++- src/Orchestration/Exception/Orchestration.php | 4 +++- src/Orchestration/Exception/Timeout.php | 4 +++- tests/Orchestration/Adapter/DockerAPITest.php | 2 +- tests/Orchestration/Adapter/DockerCLITest.php | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 pint.json 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; }