diff --git a/composer.json b/composer.json index 63b4f03..d08cc94 100644 --- a/composer.json +++ b/composer.json @@ -68,8 +68,8 @@ "lint": "parallel-lint src tests", "phpcs": "phpcs src tests --standard=psr2 -sp --colors", "phpstan": [ - "phpstan analyse -c phpstan.neon src --level 2 --no-progress", - "phpstan analyse -c phpstan-tests.neon tests --level 2 --no-progress" + "phpstan analyse -c phpstan.neon src --level max --no-progress", + "phpstan analyse -c phpstan-tests.neon tests --level 5 --no-progress" ], "phpunit": "phpunit --verbose --colors=always", "phpunit-coverage": "phpunit --verbose --colors=always --coverage-html build/coverage", diff --git a/phpstan.neon b/phpstan.neon index e574e17..24bd048 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,3 +1,17 @@ parameters: + checkMissingIterableValueType: false autoload_files: - tests/phpstan-bootstrap.php + ignoreErrors: + - + message: "#^Negated boolean expression is always false\\.$#" + count: 1 + path: src/Uuid.php + - + message: '#^Comparison operation "<" between int<6, max> and 0 is always false\.$#' + count: 1 + path: src/Generator/CombGenerator.php + - + message: '#^Comparison operation ">" between 6 and 0 is always true\.$#' + count: 1 + path: src/Generator/CombGenerator.php diff --git a/src/Codec/GuidStringCodec.php b/src/Codec/GuidStringCodec.php index 3675480..a4c1d77 100644 --- a/src/Codec/GuidStringCodec.php +++ b/src/Codec/GuidStringCodec.php @@ -53,7 +53,7 @@ class GuidStringCodec extends StringCodec { $components = array_values($uuid->getFieldsHex()); - return hex2bin(implode('', $components)); + return (string) hex2bin(implode('', $components)); } /** diff --git a/src/Codec/OrderedTimeCodec.php b/src/Codec/OrderedTimeCodec.php index de91aab..7f05d64 100644 --- a/src/Codec/OrderedTimeCodec.php +++ b/src/Codec/OrderedTimeCodec.php @@ -42,7 +42,7 @@ class OrderedTimeCodec extends StringCodec $fields['node'], ]; - return hex2bin(implode('', $optimized)); + return (string) hex2bin(implode('', $optimized)); } /** diff --git a/src/Codec/StringCodec.php b/src/Codec/StringCodec.php index f1bc024..1735088 100644 --- a/src/Codec/StringCodec.php +++ b/src/Codec/StringCodec.php @@ -66,7 +66,7 @@ class StringCodec implements CodecInterface */ public function encodeBinary(UuidInterface $uuid) { - return hex2bin($uuid->getHex()); + return (string) hex2bin($uuid->getHex()); } /** diff --git a/src/Codec/TimestampFirstCombCodec.php b/src/Codec/TimestampFirstCombCodec.php index 9d13af7..a630369 100644 --- a/src/Codec/TimestampFirstCombCodec.php +++ b/src/Codec/TimestampFirstCombCodec.php @@ -52,7 +52,7 @@ class TimestampFirstCombCodec extends StringCodec { $stringEncoding = $this->encode($uuid); - return hex2bin(str_replace('-', '', $stringEncoding)); + return (string) hex2bin(str_replace('-', '', $stringEncoding)); } /** diff --git a/src/Converter/Number/DegradedNumberConverter.php b/src/Converter/Number/DegradedNumberConverter.php index 96a011c..b219ce6 100644 --- a/src/Converter/Number/DegradedNumberConverter.php +++ b/src/Converter/Number/DegradedNumberConverter.php @@ -28,7 +28,7 @@ class DegradedNumberConverter implements NumberConverterInterface * Throws an `UnsatisfiedDependencyException` * * @param string $hex The hexadecimal string representation to convert - * @return void + * @return mixed * @throws UnsatisfiedDependencyException */ public function fromHex($hex) @@ -44,7 +44,7 @@ class DegradedNumberConverter implements NumberConverterInterface * Throws an `UnsatisfiedDependencyException` * * @param mixed $integer An integer representation to convert - * @return void + * @return string * @throws UnsatisfiedDependencyException */ public function toHex($integer) diff --git a/src/Converter/Time/DegradedTimeConverter.php b/src/Converter/Time/DegradedTimeConverter.php index b94589c..3e05dd8 100644 --- a/src/Converter/Time/DegradedTimeConverter.php +++ b/src/Converter/Time/DegradedTimeConverter.php @@ -29,7 +29,7 @@ class DegradedTimeConverter implements TimeConverterInterface * * @param string $seconds * @param string $microSeconds - * @return void + * @return string[] * @throws UnsatisfiedDependencyException if called on a 32-bit system and `Moontoast\Math\BigNumber` is not present */ public function calculateTime($seconds, $microSeconds) diff --git a/src/DegradedUuid.php b/src/DegradedUuid.php index 2669761..87fb46a 100644 --- a/src/DegradedUuid.php +++ b/src/DegradedUuid.php @@ -50,6 +50,7 @@ class DegradedUuid extends Uuid * For degraded UUIDs, throws an `UnsatisfiedDependencyException` when * called on a 32-bit system * + * @return array * @throws UnsatisfiedDependencyException if called on a 32-bit system */ public function getFields() @@ -65,6 +66,7 @@ class DegradedUuid extends Uuid * For degraded UUIDs, throws an `UnsatisfiedDependencyException` when * called on a 32-bit system * + * @return int * @throws UnsatisfiedDependencyException if called on a 32-bit system */ public function getNode() @@ -81,6 +83,7 @@ class DegradedUuid extends Uuid * For degraded UUIDs, throws an `UnsatisfiedDependencyException` when * called on a 32-bit system * + * @return int * @throws UnsatisfiedDependencyException if called on a 32-bit system */ public function getTimeLow() @@ -97,6 +100,7 @@ class DegradedUuid extends Uuid * For degraded UUIDs, throws an `UnsatisfiedDependencyException` when * called on a 32-bit system * + * @return int * @throws UnsatisfiedDependencyException if called on a 32-bit system * @throws UnsupportedOperationException If this UUID is not a version 1 UUID */ diff --git a/src/FeatureSet.php b/src/FeatureSet.php index e2203d0..f74a71d 100644 --- a/src/FeatureSet.php +++ b/src/FeatureSet.php @@ -193,6 +193,7 @@ class FeatureSet * Sets the time provider for use in this environment * * @param TimeProviderInterface $timeProvider + * @return void */ public function setTimeProvider(TimeProviderInterface $timeProvider) { diff --git a/src/Generator/CombGenerator.php b/src/Generator/CombGenerator.php index 1d4a5f6..9a9387d 100644 --- a/src/Generator/CombGenerator.php +++ b/src/Generator/CombGenerator.php @@ -74,7 +74,7 @@ class CombGenerator implements RandomGeneratorInterface $lsbTime = str_pad($this->converter->toHex($this->timestamp()), self::TIMESTAMP_BYTES * 2, '0', STR_PAD_LEFT); - return hex2bin(str_pad(bin2hex($hash), $length - self::TIMESTAMP_BYTES, '0') . $lsbTime); + return (string) hex2bin(str_pad(bin2hex($hash), $length - self::TIMESTAMP_BYTES, '0') . $lsbTime); } /** diff --git a/src/Generator/DefaultTimeGenerator.php b/src/Generator/DefaultTimeGenerator.php index 5c5ccb2..13a063e 100644 --- a/src/Generator/DefaultTimeGenerator.php +++ b/src/Generator/DefaultTimeGenerator.php @@ -92,7 +92,7 @@ class DefaultTimeGenerator implements TimeGeneratorInterface // Create a 60-bit time value as a count of 100-nanosecond intervals // since 00:00:00.00, 15 October 1582 $timeOfDay = $this->timeProvider->currentTime(); - $uuidTime = $this->timeConverter->calculateTime($timeOfDay['sec'], $timeOfDay['usec']); + $uuidTime = $this->timeConverter->calculateTime((string) $timeOfDay['sec'], (string) $timeOfDay['usec']); $timeHi = BinaryUtils::applyVersion($uuidTime['hi'], 1); $clockSeqHi = BinaryUtils::applyVariant($clockSeq >> 8); @@ -109,14 +109,14 @@ class DefaultTimeGenerator implements TimeGeneratorInterface ] ); - return hex2bin($hex); + return (string) hex2bin($hex); } /** * Uses the node provider given when constructing this instance to get * the node ID (usually a MAC address) * - * @param string|int $node A node value that may be used to override the node provider + * @param string|int|null $node A node value that may be used to override the node provider * @return string Hexadecimal representation of the node ID * @throws InvalidArgumentException * @throws Exception diff --git a/src/Generator/OpenSslGenerator.php b/src/Generator/OpenSslGenerator.php index 47abf9b..ba95297 100644 --- a/src/Generator/OpenSslGenerator.php +++ b/src/Generator/OpenSslGenerator.php @@ -38,6 +38,6 @@ class OpenSslGenerator implements RandomGeneratorInterface */ public function generate($length) { - return openssl_random_pseudo_bytes($length); + return (string) openssl_random_pseudo_bytes($length); } } diff --git a/src/Generator/RandomLibAdapter.php b/src/Generator/RandomLibAdapter.php index 5aa0e88..a6c2fab 100644 --- a/src/Generator/RandomLibAdapter.php +++ b/src/Generator/RandomLibAdapter.php @@ -40,13 +40,13 @@ class RandomLibAdapter implements RandomGeneratorInterface */ public function __construct(Generator $generator = null) { - $this->generator = $generator; - - if ($this->generator === null) { + if ($generator === null) { $factory = new Factory(); - $this->generator = $factory->getHighStrengthGenerator(); + $generator = $factory->getHighStrengthGenerator(); } + + $this->generator = $generator; } /** diff --git a/src/Provider/Node/FallbackNodeProvider.php b/src/Provider/Node/FallbackNodeProvider.php index 83488ab..a30aaec 100644 --- a/src/Provider/Node/FallbackNodeProvider.php +++ b/src/Provider/Node/FallbackNodeProvider.php @@ -43,7 +43,7 @@ class FallbackNodeProvider implements NodeProviderInterface * Returns the system node ID by iterating over an array of node providers * and returning the first non-empty value found * - * @return string System node ID as a hexadecimal string + * @return string|null System node ID as a hexadecimal string * @throws Exception */ public function getNode() diff --git a/src/Provider/Node/SystemNodeProvider.php b/src/Provider/Node/SystemNodeProvider.php index 5701513..892cbba 100644 --- a/src/Provider/Node/SystemNodeProvider.php +++ b/src/Provider/Node/SystemNodeProvider.php @@ -38,19 +38,25 @@ class SystemNodeProvider implements NodeProviderInterface $pattern = '/[^:]([0-9A-Fa-f]{2}([:-])[0-9A-Fa-f]{2}(\2[0-9A-Fa-f]{2}){4})[^:]/'; $matches = []; - // first try a linux specific way + // first try a linux specific way $node = $this->getSysfs(); // Search the ifconfig output for all MAC addresses and return // the first one found if ($node === false) { if (preg_match_all($pattern, $this->getIfconfig(), $matches, PREG_PATTERN_ORDER)) { - $node = $matches[1][0]; + $node = $matches[1][0] ?? false; } } + if ($node !== false) { $node = str_replace([':', '-'], '', $node); + + if (is_array($node)) { + $node = $node[0] ?? false; + } } + return $node; } @@ -62,7 +68,7 @@ class SystemNodeProvider implements NodeProviderInterface */ protected function getIfconfig() { - if (strpos(strtolower(ini_get('disable_functions')), 'passthru') !== false) { + if (strpos(strtolower((string) ini_get('disable_functions')), 'passthru') !== false) { return ''; } @@ -83,7 +89,7 @@ class SystemNodeProvider implements NodeProviderInterface break; } - return ob_get_clean(); + return (string) ob_get_clean(); } /** @@ -112,12 +118,13 @@ class SystemNodeProvider implements NodeProviderInterface $macs = array_map('trim', $macs); // remove invalid entries - $macs = array_filter($macs, function ($mac) { - return + $macs = array_filter($macs, function ($address) { + return ( // localhost adapter - $mac !== '00:00:00:00:00:00' && - // must match mac adress - preg_match('/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i', $mac); + $address !== '00:00:00:00:00:00' + // must match mac address + && preg_match('/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/i', $address) + ); }); $mac = reset($macs); diff --git a/src/Provider/Time/FixedTimeProvider.php b/src/Provider/Time/FixedTimeProvider.php index 02b36d7..6fafe70 100644 --- a/src/Provider/Time/FixedTimeProvider.php +++ b/src/Provider/Time/FixedTimeProvider.php @@ -49,6 +49,7 @@ class FixedTimeProvider implements TimeProviderInterface * Sets the `usec` component of the timestamp * * @param int $value The `usec` value to set + * @return void */ public function setUsec($value) { @@ -59,6 +60,7 @@ class FixedTimeProvider implements TimeProviderInterface * Sets the `sec` component of the timestamp * * @param int $value The `sec` value to set + * @return void */ public function setSec($value) { diff --git a/src/Uuid.php b/src/Uuid.php index 6c6d597..58699b8 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -233,8 +233,9 @@ class Uuid implements UuidInterface * Re-constructs the object from its serialized form. * * @param string $serialized - * @link http://php.net/manual/en/class.serializable.php + * @return void * @throws InvalidUuidStringException + * @link http://php.net/manual/en/class.serializable.php */ public function unserialize($serialized) { @@ -288,7 +289,7 @@ class Uuid implements UuidInterface */ public function getClockSeqHiAndReserved() { - return hexdec($this->getClockSeqHiAndReservedHex()); + return (int) hexdec($this->getClockSeqHiAndReservedHex()); } public function getClockSeqHiAndReservedHex() @@ -303,7 +304,7 @@ class Uuid implements UuidInterface */ public function getClockSeqLow() { - return hexdec($this->getClockSeqLowHex()); + return (int) hexdec($this->getClockSeqLowHex()); } public function getClockSeqLowHex() @@ -473,7 +474,7 @@ class Uuid implements UuidInterface */ public function getNode() { - return hexdec($this->getNodeHex()); + return (int) hexdec($this->getNodeHex()); } public function getNodeHex() @@ -489,7 +490,7 @@ class Uuid implements UuidInterface */ public function getTimeHiAndVersion() { - return hexdec($this->getTimeHiAndVersionHex()); + return (int) hexdec($this->getTimeHiAndVersionHex()); } public function getTimeHiAndVersionHex() @@ -504,7 +505,7 @@ class Uuid implements UuidInterface */ public function getTimeLow() { - return hexdec($this->getTimeLowHex()); + return (int) hexdec($this->getTimeLowHex()); } public function getTimeLowHex() @@ -519,7 +520,7 @@ class Uuid implements UuidInterface */ public function getTimeMid() { - return hexdec($this->getTimeMidHex()); + return (int) hexdec($this->getTimeMidHex()); } public function getTimeMidHex() @@ -549,7 +550,7 @@ class Uuid implements UuidInterface throw new UnsupportedOperationException('Not a time-based UUID'); } - return hexdec($this->getTimestampHex()); + return (int) hexdec($this->getTimestampHex()); } /** @@ -625,6 +626,7 @@ class Uuid implements UuidInterface * Sets the factory used to create UUIDs. * * @param UuidFactoryInterface $factory + * @return void */ public static function setFactory(UuidFactoryInterface $factory) { diff --git a/src/UuidFactory.php b/src/UuidFactory.php index 5a57b09..0436f6f 100644 --- a/src/UuidFactory.php +++ b/src/UuidFactory.php @@ -85,6 +85,7 @@ class UuidFactory implements UuidFactoryInterface * Sets the UUID coder-decoder used by this factory * * @param CodecInterface $codec + * @return void */ public function setCodec(CodecInterface $codec) { @@ -125,6 +126,7 @@ class UuidFactory implements UuidFactoryInterface * Sets the time-based UUID generator this factory will use to generate version 1 UUIDs * * @param TimeGeneratorInterface $generator + * @return void */ public function setTimeGenerator(TimeGeneratorInterface $generator) { @@ -145,6 +147,7 @@ class UuidFactory implements UuidFactoryInterface * Sets the random UUID generator this factory will use to generate version 4 UUIDs * * @param RandomGeneratorInterface $generator + * @return void */ public function setRandomGenerator(RandomGeneratorInterface $generator) { @@ -155,6 +158,7 @@ class UuidFactory implements UuidFactoryInterface * Sets the number converter this factory will use * * @param NumberConverterInterface $converter + * @return void */ public function setNumberConverter(NumberConverterInterface $converter) { @@ -175,6 +179,7 @@ class UuidFactory implements UuidFactoryInterface * Sets the UUID builder this factory will use when creating `Uuid` instances * * @param UuidBuilderInterface $builder + * @return void */ public function setUuidBuilder(UuidBuilderInterface $builder) { @@ -272,7 +277,7 @@ class UuidFactory implements UuidFactoryInterface * @param string|UuidInterface $ns The UUID namespace to use * @param string $name The string to hash together with the namespace * @param int $version The version of UUID to create (3 or 5) - * @param string $hashFunction The hash function to use when hashing together + * @param callable $hashFunction The hash function to use when hashing together * the namespace and name * @return UuidInterface * @throws InvalidUuidStringException @@ -299,7 +304,7 @@ class UuidFactory implements UuidFactoryInterface protected function uuidFromHashedName($hash, $version) { $timeHi = BinaryUtils::applyVersion(substr($hash, 12, 4), $version); - $clockSeqHi = BinaryUtils::applyVariant(hexdec(substr($hash, 16, 2))); + $clockSeqHi = BinaryUtils::applyVariant((int) hexdec(substr($hash, 16, 2))); $fields = [ 'time_low' => substr($hash, 0, 8), diff --git a/tests/Codec/GuidStringCodecTest.php b/tests/Codec/GuidStringCodecTest.php index 3488ead..dd6b087 100644 --- a/tests/Codec/GuidStringCodecTest.php +++ b/tests/Codec/GuidStringCodecTest.php @@ -40,9 +40,7 @@ class GuidStringCodecTest extends TestCase protected function tearDown(): void { parent::tearDown(); - $this->builder = null; - $this->fields = null; - $this->uuid = null; + unset($this->builder, $this->fields, $this->uuid); } public function testEncodeUsesFieldsArray() diff --git a/tests/Codec/OrderedTimeCodecTest.php b/tests/Codec/OrderedTimeCodecTest.php index b2c178d..b2c1a2e 100644 --- a/tests/Codec/OrderedTimeCodecTest.php +++ b/tests/Codec/OrderedTimeCodecTest.php @@ -47,9 +47,7 @@ class OrderedTimeCodecTest extends TestCase protected function tearDown(): void { parent::tearDown(); - $this->builder = null; - $this->uuid = null; - $this->fields = null; + unset($this->builder, $this->uuid, $this->fields); } public function testEncodeUsesFieldsArray() diff --git a/tests/Codec/StringCodecTest.php b/tests/Codec/StringCodecTest.php index b00220f..0309a14 100644 --- a/tests/Codec/StringCodecTest.php +++ b/tests/Codec/StringCodecTest.php @@ -44,9 +44,7 @@ class StringCodecTest extends TestCase protected function tearDown(): void { parent::tearDown(); - $this->builder = null; - $this->uuid = null; - $this->fields = null; + unset($this->builder, $this->uuid, $this->fields); } public function testEncodeUsesFieldsArray() diff --git a/tests/Converter/Time/PhpTimeConverterTest.php b/tests/Converter/Time/PhpTimeConverterTest.php index 0fe25a5..d96b182 100644 --- a/tests/Converter/Time/PhpTimeConverterTest.php +++ b/tests/Converter/Time/PhpTimeConverterTest.php @@ -25,7 +25,7 @@ class PhpTimeConverterTest extends TestCase ]; $converter = new PhpTimeConverter(); - $returned = $converter->calculateTime($seconds, $microSeconds); + $returned = $converter->calculateTime((string) $seconds, (string) $microSeconds); $this->assertEquals($expectedArray, $returned); } } diff --git a/tests/Generator/DefaultTimeGeneratorTest.php b/tests/Generator/DefaultTimeGeneratorTest.php index 598011c..802d53f 100644 --- a/tests/Generator/DefaultTimeGeneratorTest.php +++ b/tests/Generator/DefaultTimeGeneratorTest.php @@ -48,9 +48,7 @@ class DefaultTimeGeneratorTest extends TestCase protected function tearDown(): void { parent::tearDown(); - $this->timeProvider = null; - $this->nodeProvider = null; - $this->timeConverter = null; + unset($this->timeProvider, $this->nodeProvider, $this->timeConverter); Mockery::close(); AspectMock::clean(); } diff --git a/tests/Provider/Time/FixedTimeProviderTest.php b/tests/Provider/Time/FixedTimeProviderTest.php index 35b38d5..b4d6468 100644 --- a/tests/Provider/Time/FixedTimeProviderTest.php +++ b/tests/Provider/Time/FixedTimeProviderTest.php @@ -26,7 +26,7 @@ class FixedTimeProviderTest extends TestCase $timestamp = ['sec' => 1458844556, 'usec' => 200997]; $provider = new FixedTimeProvider($timestamp); - $newTimestamp = ['sec' => 1050804050, 'usec' => '30192']; + $newTimestamp = ['sec' => 1050804050, 'usec' => 30192]; $provider->setSec($newTimestamp['sec']); $provider->setUsec($newTimestamp['usec']); diff --git a/tests/UuidTest.php b/tests/UuidTest.php index b875de2..448e529 100644 --- a/tests/UuidTest.php +++ b/tests/UuidTest.php @@ -650,12 +650,12 @@ class UuidTest extends TestCase // Check with a recent date $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'); $this->assertEquals('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString()); - $this->assertEquals('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', sprintf('%s', $uuid)); + $this->assertEquals('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', sprintf('%s', (string) $uuid)); // Check with an old date $uuid = Uuid::fromString('0901e600-0154-1000-9b21-0800200c9a66'); $this->assertEquals('0901e600-0154-1000-9b21-0800200c9a66', $uuid->toString()); - $this->assertEquals('0901e600-0154-1000-9b21-0800200c9a66', sprintf('%s', $uuid)); + $this->assertEquals('0901e600-0154-1000-9b21-0800200c9a66', sprintf('%s', (string) $uuid)); } /** @@ -746,7 +746,7 @@ class UuidTest extends TestCase $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Invalid node value'); - $uuid = Uuid::uuid1(9223372036854775808); + $uuid = Uuid::uuid1('9223372036854775808'); } public function testUuid1WithNonHexadecimalNode() @@ -1034,7 +1034,6 @@ class UuidTest extends TestCase $this->assertTrue($uuid1->equals($uuid2)); $this->assertFalse($uuid1->equals($uuid3)); - $this->assertFalse($uuid1->equals(null)); $this->assertFalse($uuid1->equals(new stdClass())); } @@ -1942,20 +1941,6 @@ class UuidTest extends TestCase $this->assertEquals('4ae71336-e44b-39bf-b9d2-752e234818a5', $uuid->toString()); } - public function testUuid3WithNullName() - { - $uuid = Uuid::uuid3(Uuid::NIL, null); - - $this->assertEquals('4ae71336-e44b-39bf-b9d2-752e234818a5', $uuid->toString()); - } - - public function testUuid3WithFalseName() - { - $uuid = Uuid::uuid3(Uuid::NIL, false); - - $this->assertEquals('4ae71336-e44b-39bf-b9d2-752e234818a5', $uuid->toString()); - } - public function testUuid3WithZeroName() { $uuid = Uuid::uuid3(Uuid::NIL, '0'); @@ -1978,20 +1963,6 @@ class UuidTest extends TestCase $this->assertEquals('e129f27c-5103-5c5c-844b-cdf0a15e160d', $uuid->toString()); } - public function testUuid5WithNullName() - { - $uuid = Uuid::uuid5(Uuid::NIL, null); - - $this->assertEquals('e129f27c-5103-5c5c-844b-cdf0a15e160d', $uuid->toString()); - } - - public function testUuid5WithFalseName() - { - $uuid = Uuid::uuid5(Uuid::NIL, false); - - $this->assertEquals('e129f27c-5103-5c5c-844b-cdf0a15e160d', $uuid->toString()); - } - public function testUuid5WithZeroName() { $uuid = Uuid::uuid5(Uuid::NIL, '0');