Block::parseTarget() accepts and can return null
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Thu, 3 Jan 2013 10:53:41 +0000 (11:53 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Thu, 3 Jan 2013 10:53:41 +0000 (11:53 +0100)
Documentation currently omits this.

Change-Id: I183121e5134c1bbd53a613780d171b52737f071d

includes/Block.php

index 4c878b6..5f9be30 100644 (file)
@@ -1066,12 +1066,13 @@ class Block {
        }
 
        /**
-        * From an existing Block, get the target and the type of target.  Note that it is
-        * always safe to treat the target as a string; for User objects this will return
-        * User::__toString() which in turn gives User::getName().
+        * From an existing Block, get the target and the type of target.
+        * Note that, except for null, it is always safe to treat the target
+        * as a string; for User objects this will return User::__toString()
+        * which in turn gives User::getName().
         *
-        * @param $target String|Int|User
-        * @return array( User|String, Block::TYPE_ constant )
+        * @param $target String|Int|User|null
+        * @return array( User|String|null, Block::TYPE_ constant|null )
         */
        public static function parseTarget( $target ) {
                # We may have been through this before