* timestamp string The time at which the block comes into effect
* byText string Username of the blocker (for foreign users)
*/
- function __construct( $options = [] ) {
+ public function __construct( array $options = [] ) {
$defaults = [
'address' => '',
'by' => null,
* @param bool $applyIpBlocksToXff
* @param bool $cookieSetOnAutoblock
* @param bool $cookieSetOnIpBlock
- * @param array $dnsBlacklistUrls
+ * @param string[] $dnsBlacklistUrls
* @param bool $enableDnsBlacklist
- * @param array $proxyList
- * @param array $proxyWhitelist
+ * @param string[] $proxyList
+ * @param string[] $proxyWhitelist
* @param string $secretKey
* @param array $softBlockRanges
*/
public function __construct(
- $currentUser,
- $currentRequest,
+ User $currentUser,
+ WebRequest $currentRequest,
$applyIpBlocksToXff,
$cookieSetOnAutoblock,
$cookieSetOnIpBlock,
- $dnsBlacklistUrls,
+ array $dnsBlacklistUrls,
$enableDnsBlacklist,
- $proxyList,
- $proxyWhitelist,
+ array $proxyList,
+ array $proxyWhitelist,
$secretKey,
$softBlockRanges
) {
* @param AbstractBlock[] $blocks
* @return AbstractBlock[]
*/
- private function getUniqueBlocks( $blocks ) {
+ private function getUniqueBlocks( array $blocks ) {
$systemBlocks = [];
$databaseBlocks = [];
use MediaWiki\Block\Restriction\PageRestriction;
use MediaWiki\Block\Restriction\Restriction;
use MWException;
+use stdClass;
use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\ILoadBalancer;
*/
private $loadBalancer;
- /*
- * @param LoadBalancer $loadBalancer load balancer for acquiring database connections
+ /**
+ * @param ILoadBalancer $loadBalancer load balancer for acquiring database connections
*/
public function __construct( ILoadBalancer $loadBalancer ) {
$this->loadBalancer = $loadBalancer;
* Delete the restrictions.
*
* @since 1.33
- * @param Restriction[]|null $restrictions
+ * @param Restriction[] $restrictions
* @throws MWException
* @return bool
*/
/**
* Convert a result row from the database into a restriction object.
*
- * @param \stdClass $row
+ * @param stdClass $row
* @return Restriction|null
*/
- private function rowToRestriction( \stdClass $row ) {
+ private function rowToRestriction( stdClass $row ) {
if ( array_key_exists( (int)$row->ir_type, $this->types ) ) {
$class = $this->types[ (int)$row->ir_type ];
return call_user_func( [ $class, 'newFromRow' ], $row );
* @param array $options Parameters of the block:
* originalBlocks Block[] Blocks that this block is composed from
*/
- function __construct( $options = [] ) {
+ public function __construct( array $options = [] ) {
parent::__construct( $options );
$defaults = [
* 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() === '' ) {
* in the database. Value is a string to return
* from self::getSystemBlockType().
*/
- function __construct( $options = [] ) {
+ public function __construct( array $options = [] ) {
parent::__construct( $options );
$defaults = [