Index: trunk/phase3/includes/WebRequest.php |
— | — | @@ -37,8 +37,13 @@ |
38 | 38 | */ |
39 | 39 | class WebRequest { |
40 | 40 | protected $data, $headers = array(); |
41 | | - private $_response; |
42 | 41 | |
| 42 | + /** |
| 43 | + * Lazy-init response object |
| 44 | + * @var WebResponse |
| 45 | + */ |
| 46 | + private $response; |
| 47 | + |
43 | 48 | public function __construct() { |
44 | 49 | /// @todo Fixme: this preemptive de-quoting can interfere with other web libraries |
45 | 50 | /// and increases our memory footprint. It would be cleaner to do on |
— | — | @@ -665,11 +670,11 @@ |
666 | 671 | */ |
667 | 672 | public function response() { |
668 | 673 | /* Lazy initialization of response object for this request */ |
669 | | - if ( !is_object( $this->_response ) ) { |
| 674 | + if ( !is_object( $this->response ) ) { |
670 | 675 | $class = ( $this instanceof FauxRequest ) ? 'FauxResponse' : 'WebResponse'; |
671 | | - $this->_response = new $class(); |
| 676 | + $this->response = new $class(); |
672 | 677 | } |
673 | | - return $this->_response; |
| 678 | + return $this->response; |
674 | 679 | } |
675 | 680 | |
676 | 681 | /** |