'ip' => $request->getIP(),
'userAgent' => $this->getUserAgent(),
'wiki' => wfWikiID(),
- 'timeSpentBackend' => (int) round( $time * 1000 ),
+ 'timeSpentBackend' => (int)round( $time * 1000 ),
'hadError' => $e !== null,
'errorCodes' => [],
'params' => [],
];
if ( isset( $prop['size'] ) ) {
- $item['size'] = (int) $row->us_size;
- $item['width'] = (int) $row->us_image_width;
- $item['height'] = (int) $row->us_image_height;
- $item['bits'] = (int) $row->us_image_bits;
+ $item['size'] = (int)$row->us_size;
+ $item['width'] = (int)$row->us_image_width;
+ $item['height'] = (int)$row->us_image_height;
+ $item['bits'] = (int)$row->us_image_bits;
}
if ( isset( $prop['type'] ) ) {
*/
public function getSchemaRevisionId( $channel ) {
if ( isset( $this->schemas[$channel]['revision'] ) ) {
- return (int) $this->schemas[$channel]['revision'];
+ return (int)$this->schemas[$channel]['revision'];
}
return null;
}
*/
public static function stripComments( $json ) {
// Ensure we have a string
- $str = (string) $json;
+ $str = (string)$json;
$buffer = '';
$maxLen = strlen( $str );
$mark = 0;
// make a best effort to get the value of fields which used to be fixed in the old login
// template but now might or might not exist depending on what providers are used
$request = $this->getRequest();
- $data = (object) [
+ $data = (object)[
'mUsername' => $request->getText( 'wpName' ),
'mPassword' => $request->getText( 'wpPassword' ),
'mRetype' => $request->getText( 'wpRetype' ),
$ts = ( 1000 * $sec + $msec ) * 10000 + (int)$offset + $delta;
$id_bin = str_pad( decbin( $ts % pow( 2, 60 ) ), 60, '0', STR_PAD_LEFT );
} elseif ( extension_loaded( 'gmp' ) ) {
- $ts = gmp_add( gmp_mul( (string) $sec, '1000' ), (string) $msec ); // ms
+ $ts = gmp_add( gmp_mul( (string)$sec, '1000' ), (string)$msec ); // ms
$ts = gmp_add( gmp_mul( $ts, '10000' ), $offset ); // 100ns intervals
- $ts = gmp_add( $ts, (string) $delta );
+ $ts = gmp_add( $ts, (string)$delta );
$ts = gmp_mod( $ts, gmp_pow( '2', '60' ) ); // wrap around
$id_bin = str_pad( gmp_strval( $ts, 2 ), 60, '0', STR_PAD_LEFT );
} elseif ( extension_loaded( 'bcmath' ) ) {
}
$validator = new Validator;
- $validator->check( $data, (object) [ '$ref' => 'file://' . $schemaPath ] );
+ $validator->check( $data, (object)[ '$ref' => 'file://' . $schemaPath ] );
if ( $validator->isValid() && !$licenseError ) {
$this->output( "$path validates against the version $version schema!\n" );
} else {
/** @var ExternalStoreDB $externalStoreDB */
$externalStoreDB = ExternalStore::getStoreObject( 'DB' );
- $defaultArray = (array) $wgDefaultExternalStore;
+ $defaultArray = (array)$wgDefaultExternalStore;
$dbws = [];
foreach ( $defaultArray as $url ) {
if ( strpos( $url, 'DB://' ) === 0 ) {
return false;
}
- $defaultArray = (array) $wgDefaultExternalStore;
+ $defaultArray = (array)$wgDefaultExternalStore;
foreach ( $defaultArray as $url ) {
if ( strpos( $url, 'DB://' ) === 0 ) {
return true;
* @return stdClass|string|bool|int|float|null
*/
public static function toObject( $value ) {
- return !is_array( $value ) ? $value : (object) array_map( __METHOD__, $value );
+ return !is_array( $value ) ? $value : (object)array_map( __METHOD__, $value );
}
/**
*/
public function testReaderGetPrimaryKey( $message, array $expected, array $row ) {
$reader = new BatchRowIterator( $this->mockDb(), 'some_table', array_keys( $expected ), 8675309 );
- $this->assertEquals( $expected, $reader->extractPrimaryKeys( (object) $row ), $message );
+ $this->assertEquals( $expected, $reader->extractPrimaryKeys( (object)$row ), $message );
}
public static function provider_readerSetFetchColumns() {
for ( $i = 0; $i < $numRows; $i += $batchSize ) {
$rows = [];
for ( $j = 0; $j < $batchSize && $i + $j < $numRows; $j++ ) {
- $rows [] = (object) call_user_func( $rowGenerator );
+ $rows [] = (object)call_user_func( $rowGenerator );
}
$res[] = $rows;
}
}
$validator = new Validator;
- $validator->check( $data, (object) [ '$ref' => 'file://' . $schemaPath ] );
+ $validator->check( $data, (object)[ '$ref' => 'file://' . $schemaPath ] );
if ( $validator->isValid() && !$licenseError ) {
// All good.
$this->assertTrue( true );