Total Complexity | 3 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
26 | class BearerToken |
||
27 | { |
||
28 | const CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._"; |
||
29 | const LENGTH = 16; |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $token; |
||
34 | |||
35 | public function __construct(string $token) |
||
36 | { |
||
37 | $this->token = $token; |
||
38 | } |
||
39 | |||
40 | static function generate($length = self::LENGTH) |
||
47 | } |
||
48 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.