add typehints and return types

This commit is contained in:
Massimiliano Arione
2019-09-12 15:47:49 +02:00
committed by Ben Ramsey
parent 3a42c259a7
commit 5459113b81
34 changed files with 185 additions and 175 deletions
+2 -2
View File
@@ -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.');