Introduce a BlockManager service for checking the blocks that apply to a user/IP, to replace the main logic in User::getBlockedStatus and related methods.
The reason we’re doing this now is because checking blocks is becoming more complicated, particularly when multiple blocks apply to a user/IP. Currently, only one block is chosen, but this is not tenable now that we have partial blocks, because a user/IP may be blocked much more leniently than intended, if a partial block is chosen over a sitewide block (T206163).
In the future, the BlockManager could be expanded to incorporate some or all of the factory/utility/cookie-related/database-related methods from Block (see comment below).
Move implementation of block-checking methods from user to the new BlockManager and soft-deprecate said methods in the User class:
User::isLocallyBlockedProxy (public - called from UserTest)
User::isDnsBlacklisted (public - called from AuthManager)
User::inDnsBlacklist (public but could be private)
User::getBlockedStatus will call a BlockManager method that queries for all blocks relevant to the user/IP. If multiple are found, a temporary system block will be made that combines the strictest parameters of these. The BlockManager method will return a single block, and User::getBlockStatus will use this block to populate the User properties, as it does currently.