Issues (7)

src/Support/Base58.php (2 issues)

1
<?php
2
3
namespace mattvb91\TronTrx\Support;
4
5
/**
6
 * @codeCoverageIgnore
7
 */
8
class Base58
9
{
10
    const AVAILABLE_CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
11
12
    public static function encode($num, $length = 58): string
13
    {
14
        return Crypto::dec2base($num, $length, self::AVAILABLE_CHARS);
0 ignored issues
show
Bug Best Practice introduced by
The expression return mattvb91\TronTrx\... self::AVAILABLE_CHARS) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
15
    }
16
17
    public static function decode(string $addr, int $length = 58): string
18
    {
19
        return Crypto::base2dec($addr, $length, self::AVAILABLE_CHARS);
0 ignored issues
show
Bug Best Practice introduced by
The expression return mattvb91\TronTrx\... self::AVAILABLE_CHARS) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
20
    }
21
}
22