Skip to content

Commit 4fc2b66

Browse files
umherirrenderKrinkle
authored andcommitted
phan: Disable null_casts_as_any_type setting
Make phan stricter about null types by setting null_casts_as_any_type to false (the default in mediawiki-phan-config) Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T242536 Bug: T301991 Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
1 parent 20bd38f commit 4fc2b66

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

includes/libs/uuid/GlobalIdGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ protected function intervalsSinceGregorianBinary( array $time, $delta = 0 ) {
632632
$ts = bcadd( $ts, (string)$delta );
633633
// wrap around
634634
$ts = bcmod( $ts, bcpow( '2', '60' ) );
635+
// @phan-suppress-next-line PhanTypeMismatchArgumentNullable Only null if second arg is 0
635636
$id_bin = \Wikimedia\base_convert( $ts, 10, 2, 60 );
636637
} else {
637638
throw new RuntimeException( 'bcmath or gmp extension required for 32 bit machines.' );
@@ -661,6 +662,7 @@ private function load() {
661662
$csv = trim( ( $this->shellCallback )( 'getmac /NH /FO CSV' ) );
662663
$line = substr( $csv, 0, strcspn( $csv, "\n" ) );
663664
$info = str_getcsv( $line );
665+
// @phan-suppress-next-line PhanTypeMismatchArgumentNullableInternal False positive
664666
$nodeId = isset( $info[0] ) ? str_replace( '-', '', $info[0] ) : '';
665667
} elseif ( is_executable( '/sbin/ifconfig' ) ) {
666668
// Linux/BSD/Solaris/OS X

0 commit comments

Comments
 (0)