'ipb_address',
'ipb_by',
'ipb_by_text',
- 'ipb_by_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'ipb_by_actor' : null,
+ 'ipb_by_actor' => $wgActorTableSchemaMigrationStage > MIGRATION_OLD ? 'ipb_by_actor' : 'NULL',
'ipb_timestamp',
'ipb_auto',
'ipb_anon_only',
* 1) A block directly on the given user or IP
* 2) A rangeblock encompassing the given IP (smallest first)
* 3) An autoblock on the given IP
- * @param User|string $vagueTarget Also search for blocks affecting this target. Doesn't
+ * @param User|string|null $vagueTarget Also search for blocks affecting this target. Doesn't
* make any sense to use TYPE_AUTO / TYPE_ID here. Leave blank to skip IP lookups.
* @throws MWException
* @return bool Whether a relevant block was found
/**
* Get a set of SQL conditions which will select rangeblocks encompassing a given range
* @param string $start Hexadecimal IP representation
- * @param string $end Hexadecimal IP representation, or null to use $start = $end
+ * @param string|null $end Hexadecimal IP representation, or null to use $start = $end
* @return string
*/
public static function getRangeCond( $start, $end = null ) {
protected function initFromRow( $row ) {
$this->setTarget( $row->ipb_address );
$this->setBlocker( User::newFromAnyId(
- $row->ipb_by, $row->ipb_by_text, isset( $row->ipb_by_actor ) ? $row->ipb_by_actor : null
+ $row->ipb_by, $row->ipb_by_text, $row->ipb_by_actor ?? null
) );
$this->mTimestamp = wfTimestamp( TS_MW, $row->ipb_timestamp );
* Insert a block into the block table. Will fail if there is a conflicting
* block (same name and options) already in the database.
*
- * @param IDatabase $dbw If you have one available
+ * @param IDatabase|null $dbw If you have one available
* @return bool|array False on failure, assoc array on success:
* ('id' => block ID, 'autoIds' => array of autoblock IDs)
*/
* Calling this with a user, IP address or range will not select autoblocks, and will
* only select a block where the targets match exactly (so looking for blocks on
* 1.2.3.4 will not select 1.2.0.0/16 or even 1.2.3.4/32)
- * @param string|User|int $vagueTarget As above, but we will search for *any* block which
+ * @param string|User|int|null $vagueTarget As above, but we will search for *any* block which
* affects that target (so for an IP address, get ranges containing that IP; and also
* get any relevant autoblocks). Leave empty or blank to skip IP-based lookups.
* @param bool $fromMaster Whether to use the DB_MASTER database
$reason,
$context->getRequest()->getIP(),
$this->getByName(),
- $systemBlockType !== null ? $systemBlockType : $this->getId(),
+ $systemBlockType ?? $this->getId(),
$lang->formatExpiry( $this->mExpiry ),
(string)$intended,
$lang->userTimeAndDate( $this->mTimestamp, $context->getUser() ),