Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert: CLI version #58

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"require": {
"php": ">=8.0",
"utopia-php/cli": "0.19.*"
"utopia-php/cli": "0.16.*"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
Expand Down
150 changes: 23 additions & 127 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
}
3 changes: 2 additions & 1 deletion src/Orchestration/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Orchestration/Adapter/DockerAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion src/Orchestration/Adapter/DockerCLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ public function list(array $filters = []): array
* @param array<string, string> $vars
* @param array<string, string> $labels
*/
public function run(string $image,
public function run(
string $image,
string $name,
array $command = [],
string $entrypoint = '',
Expand Down
4 changes: 3 additions & 1 deletion src/Orchestration/Exception/Orchestration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

namespace Utopia\Orchestration\Exception;

class Orchestration extends \Exception {}
class Orchestration extends \Exception
{
}
4 changes: 3 additions & 1 deletion src/Orchestration/Exception/Timeout.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

namespace Utopia\Orchestration\Exception;

class Timeout extends \Exception {}
class Timeout extends \Exception
{
}
2 changes: 1 addition & 1 deletion tests/Orchestration/Adapter/DockerAPITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Orchestration/Adapter/DockerCLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down