* prohibited from editing any page on the site (other than their own talk
* page).
*
+ * @since 1.33
* @param null|bool $x
* @return bool
*/
* @since 1.22
*/
public static function getBlocksForIPList( array $ipChain, $isAnon, $fromMaster = false ) {
- if ( !count( $ipChain ) ) {
+ if ( $ipChain === [] ) {
return [];
}
$conds[] = self::getRangeCond( IP::toHex( $ipaddr ) );
}
- if ( !count( $conds ) ) {
+ if ( $conds === [] ) {
return [];
}
* @return Block|null The "best" block from the list
*/
public static function chooseBlock( array $blocks, array $ipChain ) {
- if ( !count( $blocks ) ) {
+ if ( $blocks === [] ) {
return null;
} elseif ( count( $blocks ) == 1 ) {
return $blocks[0];
/**
* Get block information used in different block error messages
*
+ * @since 1.33
* @param IContextSource $context
* @return array
*/
* Getting the restrictions will perform a database query if the restrictions
* are not already loaded.
*
+ * @since 1.33
* @return Restriction[]
*/
public function getRestrictions() {
/**
* Set Restrictions.
*
+ * @since 1.33
* @param Restriction[] $restrictions
- *
* @return self
*/
public function setRestrictions( array $restrictions ) {