Merge "exception: Add missing early return for UserNotLoggedIn error page"
[lhc/web/wiklou.git] / includes / block / AbstractBlock.php
index 9ad7534..fa91909 100644 (file)
@@ -90,12 +90,13 @@ abstract class AbstractBlock {
        /**
         * Create a new block with specified parameters on a user, IP or IP range.
         *
-        * @param array $options Parameters of the block:
-        *     address string|User  Target user name, User object, IP address or IP range
-        *     by int               User ID of the blocker
-        *     reason string        Reason of the block
-        *     timestamp string     The time at which the block comes into effect
-        *     byText string        Username of the blocker (for foreign users)
+        * @param array $options Parameters of the block, with supported options:
+        *  - address: (string|User) Target user name, User object, IP address or IP range
+        *  - by: (int) User ID of the blocker
+        *  - reason: (string) Reason of the block
+        *  - timestamp: (string) The time at which the block comes into effect
+        *  - byText: (string) Username of the blocker (for foreign users)
+        *  - hideName: (bool) Hide the target user name
         */
        public function __construct( array $options = [] ) {
                $defaults = [
@@ -104,6 +105,7 @@ abstract class AbstractBlock {
                        'reason'          => '',
                        'timestamp'       => '',
                        'byText'          => '',
+                       'hideName'        => false,
                ];
 
                $options += $defaults;
@@ -120,6 +122,7 @@ abstract class AbstractBlock {
 
                $this->setReason( $options['reason'] );
                $this->setTimestamp( wfTimestamp( TS_MW, $options['timestamp'] ) );
+               $this->setHideName( (bool)$options['hideName'] );
        }
 
        /**
@@ -247,8 +250,9 @@ abstract class AbstractBlock {
         * may be overridden according to global configs.
         *
         * @since 1.33
-        * @param string $right Right to check
-        * @return bool|null null if unrecognized right or unset property
+        * @param string $right
+        * @return bool|null The block applies to the right, or null if
+        *  unsure (e.g. unrecognized right or unset property)
         */
        public function appliesToRight( $right ) {
                $config = RequestContext::getMain()->getConfig();