update interfaces, small phpstan improvements

This commit is contained in:
Sergei Shitikov
2024-12-28 18:57:23 +01:00
parent e663bbfbcc
commit 774743a7ce
4 changed files with 57 additions and 36 deletions
+30 -8
View File
@@ -4,18 +4,13 @@ declare(strict_types=1);
namespace Testcontainers\Container;
use Testcontainers\Utils\PortGenerator\PortGenerator;
use Testcontainers\Wait\WaitStrategy;
interface TestContainer
{
public function start(): StartedGenericContainer;
/**
* TODO: replace with array after deprecated implementation is removed
* @param array<string, string>|string $env
*/
public function withEnvironment(array | string $env, ?string $value): static;
/**
* @param array<string> $command
*/
@@ -23,12 +18,39 @@ interface TestContainer
public function withEntrypoint(string $entryPoint): static;
/**
* TODO: replace with array after deprecated implementation is removed
* @param array<string, string>|string $env
*/
public function withEnvironment(array | string $env, ?string $value): static;
/** @param int|string|array<int|string> $ports One or more ports to expose. */
public function withExposedPorts(...$ports): static;
public function withWait(WaitStrategy $waitStrategy): static;
public function withHealthCheckCommand(
string $command,
int $intervalInMilliseconds,
int $timeoutInMilliseconds,
int $retries,
int $startPeriodInMilliseconds
): static;
public function withHostname(string $hostname): static;
/**
* @param array<string, string> $labels
*/
public function withLabels(array $labels): static;
public function withMount(string $localPath, string $containerPath): static;
public function withName(string $name): static;
public function withNetwork(string $networkName): static;
public function withPrivilegedMode(): static;
public function withPortGenerator(PortGenerator $portGenerator): static;
public function withPrivilegedMode(bool $privileged): static;
public function withWait(WaitStrategy $waitStrategy): static;
}