Skip to content

Commit 895ede7

Browse files
typo
1 parent 6f6aa8e commit 895ede7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/protocol/v6/structures/Vector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __toString(): string
2727
return json_encode([(string)$this->type_marker, (string)$this->data]);
2828
}
2929

30-
private static array $endianesFormats = ['s', 'l', 'q'];
30+
private static array $endiannessFormats = ['s', 'l', 'q'];
3131

3232
/**
3333
* Encode array as vector structure
@@ -86,7 +86,7 @@ public static function encode(array $data, ?TypeMarker $type = null): self
8686
$littleEndian = unpack('S', "\x01\x00")[1] === 1;
8787
foreach ($data as $entry) {
8888
$value = pack($packFormat, $anyFloat ? (float)$entry : (int)$entry);
89-
$packed[] = in_array($packFormat, self::$endianesFormats) && $littleEndian ? strrev($value) : $value;
89+
$packed[] = in_array($packFormat, self::$endiannessFormats) && $littleEndian ? strrev($value) : $value;
9090
}
9191

9292
return new self(new Bytes([chr($type->value)]), new Bytes($packed));
@@ -131,7 +131,7 @@ public function decode(): array
131131
$output = [];
132132
$littleEndian = unpack('S', "\x01\x00")[1] === 1;
133133
foreach(mb_str_split((string)$this->data, $size, '8bit') as $value) {
134-
$output[] = unpack($unpackFormat, in_array($unpackFormat, self::$endianesFormats) && $littleEndian ? strrev($value) : $value)[1];
134+
$output[] = unpack($unpackFormat, in_array($unpackFormat, self::$endiannessFormats) && $littleEndian ? strrev($value) : $value)[1];
135135
}
136136

137137
return $output;

0 commit comments

Comments
 (0)