From: Gergő Tisza Date: Wed, 6 Apr 2016 22:22:33 +0000 (+0200) Subject: Change \\ to \ in phpdoc X-Git-Tag: 1.31.0-rc.0~7348^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=4085db348edbcae180a79aa3d41891a12958541c;p=lhc%2Fweb%2Fwiklou.git Change \\ to \ in phpdoc 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 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 65032ad6e9..4c70ea55d7 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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; diff --git a/includes/FauxRequest.php b/includes/FauxRequest.php index c2108f207a..158c8521fe 100644 --- a/includes/FauxRequest.php +++ b/includes/FauxRequest.php @@ -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 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3fa91fa700..e8d077b9a9 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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(). diff --git a/includes/Setup.php b/includes/Setup.php index c60311f4c1..d7f1189a77 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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; diff --git a/includes/WebRequest.php b/includes/WebRequest.php index f4b4871ee9..b18d59cb1d 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -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 */ diff --git a/includes/api/ApiQueryTokens.php b/includes/api/ApiQueryTokens.php index cc829aa8a1..de5a377417 100644 --- a/includes/api/ApiQueryTokens.php +++ b/includes/api/ApiQueryTokens.php @@ -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 ) ) { diff --git a/includes/exception/PermissionsError.php b/includes/exception/PermissionsError.php index 6ad2e37f10..bd0b1204d4 100644 --- a/includes/exception/PermissionsError.php +++ b/includes/exception/PermissionsError.php @@ -28,6 +28,10 @@ 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; diff --git a/includes/htmlform/HTMLButtonField.php b/includes/htmlform/HTMLButtonField.php index 70bbf6cc36..64fe7eda9b 100644 --- a/includes/htmlform/HTMLButtonField.php +++ b/includes/htmlform/HTMLButtonField.php @@ -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 diff --git a/includes/session/Session.php b/includes/session/Session.php index b410e03d6b..4188f4f308 100644 --- a/includes/session/Session.php +++ b/includes/session/Session.php @@ -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; diff --git a/includes/session/SessionBackend.php b/includes/session/SessionBackend.php index 1e2b476baf..2626aa8813 100644 --- a/includes/session/SessionBackend.php +++ b/includes/session/SessionBackend.php @@ -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; diff --git a/includes/session/SessionId.php b/includes/session/SessionId.php index 0669100784..33ea046ce4 100644 --- a/includes/session/SessionId.php +++ b/includes/session/SessionId.php @@ -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 ) { diff --git a/includes/session/SessionManager.php b/includes/session/SessionManager.php index da7bc57334..fc73335244 100644 --- a/includes/session/SessionManager.php +++ b/includes/session/SessionManager.php @@ -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 ) { diff --git a/includes/session/SessionManagerInterface.php b/includes/session/SessionManagerInterface.php index 14af630bc0..b3e28fe127 100644 --- a/includes/session/SessionManagerInterface.php +++ b/includes/session/SessionManagerInterface.php @@ -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. */ diff --git a/includes/session/SessionProvider.php b/includes/session/SessionProvider.php index 1975ee8344..8ee1272294 100644 --- a/includes/session/SessionProvider.php +++ b/includes/session/SessionProvider.php @@ -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 diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 49d3345802..9901d36bbe 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -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; diff --git a/includes/user/LoggedOutEditToken.php b/includes/user/LoggedOutEditToken.php index 7a70773f83..5444a51fc6 100644 --- a/includes/user/LoggedOutEditToken.php +++ b/includes/user/LoggedOutEditToken.php @@ -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. * diff --git a/includes/user/User.php b/includes/user/User.php index bd1a642bf4..e5bb08253b 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -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 */