Skip to content

Commit

Permalink
Fix php incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Sep 7, 2023
1 parent c96a7d6 commit 7ce2c39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/N98/Util/Unicode/Charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class Charset
* @param int|array $codes
* @return string
*/
public static function convertInteger($codes)
public static function convertInteger(...$codes)
{
if (is_scalar($codes)) {
$codes = func_get_args();
if (count($codes) === 1 && is_array($codes[0])) {
$codes = $codes[0];
}

$str = '';
Expand Down
8 changes: 8 additions & 0 deletions tests/N98/Util/Unicode/CharsetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@ public function testConvertInteger()
{
$this->assertEquals('', Charset::convertInteger(Charset::UNICODE_CROSS_CHAR));
$this->assertEquals('', Charset::convertInteger(Charset::UNICODE_CHECKMARK_CHAR));
$this->assertEquals(
'✔✖',
Charset::convertInteger(Charset::UNICODE_CHECKMARK_CHAR, Charset::UNICODE_CROSS_CHAR)
);
$this->assertEquals(
'✖✔',
Charset::convertInteger([Charset::UNICODE_CROSS_CHAR, Charset::UNICODE_CHECKMARK_CHAR])
);
}
}

0 comments on commit 7ce2c39

Please sign in to comment.