chore(deps-dev): upgrade PHPStan

This commit is contained in:
Ben Ramsey
2025-05-25 16:52:53 -05:00
parent 691c2c816e
commit 76cbc566e2
57 changed files with 447 additions and 422 deletions
+5 -12
View File
@@ -29,19 +29,12 @@ class DefaultNameGenerator implements NameGeneratorInterface
public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string
{
try {
/** @var string|bool $bytes */
$bytes = @hash($hashAlgorithm, $ns->getBytes() . $name, true);
return hash($hashAlgorithm, $ns->getBytes() . $name, true);
} catch (ValueError $e) {
$bytes = false; // keep same behavior than PHP 7
throw new NameException(
message: sprintf('Unable to hash namespace and name with algorithm \'%s\'', $hashAlgorithm),
previous: $e,
);
}
if ($bytes === false) {
throw new NameException(sprintf(
'Unable to hash namespace and name with algorithm \'%s\'',
$hashAlgorithm
));
}
return (string) $bytes;
}
}