From: Aaron Schulz Date: Thu, 4 Jul 2019 21:40:33 +0000 (-0700) Subject: Remove unused methods and bogus method call in Title X-Git-Tag: 1.34.0-rc.0~1051^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=1b381a608ca9860bf8a232cd544591646b360926;p=lhc%2Fweb%2Fwiklou.git Remove unused methods and bogus method call in Title Change-Id: I516c9f55f5baa164891ee03655475d7424f71e0a --- diff --git a/includes/Title.php b/includes/Title.php index 6e75102c92..a956ca2176 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2294,34 +2294,6 @@ class Title implements LinkTarget, IDBAccessObject { ->getPermissionErrors( $action, $user, $this, $rigor, $ignoreErrors ); } - /** - * Add the resulting error code to the errors array - * - * @param array $errors List of current errors - * @param array|string|MessageSpecifier|false $result Result of errors - * - * @return array List of errors - */ - private function resultToError( $errors, $result ) { - if ( is_array( $result ) && count( $result ) && !is_array( $result[0] ) ) { - // A single array representing an error - $errors[] = $result; - } elseif ( is_array( $result ) && is_array( $result[0] ) ) { - // A nested array representing multiple errors - $errors = array_merge( $errors, $result ); - } elseif ( $result !== '' && is_string( $result ) ) { - // A string representing a message-id - $errors[] = [ $result ]; - } elseif ( $result instanceof MessageSpecifier ) { - // A message specifier representing an error - $errors[] = [ $result ]; - } elseif ( $result === false ) { - // a generic "We don't want them to do that" - $errors[] = [ 'badaccess-group0' ]; - } - return $errors; - } - /** * Get a filtered list of all restriction types supported by this wiki. * @param bool $exists True to get all restriction types that apply to @@ -2949,7 +2921,7 @@ class Title implements LinkTarget, IDBAccessObject { $this->mHasSubpages = false; $subpages = $this->getSubpages( 1 ); if ( $subpages instanceof TitleArray ) { - $this->mHasSubpages = (bool)$subpages->count(); + $this->mHasSubpages = (bool)$subpages->current(); } }