Skip to content

Commit 20bd38f

Browse files
committed
Fix type of value directly passed to php internal functions
Found by phan strict checks Change-Id: Icc44cd143f2e98fa3ca188e625a3289441de0f73
1 parent ccd4170 commit 20bd38f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

includes/libs/uuid/GlobalIdGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,16 +622,16 @@ protected function intervalsSinceGregorianBinary( array $time, $delta = 0 ) {
622622
$ts = gmp_add( gmp_mul( $ts, '10000' ), $offset );
623623
$ts = gmp_add( $ts, (string)$delta );
624624
// wrap around
625-
$ts = gmp_mod( $ts, gmp_pow( '2', '60' ) );
625+
$ts = gmp_mod( $ts, gmp_pow( '2', 60 ) );
626626
$id_bin = str_pad( gmp_strval( $ts, 2 ), 60, '0', STR_PAD_LEFT );
627627
} elseif ( extension_loaded( 'bcmath' ) ) {
628628
// ms
629-
$ts = bcadd( bcmul( $sec, 1000 ), $msec );
629+
$ts = bcadd( bcmul( $sec, '1000' ), $msec );
630630
// 100ns intervals
631-
$ts = bcadd( bcmul( $ts, 10000 ), $offset );
631+
$ts = bcadd( bcmul( $ts, '10000' ), $offset );
632632
$ts = bcadd( $ts, (string)$delta );
633633
// wrap around
634-
$ts = bcmod( $ts, bcpow( 2, 60 ) );
634+
$ts = bcmod( $ts, bcpow( '2', '60' ) );
635635
$id_bin = \Wikimedia\base_convert( $ts, 10, 2, 60 );
636636
} else {
637637
throw new RuntimeException( 'bcmath or gmp extension required for 32 bit machines.' );

0 commit comments

Comments
 (0)