* Get a Title object associated with the talk page of this article,
* if such a talk page can exist.
*
- * @return Title The object for the talk page,
+ * @since 1.30
+ *
+ * @return Title|null The object for the talk page,
* or null if no associated talk page can exist, according to canHaveTalkPage().
*/
public function getTalkPageIfDefined() {
* get the talk page, if it is a subject page get the talk page
*
* @since 1.25
- * @throws MWException
+ * @throws MWException If the page doesn't have an other page
* @return Title
*/
public function getOtherPage() {
if ( $this->isTalkPage() ) {
return $this->getSubjectPage();
} else {
+ if ( !$this->canHaveTalkPage() ) {
+ throw new MWException( "{$this->getPrefixedText()} does not have an other page" );
+ }
return $this->getTalkPage();
}
}
* protocol-relative, the URL will be expanded to http://
*
* @see self::getLocalURL for the arguments.
+ * @param string $query
+ * @param string|bool $query2
* @return string The URL
*/
public function getInternalURL( $query = '', $query2 = false ) {
* Returns true if ok, or a getUserPermissionsErrors()-like array otherwise
*
* @deprecated since 1.25, use MovePage's methods instead
- * @param Title $nt The new title
+ * @param Title &$nt The new title
* @param bool $auth Whether to check user permissions (uses $wgUser)
* @param string $reason Is the log summary of the move, used for spam checking
* @return array|bool True on success, getUserPermissionsErrors()-like array on failure
* Move a title to a new location
*
* @deprecated since 1.25, use the MovePage class instead
- * @param Title $nt The new title
+ * @param Title &$nt The new title
* @param bool $auth Indicates whether $wgUser's permissions
* should be checked
* @param string $reason The reason for the move