Skip to content

Commit

Permalink
Remove unused method EncodeUtil::fromBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
yethee committed Apr 30, 2024
1 parent 3938fbe commit eca2f88
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
<file src="src/Util/EncodeUtil.php">
<LessSpecificReturnStatement>
<code><![CDATA[array_map(hexdec(...), str_split(bin2hex($text), 2))]]></code>
<code><![CDATA[pack('C*', ...$bytes)]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code><![CDATA[NonEmptyByteVector]]></code>
<code><![CDATA[non-empty-string]]></code>
</MoreSpecificReturnType>
</file>
<file src="tests/Benchmark/EncoderBench.php">
Expand Down
11 changes: 0 additions & 11 deletions src/Util/EncodeUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use function array_map;
use function bin2hex;
use function hexdec;
use function pack;
use function str_split;

/** @psalm-type NonEmptyByteVector = non-empty-list<int<0, 255>> */
Expand All @@ -22,14 +21,4 @@ public static function toBytes(string $text): array
{
return array_map(hexdec(...), str_split(bin2hex($text), 2));
}

/**
* @psalm-param NonEmptyByteVector $bytes
*
* @return non-empty-string
*/
public static function fromBytes(array $bytes): string
{
return pack('C*', ...$bytes);
}
}

0 comments on commit eca2f88

Please sign in to comment.