Removing unneeded assignments by reference

This commit is contained in:
Jose Lorenzo Rodriguez 2011-04-29 11:19:33 -04:30
parent 228230e67b
commit 07b84a71ab
10 changed files with 14 additions and 14 deletions

View file

@ -63,7 +63,7 @@ class Sanitize {
* @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 @@ class Sanitize {
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 @@ class Sanitize {
$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']) {

View file

@ -692,7 +692,7 @@ class Helper extends Object {
$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);
}
}

View file

@ -204,7 +204,7 @@ class FormHelper extends AppHelper {
$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;
}

View file

@ -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;

View file

@ -473,7 +473,7 @@ class SchemaShellTest extends CakeTestCase {
$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));

View file

@ -55,7 +55,7 @@ class I18nTest extends CakeTestCase {
function testTranslationCaching() {
Configure::write('Config.language', 'cache_test_po');
$i18n =& i18n::getInstance();
$i18n = i18n::getInstance();
// reset internally stored entries
I18n::clear();

View file

@ -266,7 +266,7 @@ class AclBehaviorTest extends CakeTestCase {
* @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));

View file

@ -540,7 +540,7 @@ class ModelDeleteTest extends BaseModelTest {
*/
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(

View file

@ -565,7 +565,7 @@ class ModelValidationTest extends BaseModelTest {
);
$Something = new Something();
$JoinThing =& $Something->JoinThing;
$JoinThing = $Something->JoinThing;
$JoinThing->validate = array('doomed' => array('rule' => 'notEmpty'));
@ -618,7 +618,7 @@ class ModelValidationTest extends BaseModelTest {
)
);
$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'));

View file

@ -3016,7 +3016,7 @@ class ModelWriteTest extends BaseModelTest {
$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;