mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-18 16:37:43 +03:00
add typehints and return types
This commit is contained in:
committed by
Ben Ramsey
parent
3a42c259a7
commit
5459113b81
@@ -29,7 +29,7 @@ class OrderedTimeCodec extends StringCodec
|
||||
* @param UuidInterface $uuid
|
||||
* @return string Binary string representation of a UUID
|
||||
*/
|
||||
public function encodeBinary(UuidInterface $uuid)
|
||||
public function encodeBinary(UuidInterface $uuid): string
|
||||
{
|
||||
$fields = $uuid->getFieldsHex();
|
||||
|
||||
@@ -52,7 +52,7 @@ class OrderedTimeCodec extends StringCodec
|
||||
* @return UuidInterface
|
||||
* @throws InvalidArgumentException if string has not 16 characters
|
||||
*/
|
||||
public function decodeBytes($bytes)
|
||||
public function decodeBytes(string $bytes): UuidInterface
|
||||
{
|
||||
if (strlen($bytes) !== 16) {
|
||||
throw new InvalidArgumentException('$bytes string should contain 16 characters.');
|
||||
|
||||
Reference in New Issue
Block a user