Skip to content

Commit f5718c9

Browse files
author
awu
committed
fix: phpstan adjustment for cast to int in WaitForHttp and sanitize output
1 parent 6dbab2f commit f5718c9

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/Container/StartedGenericContainer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ public function logs(): string
9898
?->getBody()
9999
->getContents() ?? '';
100100

101+
/**
102+
* @var string|false $converted
103+
*/
101104
$converted = mb_convert_encoding($output, 'UTF-8', 'UTF-8');
102105
return $this->sanitizeOutput($converted === false ? $output : $converted);
103106
}

src/Wait/WaitForHttp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function wait(StartedTestContainer $container): void
104104
$this->resolvePort($container);
105105
$containerAddress = $container->getHost();
106106

107-
$url = sprintf('%s://%s:%d%s', $this->protocol, $containerAddress, $container->getMappedPort($this->port), $this->path);
107+
$url = sprintf('%s://%s:%d%s', $this->protocol, $containerAddress, $container->getMappedPort((int) $this->port), $this->path);
108108
$responseCode = $this->makeHttpRequest($url);
109109

110110
if ($responseCode === $this->expectedStatusCode) {

0 commit comments

Comments
 (0)