Change \\ to \ in phpdoc
authorGergő Tisza <tgr.huwiki@gmail.com>
Wed, 6 Apr 2016 22:22:33 +0000 (00:22 +0200)
committerGergő Tisza <gtisza@wikimedia.org>
Fri, 8 Apr 2016 17:46:30 +0000 (17:46 +0000)
Remove "\\" in namespacing. This is a Doxygen compatibility hack but
does not seem needed anymore, Doxygen reads namespaced class names
correctly, see e.g. https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1Services_1_1ServiceContainer.html

PHP IDEs, on the other hand, were broken by the double backslash.

As an unrelated small doc fix, add parameter docs to PermissionError
constructor (parent has different arguments so the inherited
documentation is wrong).

Change-Id: I6da0f512b8c84f65fd20e90e4617108fe6a8fcd2

17 files changed:
includes/DefaultSettings.php
includes/FauxRequest.php
includes/GlobalFunctions.php
includes/Setup.php
includes/WebRequest.php
includes/api/ApiQueryTokens.php
includes/exception/PermissionsError.php
includes/htmlform/HTMLButtonField.php
includes/session/Session.php
includes/session/SessionBackend.php
includes/session/SessionId.php
includes/session/SessionManager.php
includes/session/SessionManagerInterface.php
includes/session/SessionProvider.php
includes/specials/SpecialUserlogin.php
includes/user/LoggedOutEditToken.php
includes/user/User.php

index 65032ad..4c70ea5 100644 (file)
@@ -2288,7 +2288,7 @@ $wgSessionsInObjectCache = true;
 $wgObjectCacheSessionExpiry = 3600;
 
 /**
- * @deprecated since 1.27, MediaWiki\\Session\\SessionManager doesn't use PHP session storage.
+ * @deprecated since 1.27, MediaWiki\Session\SessionManager doesn't use PHP session storage.
  */
 $wgSessionHandler = null;
 
index c2108f2..158c852 100644 (file)
@@ -39,7 +39,7 @@ class FauxRequest extends WebRequest {
         * @param array $data Array of *non*-urlencoded key => value pairs, the
         *   fake GET/POST values
         * @param bool $wasPosted Whether to treat the data as POST
-        * @param MediaWiki\\Session\\Session|array|null $session Session, session
+        * @param MediaWiki\Session\Session|array|null $session Session, session
         *  data array, or null
         * @param string $protocol 'http' or 'https'
         * @throws MWException
index 3fa91fa..e8d077b 100644 (file)
@@ -2990,7 +2990,7 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1,
 
 /**
  * @deprecated since 1.27, PHP's session generation isn't used with
- *  MediaWiki\\Session\\SessionManager
+ *  MediaWiki\Session\SessionManager
  */
 function wfFixSessionID() {
        wfDeprecated( __FUNCTION__, '1.27' );
@@ -2999,7 +2999,7 @@ function wfFixSessionID() {
 /**
  * Reset the session id
  *
- * @deprecated since 1.27, use MediaWiki\\Session\\SessionManager instead
+ * @deprecated since 1.27, use MediaWiki\Session\SessionManager instead
  * @since 1.22
  */
 function wfResetSessionID() {
@@ -3021,7 +3021,7 @@ function wfResetSessionID() {
 /**
  * Initialise php session
  *
- * @deprecated since 1.27, use MediaWiki\\Session\\SessionManager instead.
+ * @deprecated since 1.27, use MediaWiki\Session\SessionManager instead.
  *  Generally, "using" SessionManager will be calling ->getSessionById() or
  *  ::getGlobalSession() (depending on whether you were passing $sessionId
  *  here), then calling $session->persist().
index c60311f..d7f1189 100644 (file)
@@ -715,7 +715,7 @@ if ( !is_object( $wgAuth ) ) {
 // Set up the session
 $ps_session = Profiler::instance()->scopedProfileIn( $fname . '-session' );
 /**
- * @var MediaWiki\\Session\\SessionId|null $wgInitialSessionId The persistent
+ * @var MediaWiki\Session\SessionId|null $wgInitialSessionId The persistent
  * session ID (if any) loaded at startup
  */
 $wgInitialSessionId = null;
index f4b4871..b18d59c 100644 (file)
@@ -23,6 +23,8 @@
  * @file
  */
 
+use MediaWiki\Session\Session;
+use MediaWiki\Session\SessionId;
 use MediaWiki\Session\SessionManager;
 
 /**
@@ -66,7 +68,7 @@ class WebRequest {
        protected $protocol;
 
        /**
-        * @var \\MediaWiki\\Session\\SessionId|null Session ID to use for this
+        * @var SessionId|null Session ID to use for this
         *  request. We can't save the session directly due to reference cycles not
         *  working too well (slow GC in Zend and never collected in HHVM).
         */
@@ -670,7 +672,7 @@ class WebRequest {
         * @since 1.27
         * @note For performance, keep the session locally if you will be making
         *  much use of it instead of calling this method repeatedly.
-        * @return MediaWiki\\Session\\Session
+        * @return Session
         */
        public function getSession() {
                if ( $this->sessionId !== null ) {
@@ -688,18 +690,18 @@ class WebRequest {
        /**
         * Set the session for this request
         * @since 1.27
-        * @private For use by MediaWiki\\Session classes only
-        * @param MediaWiki\\Session\\SessionId $sessionId
+        * @private For use by MediaWiki\Session classes only
+        * @param SessionId $sessionId
         */
-       public function setSessionId( MediaWiki\Session\SessionId $sessionId ) {
+       public function setSessionId( SessionId $sessionId ) {
                $this->sessionId = $sessionId;
        }
 
        /**
         * Get the session id for this request, if any
         * @since 1.27
-        * @private For use by MediaWiki\\Session classes only
-        * @return MediaWiki\\Session\\SessionId|null
+        * @private For use by MediaWiki\Session classes only
+        * @return SessionId|null
         */
        public function getSessionId() {
                return $this->sessionId;
@@ -710,7 +712,7 @@ class WebRequest {
         * This does not necessarily mean that the user is logged in!
         *
         * @deprecated since 1.27, use
-        *  \\MediaWiki\\Session\\SessionManager::singleton()->getPersistedSessionId()
+        *  \MediaWiki\Session\SessionManager::singleton()->getPersistedSessionId()
         *  instead.
         * @return bool
         */
index cc829aa..de5a377 100644 (file)
@@ -59,7 +59,7 @@ class ApiQueryTokens extends ApiQueryBase {
         * @return (string|array)[] Returning a string will use that as the salt
         *  for User::getEditTokenObject() to fetch the token, which will give a
         *  LoggedOutEditToken (always "+\\") for anonymous users. Returning an
-        *  array will use it as parameters to MediaWiki\\Session\\Session::getToken(),
+        *  array will use it as parameters to MediaWiki\Session\Session::getToken(),
         *  which will always return a full token even for anonymous users.
         */
        public static function getTokenTypeSalts() {
@@ -84,14 +84,14 @@ class ApiQueryTokens extends ApiQueryBase {
        /**
         * Get a token from a salt
         * @param User $user
-        * @param MediaWiki\\Session\\Session $session
+        * @param MediaWiki\Session\Session $session
         * @param string|array $salt A string will be used as the salt for
         *  User::getEditTokenObject() to fetch the token, which will give a
         *  LoggedOutEditToken (always "+\\") for anonymous users. An array will
-        *  be used as parameters to MediaWiki\\Session\\Session::getToken(), which
+        *  be used as parameters to MediaWiki\Session\Session::getToken(), which
         *  will always return a full token even for anonymous users. An array will
         *  also persist the session.
-        * @return MediaWiki\\Session\\Token
+        * @return MediaWiki\Session\Token
         */
        public static function getToken( User $user, MediaWiki\Session\Session $session, $salt ) {
                if ( is_array( $salt ) ) {
index 6ad2e37..bd0b120 100644 (file)
 class PermissionsError extends ErrorPageError {
        public $permission, $errors;
 
+       /**
+        * @param string $permission A permission name.
+        * @param string[] $errors Error message keys
+        */
        public function __construct( $permission, $errors = [] ) {
                global $wgLang;
 
index 70bbf6c..64fe7ed 100644 (file)
@@ -6,7 +6,7 @@
  * wish to add a submit button to a form.
  *
  * Additional recognized configuration parameters include:
- * - flags: OOUI flags for the button, see OOUI\\FlaggedElement
+ * - flags: OOUI flags for the button, see OOUI\FlaggedElement
  * - buttonlabel-message: Message to use for the button display text, instead
  *   of the value from 'default'. Overrides 'buttonlabel' and 'buttonlabel-raw'.
  * - buttonlabel: Text to display for the button display text, instead
index b410e03..4188f4f 100644 (file)
@@ -335,7 +335,7 @@ final class Session implements \Countable, \Iterator, \ArrayAccess {
         *
         * @param string|string[] $salt Token salt
         * @param string $key Token key
-        * @return MediaWiki\\Session\\Token
+        * @return Token
         */
        public function getToken( $salt = '', $key = 'default' ) {
                $new = false;
index 1e2b476..2626aa8 100644 (file)
@@ -31,7 +31,7 @@ use WebRequest;
 /**
  * This is the actual workhorse for Session.
  *
- * Most code does not need to use this class, you want \\MediaWiki\\Session\\Session.
+ * Most code does not need to use this class, you want \MediaWiki\Session\Session.
  * The exceptions are SessionProviders and SessionMetadata hook functions,
  * which get an instance of this class rather than Session.
  *
@@ -176,7 +176,7 @@ final class SessionBackend {
 
        /**
         * Deregister a Session
-        * @private For use by \\MediaWiki\\Session\\Session::__destruct() only
+        * @private For use by \MediaWiki\Session\Session::__destruct() only
         * @param int $index
         */
        public function deregisterSession( $index ) {
@@ -498,7 +498,7 @@ final class SessionBackend {
         * Note the caller is responsible for calling $this->dirty() if anything in
         * the array is changed.
         *
-        * @private For use by \\MediaWiki\\Session\\Session only.
+        * @private For use by \MediaWiki\Session\Session only.
         * @return array
         */
        public function &getData() {
@@ -530,7 +530,7 @@ final class SessionBackend {
 
        /**
         * Mark data as dirty
-        * @private For use by \\MediaWiki\\Session\\Session only.
+        * @private For use by \MediaWiki\Session\Session only.
         */
        public function dirty() {
                $this->dataDirty = true;
index 0669100..33ea046 100644 (file)
@@ -56,7 +56,7 @@ final class SessionId {
 
        /**
         * Set the ID
-        * @private For use by \\MediaWiki\\Session\\SessionManager only
+        * @private For use by \MediaWiki\Session\SessionManager only
         * @param string $id
         */
        public function setId( $id ) {
index da7bc57..fc73335 100644 (file)
@@ -552,7 +552,7 @@ final class SessionManager implements SessionManagerInterface {
         * The intention is that the named account will never again be usable for
         * normal login (i.e. there is no way to undo the prevention of access).
         *
-        * @private For use from \\User::newSystemUser only
+        * @private For use from \User::newSystemUser only
         * @param string $username
         */
        public function preventSessionsForUser( $username ) {
@@ -1026,7 +1026,7 @@ final class SessionManager implements SessionManagerInterface {
 
        /**
         * Deregister a SessionBackend
-        * @private For use from \\MediaWiki\\Session\\SessionBackend only
+        * @private For use from \MediaWiki\Session\SessionBackend only
         * @param SessionBackend $backend
         */
        public function deregisterSessionBackend( SessionBackend $backend ) {
@@ -1044,7 +1044,7 @@ final class SessionManager implements SessionManagerInterface {
 
        /**
         * Change a SessionBackend's ID
-        * @private For use from \\MediaWiki\\Session\\SessionBackend only
+        * @private For use from \MediaWiki\Session\SessionBackend only
         * @param SessionBackend $backend
         */
        public function changeBackendId( SessionBackend $backend ) {
index 14af630..b3e28fe 100644 (file)
@@ -43,7 +43,7 @@ interface SessionManagerInterface extends LoggerAwareInterface {
         * @param WebRequest $request Any existing associated session will be reset
         *  to the session corresponding to the data in the request itself.
         * @return Session
-        * @throws \\OverflowException if there are multiple sessions tied for top
+        * @throws \OverflowException if there are multiple sessions tied for top
         *  priority in the request. Exception has a property "sessionInfos"
         *  holding the SessionInfo objects for the sessions involved.
         */
index 1975ee8..8ee1272 100644 (file)
@@ -145,7 +145,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * @note The SessionProvider must not attempt to auto-create users.
         *  MediaWiki will do this later (when it's safe) if the chosen session has
         *  a user with a valid name but no ID.
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @param WebRequest $request
         * @return SessionInfo|null
         */
@@ -158,7 +158,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * implementation assumes that it only makes sense if a session ID can be
         * persisted and changing users is allowed.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @param string|null $id ID to force for the new session
         * @return SessionInfo|null
         *  If non-null, must return true for $info->isIdSafe(); pass true for
@@ -182,7 +182,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * The default implementation checks that anything in both arrays is
         * identical, then returns $providedMetadata.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @param array $savedMetadata Saved provider metadata
         * @param array $providedMetadata Provided provider metadata
         * @return array Resulting metadata
@@ -209,7 +209,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * allows for updating the provider metadata. On failure, the provider is
         * expected to write an appropriate message to its logger.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @param SessionInfo $info
         * @param WebRequest $request
         * @param array|null &$metadata Provider metadata, may be altered.
@@ -242,7 +242,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * the session ID into a cookie can easily just set the cookie to a
         * different value.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionBackend only
+        * @protected For use by \MediaWiki\Session\SessionBackend only
         * @return bool
         */
        abstract public function persistsSessionId();
@@ -269,7 +269,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * different user. A session provider that shoves information into cookies,
         * on the other hand, could easily do so.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionBackend only
+        * @protected For use by \MediaWiki\Session\SessionBackend only
         * @return bool
         */
        abstract public function canChangeUser();
@@ -279,7 +279,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         *
         * No need to persist here, persistSession() will be called if appropriate.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionBackend only
+        * @protected For use by \MediaWiki\Session\SessionBackend only
         * @param SessionBackend $session Session to persist
         * @param string $oldId Old session ID
         * @codeCoverageIgnore
@@ -310,7 +310,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * A backend that cannot persist sesison ID or user info should implement
         * this as a no-op.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionBackend only
+        * @protected For use by \MediaWiki\Session\SessionBackend only
         * @param SessionBackend $session Session to persist
         * @param WebRequest $request Request into which to persist the session
         */
@@ -324,7 +324,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * A backend that cannot persist sesison ID or user info should implement
         * this as a no-op.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @param WebRequest $request Request from which to remove any session data
         */
        abstract public function unpersistSession( WebRequest $request );
@@ -347,7 +347,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         * User::idFromName( $username ) === 0); the name should still be
         * prevented, if applicable.
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @param string $username
         */
        public function preventSessionsForUser( $username ) {
@@ -368,7 +368,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         *  }
         * @endcode
         *
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @return array
         */
        public function getVaryHeaders() {
@@ -377,7 +377,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
 
        /**
         * Return the list of cookies that need varying on.
-        * @protected For use by \\MediaWiki\\Session\\SessionManager only
+        * @protected For use by \MediaWiki\Session\SessionManager only
         * @return string[]
         */
        public function getVaryCookies() {
@@ -386,7 +386,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
 
        /**
         * Get a suggested username for the login form
-        * @protected For use by \\MediaWiki\\Session\\SessionBackend only
+        * @protected For use by \MediaWiki\Session\SessionBackend only
         * @param WebRequest $request
         * @return string|null
         */
@@ -424,7 +424,7 @@ abstract class SessionProvider implements SessionProviderInterface, LoggerAwareI
         *
         * This default implementation takes the class name, lowercases it,
         * replaces backslashes with dashes, and prefixes 'sessionprovider-' to
-        * determine the message key. For example, MediaWiki\\Session\\CookieSessionProvider
+        * determine the message key. For example, MediaWiki\Session\CookieSessionProvider
         * produces 'sessionprovider-mediawiki-session-cookiesessionprovider'.
         *
         * @note If self::__toString() is overridden, this will likely need to be
index 49d3345..9901d36 100644 (file)
@@ -1647,8 +1647,8 @@ class LoginForm extends SpecialPage {
 
        /**
         * Get the login token from the current session
-        * @since 1.27 returns a MediaWiki\\Session\\Token instead of a string
-        * @return MediaWiki\\Session\\Token
+        * @since 1.27 returns a MediaWiki\Session\Token instead of a string
+        * @return MediaWiki\Session\Token
         */
        public static function getLoginToken() {
                global $wgRequest;
@@ -1678,8 +1678,8 @@ class LoginForm extends SpecialPage {
 
        /**
         * Get the createaccount token from the current session
-        * @since 1.27 returns a MediaWiki\\Session\\Token instead of a string
-        * @return MediaWiki\\Session\\Token
+        * @since 1.27 returns a MediaWiki\Session\Token instead of a string
+        * @return MediaWiki\Session\Token
         */
        public static function getCreateaccountToken() {
                global $wgRequest;
index 7a70773..5444a51 100644 (file)
@@ -26,7 +26,7 @@ use MediaWiki\Session\Token;
 /**
  * Value object representing a logged-out user's edit token
  *
- * This exists so that code generically dealing with MediaWiki\\Session\\Token
+ * This exists so that code generically dealing with MediaWiki\Session\Token
  * (i.e. the API) doesn't have to have so many special cases for anon edit
  * tokens.
  *
index bd1a642..e5bb082 100644 (file)
@@ -25,7 +25,7 @@ use MediaWiki\Session\Token;
 
 /**
  * String Some punctuation to prevent editing from broken text-mangling proxies.
- * @deprecated since 1.27, use \\MediaWiki\\Session\\Token::SUFFIX
+ * @deprecated since 1.27, use \MediaWiki\Session\Token::SUFFIX
  * @ingroup Constants
  */
 define( 'EDIT_TOKEN_SUFFIX', Token::SUFFIX );
@@ -54,7 +54,7 @@ class User implements IDBAccessObject {
        /**
         * Global constant made accessible as class constants so that autoloader
         * magic can be used.
-        * @deprecated since 1.27, use \\MediaWiki\\Session\\Token::SUFFIX
+        * @deprecated since 1.27, use \MediaWiki\Session\Token::SUFFIX
         */
        const EDIT_TOKEN_SUFFIX = EDIT_TOKEN_SUFFIX;
 
@@ -4200,7 +4200,7 @@ class User implements IDBAccessObject {
         * @since 1.27
         * @param string|array $salt Array of Strings Optional function-specific data for hashing
         * @param WebRequest|null $request WebRequest object to use or null to use $wgRequest
-        * @return MediaWiki\\Session\\Token The new edit token
+        * @return MediaWiki\Session\Token The new edit token
         */
        public function getEditTokenObject( $salt = '', $request = null ) {
                if ( $this->isAnon() ) {
@@ -4230,7 +4230,7 @@ class User implements IDBAccessObject {
 
        /**
         * Get the embedded timestamp from a token.
-        * @deprecated since 1.27, use \\MediaWiki\\Session\\Token::getTimestamp instead.
+        * @deprecated since 1.27, use \MediaWiki\Session\Token::getTimestamp instead.
         * @param string $val Input token
         * @return int|null
         */