Skip to content

Commit efc38fc

Browse files
authored
Merge pull request #27 from laudis-technologies/debug
Fixes #14 Accepts stringable parameters
2 parents 2e280c1 + 1f5e0a5 commit efc38fc

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/Network/Bolt/BoltDriver.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ public function aquireSession(): SessionInterface
5555
return $this->session;
5656
}
5757

58-
$url = $this->parsedUrl['host'];
59-
$isIP = (bool) ip2long($url);
60-
if (!$isIP) {
61-
$ip = gethostbyname($url);
62-
} else {
63-
$ip = $url;
64-
}
65-
$this->parsedUrl['host'] = $ip;
6658
try {
6759
$sock = new StreamSocket($this->parsedUrl['host'], $this->parsedUrl['port'] ?? self::DEFAULT_TCP_PORT);
6860
$options = $this->injections->sslContextOptions();

tests/Unit/ParameterHelperTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,11 @@ public function __toString(): string
146146
});
147147
self::assertEquals('abc', $result);
148148
}
149+
150+
public function testInvalidType(): void
151+
{
152+
$this->expectException(InvalidArgumentException::class);
153+
$this->expectExceptionMessage('Parameters must be iterable, scalar, null or stringable');
154+
ParameterHelper::asParameter(new stdClass());
155+
}
149156
}

0 commit comments

Comments
 (0)