From 07b84a71ab4dbf056eb98241ca06181a51759a55 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Fri, 29 Apr 2011 11:19:33 -0430 Subject: [PATCH] Removing unneeded assignments by reference --- lib/Cake/Utility/Sanitize.php | 8 ++++---- lib/Cake/View/Helper.php | 2 +- lib/Cake/View/Helper/FormHelper.php | 2 +- lib/Cake/View/elements/sql_dump.ctp | 2 +- lib/Cake/tests/Case/Console/Command/SchemaShellTest.php | 2 +- lib/Cake/tests/Case/I18n/I18nTest.php | 2 +- lib/Cake/tests/Case/Model/Behavior/AclBehaviorTest.php | 2 +- lib/Cake/tests/Case/Model/ModelDeleteTest.php | 2 +- lib/Cake/tests/Case/Model/ModelValidationTest.php | 4 ++-- lib/Cake/tests/Case/Model/ModelWriteTest.php | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/Cake/Utility/Sanitize.php b/lib/Cake/Utility/Sanitize.php index 151fbb6caec..f521654f3d0 100644 --- a/lib/Cake/Utility/Sanitize.php +++ b/lib/Cake/Utility/Sanitize.php @@ -63,7 +63,7 @@ public static function paranoid($string, $allowed = array()) { * @return string SQL safe string */ public static function escape($string, $connection = 'default') { - $db =& ConnectionManager::getDataSource($connection); + $db = ConnectionManager::getDataSource($connection); if (is_numeric($string) || $string === null || is_bool($string)) { return $string; } @@ -266,9 +266,9 @@ public static function clean($data, $options = array()) { public static function formatColumns($model) { foreach ($model->data as $name => $values) { if ($name == $model->alias) { - $curModel =& $model; + $curModel = $model; } elseif (isset($model->{$name}) && is_object($model->{$name}) && is_subclass_of($model->{$name}, 'Model')) { - $curModel =& $model->{$name}; + $curModel = $model->{$name}; } else { $curModel = null; } @@ -278,7 +278,7 @@ public static function formatColumns($model) { $colType = $curModel->getColumnType($column); if ($colType != null) { - $db =& ConnectionManager::getDataSource($curModel->useDbConfig); + $db = ConnectionManager::getDataSource($curModel->useDbConfig); $colData = $db->columns[$colType]; if (isset($colData['limit']) && strlen(strval($data)) > $colData['limit']) { diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index cba5786addd..25ead795294 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -692,7 +692,7 @@ public function value($options = array(), $field = null, $key = 'value') { $result = $data[$habtmKey][$habtmKey]; } elseif (empty($result) && isset($data[$habtmKey]) && is_array($data[$habtmKey])) { if (ClassRegistry::isKeySet($habtmKey)) { - $model =& ClassRegistry::getObject($habtmKey); + $model = ClassRegistry::getObject($habtmKey); $result = $this->__selectedArray($data[$habtmKey], $model->primaryKey); } } diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 8d806e2a1b4..48ac32b08f4 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -204,7 +204,7 @@ function create($model = null, $options = array()) { $models = ClassRegistry::keys(); foreach ($models as $currentModel) { if (ClassRegistry::isKeySet($currentModel)) { - $currentObject =& ClassRegistry::getObject($currentModel); + $currentObject = ClassRegistry::getObject($currentModel); if (is_a($currentObject, 'Model') && !empty($currentObject->validationErrors)) { $this->validationErrors[Inflector::camelize($currentModel)] =& $currentObject->validationErrors; } diff --git a/lib/Cake/View/elements/sql_dump.ctp b/lib/Cake/View/elements/sql_dump.ctp index 5bc41ea1083..4d6919203ee 100644 --- a/lib/Cake/View/elements/sql_dump.ctp +++ b/lib/Cake/View/elements/sql_dump.ctp @@ -25,7 +25,7 @@ if ($noLogs): $logs = array(); foreach ($sources as $source): - $db =& ConnectionManager::getDataSource($source); + $db = ConnectionManager::getDataSource($source); if (!method_exists($db, 'getLog')): continue; endif; diff --git a/lib/Cake/tests/Case/Console/Command/SchemaShellTest.php b/lib/Cake/tests/Case/Console/Command/SchemaShellTest.php index ce48e062686..8eea33027e6 100644 --- a/lib/Cake/tests/Case/Console/Command/SchemaShellTest.php +++ b/lib/Cake/tests/Case/Console/Command/SchemaShellTest.php @@ -473,7 +473,7 @@ public function testPluginDotSyntaxWithCreate() { $this->Shell->expects($this->any())->method('in')->will($this->returnValue('y')); $this->Shell->create(); - $db =& ConnectionManager::getDataSource('test'); + $db = ConnectionManager::getDataSource('test'); $sources = $db->listSources(); $this->assertTrue(in_array($db->config['prefix'] . 'test_plugin_acos', $sources)); diff --git a/lib/Cake/tests/Case/I18n/I18nTest.php b/lib/Cake/tests/Case/I18n/I18nTest.php index a5de7dd496b..37dace72475 100644 --- a/lib/Cake/tests/Case/I18n/I18nTest.php +++ b/lib/Cake/tests/Case/I18n/I18nTest.php @@ -55,7 +55,7 @@ function tearDown() { function testTranslationCaching() { Configure::write('Config.language', 'cache_test_po'); - $i18n =& i18n::getInstance(); + $i18n = i18n::getInstance(); // reset internally stored entries I18n::clear(); diff --git a/lib/Cake/tests/Case/Model/Behavior/AclBehaviorTest.php b/lib/Cake/tests/Case/Model/Behavior/AclBehaviorTest.php index a6f29cfe69c..df8fb3f5081 100644 --- a/lib/Cake/tests/Case/Model/Behavior/AclBehaviorTest.php +++ b/lib/Cake/tests/Case/Model/Behavior/AclBehaviorTest.php @@ -266,7 +266,7 @@ public function testSetup() { * @access public */ function testSetupMulti() { - $User =& new AclPerson(); + $User = new AclPerson(); $this->assertTrue(isset($User->Behaviors->Acl->settings['AclPerson'])); $this->assertEqual($User->Behaviors->Acl->settings['AclPerson']['type'], 'both'); $this->assertTrue(is_object($User->Aro)); diff --git a/lib/Cake/tests/Case/Model/ModelDeleteTest.php b/lib/Cake/tests/Case/Model/ModelDeleteTest.php index 8ec9aaa1c37..bbd3560029c 100644 --- a/lib/Cake/tests/Case/Model/ModelDeleteTest.php +++ b/lib/Cake/tests/Case/Model/ModelDeleteTest.php @@ -540,7 +540,7 @@ function testDeleteLinks() { */ function testDeleteLinksWithPLuginJoinModel() { $this->loadFixtures('Article', 'ArticlesTag', 'Tag'); - $Article =& new Article(); + $Article = new Article(); $Article->unbindModel(array('hasAndBelongsToMany' => array('Tag')), false); unset($Article->Tag, $Article->ArticleTags); $Article->bindModel(array('hasAndBelongsToMany' => array( diff --git a/lib/Cake/tests/Case/Model/ModelValidationTest.php b/lib/Cake/tests/Case/Model/ModelValidationTest.php index 8cc48aa3fae..2182637c87b 100644 --- a/lib/Cake/tests/Case/Model/ModelValidationTest.php +++ b/lib/Cake/tests/Case/Model/ModelValidationTest.php @@ -565,7 +565,7 @@ function testValidatesWithAssociations() { ); $Something = new Something(); - $JoinThing =& $Something->JoinThing; + $JoinThing = $Something->JoinThing; $JoinThing->validate = array('doomed' => array('rule' => 'notEmpty')); @@ -618,7 +618,7 @@ function testValidatesWithModelsAndSaveAll() { ) ); $Something = new Something(); - $JoinThing =& $Something->JoinThing; + $JoinThing = $Something->JoinThing; $JoinThing->validate = array('doomed' => array('rule' => 'notEmpty')); $expectedError = array('doomed' => array('This field cannot be left blank')); diff --git a/lib/Cake/tests/Case/Model/ModelWriteTest.php b/lib/Cake/tests/Case/Model/ModelWriteTest.php index 466c703d82f..ce67f520059 100644 --- a/lib/Cake/tests/Case/Model/ModelWriteTest.php +++ b/lib/Cake/tests/Case/Model/ModelWriteTest.php @@ -3016,7 +3016,7 @@ function testSaveAllAssociatedTransactionNoRollback() { $testDb = ConnectionManager::getDataSource('test'); $mock = $this->getMock('DboSource', array(), array(), 'MockTransactionAssociatedDboSource', false); - $db =& ConnectionManager::create('mock_transaction_assoc', array( + $db = ConnectionManager::create('mock_transaction_assoc', array( 'datasource' => 'MockTransactionAssociatedDboSource', )); $this->mockObjects[] = $db;