r108397 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108396‎ | r108397 | r108398 >
Date:10:42, 9 January 2012
Author:hashar
Status:ok (Comments)
Tags:
Comment:
FauxRequest now has empty data per default
Modified paths:
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WebRequest.php
@@ -1199,7 +1199,7 @@
12001200 * @param $wasPosted Bool: whether to treat the data as POST
12011201 * @param $session Mixed: session array or null
12021202 */
1203 - public function __construct( $data, $wasPosted = false, $session = null ) {
 1203+ public function __construct( $data = array(), $wasPosted = false, $session = null ) {
12041204 if( is_array( $data ) ) {
12051205 $this->data = $data;
12061206 } else {

Comments

#Comment by Nikerabbit (talk | contribs)   17:14, 9 January 2012

I can see that, but why?

#Comment by Hashar (talk | contribs)   19:36, 9 January 2012

Because I dislike having the following code triggering an error:

$req = new FauxRequest();

It is dumb to be forced to pass an empty array() :D

Status & tagging log