update lock clucknut
All checks were successful
All checks were successful
This commit is contained in:
44
vendor/symfony/polyfill-uuid/Uuid.php
vendored
44
vendor/symfony/polyfill-uuid/Uuid.php
vendored
@@ -42,7 +42,7 @@ final class Uuid
|
||||
public static function uuid_create($uuid_type = \UUID_TYPE_DEFAULT)
|
||||
{
|
||||
if (!is_numeric($uuid_type) && null !== $uuid_type) {
|
||||
trigger_error(sprintf('uuid_create() expects parameter 1 to be int, %s given', \gettype($uuid_type)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_create() expects parameter 1 to be int, %s given', \gettype($uuid_type)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public static function uuid_create($uuid_type = \UUID_TYPE_DEFAULT)
|
||||
case self::UUID_TYPE_DEFAULT:
|
||||
return self::uuid_generate_random();
|
||||
default:
|
||||
trigger_error(sprintf("Unknown/invalid UUID type '%d' requested, using default type instead", $uuid_type), \E_USER_WARNING);
|
||||
trigger_error(\sprintf("Unknown/invalid UUID type '%d' requested, using default type instead", $uuid_type), \E_USER_WARNING);
|
||||
|
||||
return self::uuid_generate_random();
|
||||
}
|
||||
@@ -65,13 +65,13 @@ public static function uuid_create($uuid_type = \UUID_TYPE_DEFAULT)
|
||||
public static function uuid_generate_md5($uuid_ns, $name)
|
||||
{
|
||||
if (!\is_string($uuid_ns = self::toString($uuid_ns))) {
|
||||
trigger_error(sprintf('uuid_generate_md5() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_generate_md5() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!\is_string($name = self::toString($name))) {
|
||||
trigger_error(sprintf('uuid_generate_md5() expects parameter 2 to be string, %s given', \gettype($name)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_generate_md5() expects parameter 2 to be string, %s given', \gettype($name)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public static function uuid_generate_md5($uuid_ns, $name)
|
||||
|
||||
$hash = md5(hex2bin(str_replace('-', '', $uuid_ns)).$name);
|
||||
|
||||
return sprintf('%08s-%04s-3%03s-%04x-%012s',
|
||||
return \sprintf('%08s-%04s-3%03s-%04x-%012s',
|
||||
// 32 bits for "time_low"
|
||||
substr($hash, 0, 8),
|
||||
// 16 bits for "time_mid"
|
||||
@@ -106,13 +106,13 @@ public static function uuid_generate_md5($uuid_ns, $name)
|
||||
public static function uuid_generate_sha1($uuid_ns, $name)
|
||||
{
|
||||
if (!\is_string($uuid_ns = self::toString($uuid_ns))) {
|
||||
trigger_error(sprintf('uuid_generate_sha1() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_generate_sha1() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!\is_string($name = self::toString($name))) {
|
||||
trigger_error(sprintf('uuid_generate_sha1() expects parameter 2 to be string, %s given', \gettype($name)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_generate_sha1() expects parameter 2 to be string, %s given', \gettype($name)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public static function uuid_generate_sha1($uuid_ns, $name)
|
||||
|
||||
$hash = sha1(hex2bin(str_replace('-', '', $uuid_ns)).$name);
|
||||
|
||||
return sprintf('%08s-%04s-5%03s-%04x-%012s',
|
||||
return \sprintf('%08s-%04s-5%03s-%04x-%012s',
|
||||
// 32 bits for "time_low"
|
||||
substr($hash, 0, 8),
|
||||
// 16 bits for "time_mid"
|
||||
@@ -149,7 +149,7 @@ public static function uuid_generate_sha1($uuid_ns, $name)
|
||||
public static function uuid_is_valid($uuid)
|
||||
{
|
||||
if (!\is_string($uuid = self::toString($uuid))) {
|
||||
trigger_error(sprintf('uuid_is_valid() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_is_valid() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -160,13 +160,13 @@ public static function uuid_is_valid($uuid)
|
||||
public static function uuid_compare($uuid1, $uuid2)
|
||||
{
|
||||
if (!\is_string($uuid1 = self::toString($uuid1))) {
|
||||
trigger_error(sprintf('uuid_compare() expects parameter 1 to be string, %s given', \gettype($uuid1)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_compare() expects parameter 1 to be string, %s given', \gettype($uuid1)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!\is_string($uuid2 = self::toString($uuid2))) {
|
||||
trigger_error(sprintf('uuid_compare() expects parameter 2 to be string, %s given', \gettype($uuid2)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_compare() expects parameter 2 to be string, %s given', \gettype($uuid2)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public static function uuid_compare($uuid1, $uuid2)
|
||||
public static function uuid_is_null($uuid)
|
||||
{
|
||||
if (!\is_string($uuid = self::toString($uuid))) {
|
||||
trigger_error(sprintf('uuid_is_null() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_is_null() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public static function uuid_is_null($uuid)
|
||||
public static function uuid_type($uuid)
|
||||
{
|
||||
if (!\is_string($uuid = self::toString($uuid))) {
|
||||
trigger_error(sprintf('uuid_type() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_type() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ public static function uuid_type($uuid)
|
||||
public static function uuid_variant($uuid)
|
||||
{
|
||||
if (!\is_string($uuid = self::toString($uuid))) {
|
||||
trigger_error(sprintf('uuid_variant() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_variant() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ public static function uuid_variant($uuid)
|
||||
public static function uuid_time($uuid)
|
||||
{
|
||||
if (!\is_string($uuid = self::toString($uuid))) {
|
||||
trigger_error(sprintf('uuid_time() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_time() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -292,7 +292,7 @@ public static function uuid_time($uuid)
|
||||
public static function uuid_mac($uuid)
|
||||
{
|
||||
if (!\is_string($uuid = self::toString($uuid))) {
|
||||
trigger_error(sprintf('uuid_mac() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_mac() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ public static function uuid_mac($uuid)
|
||||
public static function uuid_parse($uuid)
|
||||
{
|
||||
if (!\is_string($uuid = self::toString($uuid))) {
|
||||
trigger_error(sprintf('uuid_parse() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_parse() expects parameter 1 to be string, %s given', \gettype($uuid)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ public static function uuid_parse($uuid)
|
||||
public static function uuid_unparse($bytes)
|
||||
{
|
||||
if (!\is_string($bytes = self::toString($bytes))) {
|
||||
trigger_error(sprintf('uuid_unparse() expects parameter 1 to be string, %s given', \gettype($bytes)), \E_USER_WARNING);
|
||||
trigger_error(\sprintf('uuid_unparse() expects parameter 1 to be string, %s given', \gettype($bytes)), \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -357,7 +357,7 @@ private static function uuid_generate_random()
|
||||
{
|
||||
$uuid = bin2hex(random_bytes(16));
|
||||
|
||||
return sprintf('%08s-%04s-4%03s-%04x-%012s',
|
||||
return \sprintf('%08s-%04s-4%03s-%04x-%012s',
|
||||
// 32 bits for "time_low"
|
||||
substr($uuid, 0, 8),
|
||||
// 16 bits for "time_mid"
|
||||
@@ -401,21 +401,21 @@ private static function uuid_generate_time()
|
||||
if (\function_exists('apcu_fetch')) {
|
||||
$node = apcu_fetch('__symfony_uuid_node');
|
||||
if (false === $node) {
|
||||
$node = sprintf('%06x%06x',
|
||||
$node = \sprintf('%06x%06x',
|
||||
random_int(0, 0xFFFFFF) | 0x010000,
|
||||
random_int(0, 0xFFFFFF)
|
||||
);
|
||||
apcu_store('__symfony_uuid_node', $node);
|
||||
}
|
||||
} else {
|
||||
$node = sprintf('%06x%06x',
|
||||
$node = \sprintf('%06x%06x',
|
||||
random_int(0, 0xFFFFFF) | 0x010000,
|
||||
random_int(0, 0xFFFFFF)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return sprintf('%08s-%04s-1%03s-%04x-%012s',
|
||||
return \sprintf('%08s-%04s-1%03s-%04x-%012s',
|
||||
// 32 bits for "time_low"
|
||||
substr($time, -8),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user