jenkins-bot has submitted this change and it was merged.

Change subject: Set parameter default to array() in WebResponse::setcookie()
......................................................................


Set parameter default to array() in WebResponse::setcookie()

This is a direct follow-up for the question raised in Ifab16c2.
Null is not a meaningful value in this case. As far as I can see the
only reason it was added was to make the parameter optional. Optional
array parameters are better marked with "= array()".

Change-Id: I86965d390fdb718de7fb81a9f4c48b2261c16aa9
---
M includes/WebResponse.php
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/WebResponse.php b/includes/WebResponse.php
index 83ac51a..ab34931 100644
--- a/includes/WebResponse.php
+++ b/includes/WebResponse.php
@@ -60,7 +60,7 @@
         * @param int|null $expire Unix timestamp (in seconds) when the cookie 
should expire.
         *        0 (the default) causes it to expire $wgCookieExpiration 
seconds from now.
         *        null causes it to be a session cookie.
-        * @param array|null $options Assoc of additional cookie options:
+        * @param array $options Assoc of additional cookie options:
         *     prefix: string, name prefix ($wgCookiePrefix)
         *     domain: string, cookie domain ($wgCookieDomain)
         *     path: string, cookie path ($wgCookiePath)
@@ -72,7 +72,7 @@
         *   'prefix', 'domain', and 'secure'
         * @since 1.22 Replaced $prefix, $domain, and $forceSecure with $options
         */
-       public function setcookie( $name, $value, $expire = 0, $options = null 
) {
+       public function setcookie( $name, $value, $expire = 0, $options = 
array() ) {
                global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain;
                global $wgCookieSecure, $wgCookieExpiration, $wgCookieHttpOnly;
 
@@ -188,9 +188,9 @@
         * @param string $name The name of the cookie.
         * @param string $value The value to be stored in the cookie.
         * @param int|null $expire Ignored in this faux subclass.
-        * @param array|null $options Ignored in this faux subclass.
+        * @param array $options Ignored in this faux subclass.
         */
-       public function setcookie( $name, $value, $expire = 0, $options = null 
) {
+       public function setcookie( $name, $value, $expire = 0, $options = 
array() ) {
                $this->cookies[$name] = $value;
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I86965d390fdb718de7fb81a9f4c48b2261c16aa9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to