Awight has uploaded a new change for review.

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

Change subject: Don't return a reference to object, that means nothing
......................................................................

Don't return a reference to object, that means nothing

This line of code is under suspicious of bugging out.

Change-Id: If502e05133367d3dbee573d775efd47967ed9aff
---
M Core/Configuration.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/46/313546/1

diff --git a/Core/Configuration.php b/Core/Configuration.php
index f599160..13d7e52 100644
--- a/Core/Configuration.php
+++ b/Core/Configuration.php
@@ -211,6 +211,7 @@
                 */
                if ( $node === '/' ) {
                        if ( $returnRef ) {
+                               // TODO: Don't offer a return-by-reference.
                                $options = &$this->options;
                        } else {
                                $options = $this->options;
@@ -243,8 +244,6 @@
         * key name which will be an array with at least a subkey of 'class'. 
The class will then be
         * instantiated with any arguments as given in the subkey 
'constructor-parameters'.
         *
-        * NOTE: This will return a reference to the object!
-        *
         * When arguments are given it should be a simple list with arguments 
in the expected order.
         *
         * Example:
@@ -261,7 +260,7 @@
         * @return mixed|object
         * @throws ConfigurationKeyException
         */
-       public function &object( $node, $persistent = true ) {
+       public function object( $node, $persistent = true ) {
                // First look and see if we already have a $persistent object.
                if ( array_key_exists( $node, $this->objects ) ) {
                        return $this->objects[$node];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If502e05133367d3dbee573d775efd47967ed9aff
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Awight <awi...@wikimedia.org>

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

Reply via email to