← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1743: [xml/dom] Don't use reference operator for objects

 

------------------------------------------------------------
revno: 1743
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Wed 2010-01-06 21:30:14 +0100
message:
  [xml/dom] Don't use reference operator for objects
  
  Objects are referenced by default.
modified:
  xml/dom.lib.php


--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.
=== modified file 'xml/dom.lib.php'
--- xml/dom.lib.php	2009-02-16 17:33:29 +0000
+++ xml/dom.lib.php	2010-01-06 20:30:14 +0000
@@ -233,12 +233,11 @@
 				}
 			}
 		} else {
-			$this->child_nodes[] = &$new_child;
-			$new_child->parent_node = &$this;
-			$out = &$new_child; 
+			$this->child_nodes[] = $new_child;
+			$new_child->parent_node = $this;
+			$out = $new_child; 
 		}
 
-		unset ($new_child);
 		return $out;
 	}
 
@@ -251,7 +250,7 @@
 	 * \param $new_children
 	 *   Array of children elements
 	 */
-	public function append_children(&$new_children)
+	public function append_children($new_children)
 	{
 		assert('is_numeric_array($new_children);');
 
@@ -286,7 +285,7 @@
 	 *
 	 * \see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1734834066
 	 */
-	public function &remove_child(&$old_child)
+	public function remove_child($old_child)
 	{
 		assert('!$this->must_be_empty; // cannot remove content from empty nodes');
 		assert('$old_child instanceof AnewtXMLDomNode;');
@@ -336,7 +335,7 @@
 	 *
 	 * \see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-785887307
 	 */
-	public function &replace_child(&$new_child, &$old_child)
+	public function replace_child($new_child, $old_child)
 	{
 		assert('$new_child instanceof AnewtXMLDomNode;');
 		assert('$old_child instanceof AnewtXMLDomNode;');
@@ -362,7 +361,7 @@
 	 *
 	 * \see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-952280727
 	 */
-	public function &insert_before(&$new_child, &$ref_child)
+	public function insert_before($new_child, $ref_child)
 	{
 		assert('$new_child instanceof AnewtXMLDomNode;');
 		assert('$ref_child instanceof AnewtXMLDomNode;');
@@ -614,8 +613,8 @@
 		 * checks for a single root node */
 		assert('$root_element instanceof AnewtXMLDomElement;');
 		assert('is_null($this->document_element)');
-		$this->document_element = &$root_element;
-		$root_element->parent_node = &$this;
+		$this->document_element = $root_element;
+		$root_element->parent_node = $this;
 		return $root_element;
 	}
 
@@ -635,11 +634,11 @@
 	 * \return
 	 *   New AnewtXMLDomElement instance.
 	 */
-	public function &create_element($tagname, $attributes=null)
+	public function create_element($tagname, $attributes=null)
 	{
 		$node = new AnewtXMLDomElement($tagname, $attributes);
 		$node->__object_id = $this->__object_id_counter++;
-		$node->owner_document = &$this;
+		$node->owner_document = $this;
 		return $node;
 	}
 
@@ -654,11 +653,11 @@
 	 * \return
 	 *   New AnewtXMLDomText instance.
 	 */
-	public function &create_text_node($data)
+	public function create_text_node($data)
 	{
 		$node = new AnewtXMLDomText($data);
 		$node->__object_id = $this->__object_id_counter++;
-		$node->owner_document = &$this;
+		$node->owner_document = $this;
 		return $node;
 	}
 
@@ -676,11 +675,11 @@
 	 * \return
 	 *   New AnewtXMLDomRaw instance.
 	 */
-	public function &create_raw_node($data)
+	public function create_raw_node($data)
 	{
 		$node = new AnewtXMLDomRaw($data);
 		$node->__object_id = $this->__object_id_counter++;
-		$node->owner_document = &$this;
+		$node->owner_document = $this;
 		return $node;
 	}
 
@@ -695,11 +694,11 @@
 	 * \return
 	 *   New AnewtXMLDomComment instance.
 	 */
-	public function &create_comment($data)
+	public function create_comment($data)
 	{
 		$node = new AnewtXMLDomComment($data);
 		$node->__object_id = $this->__object_id_counter++;
-		$node->owner_document = &$this;
+		$node->owner_document = $this;
 		return $node;
 	}
 
@@ -711,11 +710,11 @@
 	 * \return
 	 *   New AnewtXMLDomDocumentFragment instance.
 	 */
-	public function &create_document_fragment()
+	public function create_document_fragment()
 	{
 		$node = new AnewtXMLDomDocumentFragment();
 		$node->__object_id = $this->__object_id_counter++;
-		$node->owner_document = &$this;
+		$node->owner_document = $this;
 		return $node;
 	}