Improve formatting of constructor documentation for block classes
authorThalia <thalia.e.chan@googlemail.com>
Thu, 29 Aug 2019 12:18:50 +0000 (13:18 +0100)
committerThalia <thalia.e.chan@googlemail.com>
Thu, 29 Aug 2019 12:18:50 +0000 (13:18 +0100)
Change-Id: Idced6ce907f63d2c041d1bb926b8224ece54c3de

includes/block/AbstractBlock.php
includes/block/CompositeBlock.php
includes/block/DatabaseBlock.php
includes/block/SystemBlock.php

index fcc624e..4d4bb07 100644 (file)
@@ -90,13 +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)
-        *     hideName bool        Hide the target user name
+        * @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 = [
index 45a6301..3f3e2d3 100644 (file)
@@ -40,8 +40,9 @@ class CompositeBlock extends AbstractBlock {
        /**
         * Create a new block with specified parameters on a user, IP or IP range.
         *
-        * @param array $options Parameters of the block:
-        *     originalBlocks Block[] Blocks that this block is composed from
+        * @param array $options Parameters of the block, with options supported by
+        *  `AbstractBlock::__construct`, and also:
+        *  - originalBlocks: (Block[]) Blocks that this block is composed from
         */
        public function __construct( array $options = [] ) {
                parent::__construct( $options );
index 79286c5..6007abd 100644 (file)
@@ -86,18 +86,18 @@ class DatabaseBlock extends AbstractBlock {
        /**
         * Create a new block with specified option parameters on a user, IP or IP range.
         *
-        * @param array $options Parameters of the block:
-        *     user int             Override target user ID (for foreign users)
-        *     auto bool            Is this an automatic block?
-        *     expiry string        Timestamp of expiration of the block or 'infinity'
-        *     anonOnly bool        Only disallow anonymous actions
-        *     createAccount bool   Disallow creation of new accounts
-        *     enableAutoblock bool Enable automatic blocking
-        *     blockEmail bool      Disallow sending emails
-        *     allowUsertalk bool   Allow the target to edit its own talk page
-        *     sitewide bool        Disallow editing all pages and all contribution
-        *                          actions, except those specifically allowed by
-        *                          other block flags
+        * @param array $options Parameters of the block, with options supported by
+        *  `AbstractBlock::__construct`, and also:
+        *  - user: (int) Override target user ID (for foreign users)
+        *  - auto: (bool) Is this an automatic block?
+        *  - expiry: (string) Timestamp of expiration of the block or 'infinity'
+        *  - anonOnly: (bool) Only disallow anonymous actions
+        *  - createAccount: (bool) Disallow creation of new accounts
+        *  - enableAutoblock: (bool) Enable automatic blocking
+        *  - blockEmail: (bool) Disallow sending emails
+        *  - allowUsertalk: (bool) Allow the target to edit its own talk page
+        *  - sitewide: (bool) Disallow editing all pages and all contribution actions,
+        *    except those specifically allowed by other block flags
         *
         * @since 1.26 $options array
         */
index 0cbf125..494a7b9 100644 (file)
@@ -39,11 +39,11 @@ class SystemBlock extends AbstractBlock {
        /**
         * Create a new block with specified parameters on a user, IP or IP range.
         *
-        * @param array $options Parameters of the block:
-        *     systemBlock string   Indicate that this block is automatically
-        *                          created by MediaWiki rather than being stored
-        *                          in the database. Value is a string to return
-        *                          from self::getSystemBlockType().
+        * @param array $options Parameters of the block, with options supported by
+        *  `AbstractBlock::__construct`, and also:
+        *  - systemBlock: (string) Indicate that this block is automatically created by
+        *    MediaWiki rather than being stored in the database. Value is a string to
+        *    return from self::getSystemBlockType().
         */
        public function __construct( array $options = [] ) {
                parent::__construct( $options );