Gergő Tisza has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/282076

Change subject: Improve phpdoc - WebRequest, Session, PermissionError
......................................................................

Improve phpdoc - WebRequest, Session, PermissionError

* add parameter docs to PermissionError constructor (parent has
  different arguments so the inherited documentation is wrong)
* remove "\\" 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.

Change-Id: I6da0f512b8c84f65fd20e90e4617108fe6a8fcd2
---
M includes/WebRequest.php
M includes/exception/PermissionsError.php
M includes/session/Session.php
3 files changed, 12 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/282076/1

diff --git a/includes/WebRequest.php b/includes/WebRequest.php
index f4b4871..f16d987 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 @@
        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 @@
         * @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 ) {
@@ -689,9 +691,9 @@
         * Set the session for this request
         * @since 1.27
         * @private For use by MediaWiki\\Session classes only
-        * @param MediaWiki\\Session\\SessionId $sessionId
+        * @param SessionId $sessionId
         */
-       public function setSessionId( MediaWiki\Session\SessionId $sessionId ) {
+       public function setSessionId( SessionId $sessionId ) {
                $this->sessionId = $sessionId;
        }
 
@@ -699,7 +701,7 @@
         * 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
+        * @return SessionId|null
         */
        public function getSessionId() {
                return $this->sessionId;
diff --git a/includes/exception/PermissionsError.php 
b/includes/exception/PermissionsError.php
index 6ad2e37..bd0b120 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/session/Session.php b/includes/session/Session.php
index b410e03..4188f4f 100644
--- a/includes/session/Session.php
+++ b/includes/session/Session.php
@@ -335,7 +335,7 @@
         *
         * @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;

-- 
To view, visit https://gerrit.wikimedia.org/r/282076
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6da0f512b8c84f65fd20e90e4617108fe6a8fcd2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to