@@ -35,7 +35,7 @@ final class Uuid
35
35
// https://tools.ietf.org/html/rfc4122#section-4.1.4
36
36
// 0x01b21dd213814000 is the number of 100-ns intervals between the
37
37
// UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
38
- public const TIME_OFFSET_INT = 0x01b21dd213814000 ;
38
+ public const TIME_OFFSET_INT = 0x01B21DD213814000 ;
39
39
public const TIME_OFFSET_BIN = "\x01\xb2\x1d\xd2\x13\x81\x40\x00" ;
40
40
public const TIME_OFFSET_COM = "\xfe\x4d\xe2\x2d\xec\x7e\xc0\x00" ;
41
41
@@ -97,7 +97,7 @@ public static function uuid_generate_md5($uuid_ns, $name)
97
97
// 16 bits:
98
98
// * 8 bits for "clk_seq_hi_res",
99
99
// * 8 bits for "clk_seq_low",
100
- hexdec (substr ($ hash , 16 , 4 )) & 0x3fff | 0x8000 ,
100
+ hexdec (substr ($ hash , 16 , 4 )) & 0x3FFF | 0x8000 ,
101
101
// 48 bits for "node"
102
102
substr ($ hash , 20 , 12 )
103
103
);
@@ -140,7 +140,7 @@ public static function uuid_generate_sha1($uuid_ns, $name)
140
140
// * 8 bits for "clk_seq_low",
141
141
// WARNING: On old libuuid version, there is a bug. 0x0fff is used instead of 0x3fff
142
142
// See https://github.com/karelzak/util-linux/commit/d6ddf07d31dfdc894eb8e7e6842aa856342c526e
143
- hexdec (substr ($ hash , 16 , 4 )) & 0x3fff | 0x8000 ,
143
+ hexdec (substr ($ hash , 16 , 4 )) & 0x3FFF | 0x8000 ,
144
144
// 48 bits for "node"
145
145
substr ($ hash , 20 , 12 )
146
146
);
@@ -369,7 +369,7 @@ private static function uuid_generate_random()
369
369
// * 8 bits for "clk_seq_hi_res",
370
370
// * 8 bits for "clk_seq_low",
371
371
// two most significant bits holds zero and one for variant DCE1.1
372
- hexdec (substr ($ uuid , 16 , 4 )) & 0x3fff | 0x8000 ,
372
+ hexdec (substr ($ uuid , 16 , 4 )) & 0x3FFF | 0x8000 ,
373
373
// 48 bits for "node"
374
374
substr ($ uuid , 20 , 12 )
375
375
);
@@ -394,23 +394,23 @@ private static function uuid_generate_time()
394
394
// https://tools.ietf.org/html/rfc4122#section-4.1.5
395
395
// We are using a random data for the sake of simplicity: since we are
396
396
// not able to get a super precise timeOfDay as a unique sequence
397
- $ clockSeq = random_int (0 , 0x3fff );
397
+ $ clockSeq = random_int (0 , 0x3FFF );
398
398
399
399
static $ node ;
400
400
if (null === $ node ) {
401
401
if (\function_exists ('apcu_fetch ' )) {
402
402
$ node = apcu_fetch ('__symfony_uuid_node ' );
403
403
if (false === $ node ) {
404
404
$ node = sprintf ('%06x%06x ' ,
405
- random_int (0 , 0xffffff ) | 0x010000 ,
406
- random_int (0 , 0xffffff )
405
+ random_int (0 , 0xFFFFFF ) | 0x010000 ,
406
+ random_int (0 , 0xFFFFFF )
407
407
);
408
408
apcu_store ('__symfony_uuid_node ' , $ node );
409
409
}
410
410
} else {
411
411
$ node = sprintf ('%06x%06x ' ,
412
- random_int (0 , 0xffffff ) | 0x010000 ,
413
- random_int (0 , 0xffffff )
412
+ random_int (0 , 0xFFFFFF ) | 0x010000 ,
413
+ random_int (0 , 0xFFFFFF )
414
414
);
415
415
}
416
416
}
@@ -458,7 +458,7 @@ private static function parse($uuid)
458
458
459
459
private static function toString ($ v )
460
460
{
461
- if (\is_string ($ v ) || null === $ v || (\is_object ($ v ) ? method_exists ($ v , '__toString ' ) : is_scalar ($ v ))) {
461
+ if (\is_string ($ v ) || null === $ v || (\is_object ($ v ) ? method_exists ($ v , '__toString ' ) : \ is_scalar ($ v ))) {
462
462
return (string ) $ v ;
463
463
}
464
464
0 commit comments