* Load blocks from the database which target the specific target exactly, or which cover the
* vague target.
*
- * @param User|String|null $specificTarget
+ * @param User|string|null $specificTarget
* @param int|null $specificType
* @param bool $fromMaster
* @param User|string|null $vagueTarget Also search for blocks affecting this target. Doesn't
* @param DatabaseBlock[] $blocks These should not include autoblocks or ID blocks
* @return DatabaseBlock|null The block with the most specific target
*/
- protected static function chooseMostSpecificBlock( $blocks ) {
+ protected static function chooseMostSpecificBlock( array $blocks ) {
if ( count( $blocks ) === 1 ) {
return $blocks[0];
}
* @return bool|array False on failure, assoc array on success:
* ('id' => block ID, 'autoIds' => array of autoblock IDs)
*/
- public function insert( $dbw = null ) {
+ public function insert( IDatabase $dbw = null ) {
global $wgBlockDisablesLogin;
if ( !$this->getBlocker() || $this->getBlocker()->getName() === '' ) {
return $this;
}
+ /**
+ * @since 1.34
+ * @return int|null If this is an autoblock, ID of the parent block; otherwise null
+ */
+ public function getParentBlockId() {
+ return $this->mParentBlockId;
+ }
+
/**
* Get/set a flag determining whether the master is used for reads
*