From eaa6c6c49d02d99bd7e44cc3ca1a7be81c9b44c9 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Fri, 25 Mar 2011 18:02:24 +1300 Subject: [PATCH] API-CHANGE: removing protected object_to_array method (use get_object_vars instead) --- core/ArrayData.php | 12 ------------ tests/ArrayDataTest.php | 17 ----------------- 2 files changed, 29 deletions(-) diff --git a/core/ArrayData.php b/core/ArrayData.php index 4d07b1b81..bb32c5dc5 100755 --- a/core/ArrayData.php +++ b/core/ArrayData.php @@ -89,18 +89,6 @@ class ArrayData extends ViewableData { return isset($this->array[$f]); } - /** - * @deprecated Use get_object_vars($obj) - * Converts an object with simple properties to - * an associative array. - * - * @param obj $obj - * @return array - */ - protected static function object_to_array($obj) { - return get_object_vars($obj); - } - /** * Converts an associative array to a simple object * diff --git a/tests/ArrayDataTest.php b/tests/ArrayDataTest.php index 6f5c931ea..8b8ff58e7 100644 --- a/tests/ArrayDataTest.php +++ b/tests/ArrayDataTest.php @@ -67,15 +67,6 @@ class ArrayDataTest extends SapphireTest { $this->assertEquals("array (\n 'b' => 'bunny',\n)", $arrayData->forTemplate()); } - function testObjectToArrayWorks() { - $object = new ArrayDataTest_NonEmptyObject(); - - $array = ArrayDataTest_ArrayData_Exposed::object_to_array($object); - - $this->assertEquals("Apple", $array['a']); - $this->assertEquals("Banana", $array['b']); - } - function testSetField() { $arrayData = new ArrayData(array()); @@ -108,14 +99,6 @@ class ArrayDataTest extends SapphireTest { } -class ArrayDataTest_ArrayData_Exposed extends ArrayData { - - public static function object_to_array($obj) { - return parent::object_to_array($obj); - } - -} - class ArrayDataTest_NonEmptyObject { static $c = "Cucumber";