We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f3085f commit 25ece31Copy full SHA for 25ece31
src/Bolt.php
@@ -61,7 +61,9 @@ public function build(): AProtocol
61
*/
62
public function setProtocolVersions(...$v): Bolt
63
{
64
- $this->versions = $v;
+ $this->versions = array_slice($v, 0, 4);
65
+ while (count($this->versions) < 4)
66
+ $this->versions[] = 0;
67
return $this;
68
}
69
@@ -135,10 +137,7 @@ private function packProtocolVersions(): string
135
137
136
138
$versions = [];
139
- while (count($this->versions) < 4)
- $this->versions[] = '0';
140
-
141
- foreach (array_slice($this->versions, 0, 4) as $v) {
+ foreach ($this->versions as $v) {
142
if (is_int($v))
143
$versions[] = pack('N', $v);
144
else {
0 commit comments