Skip to content

Commit 07b84a7

Browse files
committed
Removing unneeded assignments by reference
1 parent 228230e commit 07b84a7

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

lib/Cake/Utility/Sanitize.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function paranoid($string, $allowed = array()) {
6363
* @return string SQL safe string
6464
*/
6565
public static function escape($string, $connection = 'default') {
66-
$db =& ConnectionManager::getDataSource($connection);
66+
$db = ConnectionManager::getDataSource($connection);
6767
if (is_numeric($string) || $string === null || is_bool($string)) {
6868
return $string;
6969
}
@@ -266,9 +266,9 @@ public static function clean($data, $options = array()) {
266266
public static function formatColumns($model) {
267267
foreach ($model->data as $name => $values) {
268268
if ($name == $model->alias) {
269-
$curModel =& $model;
269+
$curModel = $model;
270270
} elseif (isset($model->{$name}) && is_object($model->{$name}) && is_subclass_of($model->{$name}, 'Model')) {
271-
$curModel =& $model->{$name};
271+
$curModel = $model->{$name};
272272
} else {
273273
$curModel = null;
274274
}
@@ -278,7 +278,7 @@ public static function formatColumns($model) {
278278
$colType = $curModel->getColumnType($column);
279279

280280
if ($colType != null) {
281-
$db =& ConnectionManager::getDataSource($curModel->useDbConfig);
281+
$db = ConnectionManager::getDataSource($curModel->useDbConfig);
282282
$colData = $db->columns[$colType];
283283

284284
if (isset($colData['limit']) && strlen(strval($data)) > $colData['limit']) {

lib/Cake/View/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ public function value($options = array(), $field = null, $key = 'value') {
692692
$result = $data[$habtmKey][$habtmKey];
693693
} elseif (empty($result) && isset($data[$habtmKey]) && is_array($data[$habtmKey])) {
694694
if (ClassRegistry::isKeySet($habtmKey)) {
695-
$model =& ClassRegistry::getObject($habtmKey);
695+
$model = ClassRegistry::getObject($habtmKey);
696696
$result = $this->__selectedArray($data[$habtmKey], $model->primaryKey);
697697
}
698698
}

lib/Cake/View/Helper/FormHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function create($model = null, $options = array()) {
204204
$models = ClassRegistry::keys();
205205
foreach ($models as $currentModel) {
206206
if (ClassRegistry::isKeySet($currentModel)) {
207-
$currentObject =& ClassRegistry::getObject($currentModel);
207+
$currentObject = ClassRegistry::getObject($currentModel);
208208
if (is_a($currentObject, 'Model') && !empty($currentObject->validationErrors)) {
209209
$this->validationErrors[Inflector::camelize($currentModel)] =& $currentObject->validationErrors;
210210
}

lib/Cake/View/elements/sql_dump.ctp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if ($noLogs):
2525

2626
$logs = array();
2727
foreach ($sources as $source):
28-
$db =& ConnectionManager::getDataSource($source);
28+
$db = ConnectionManager::getDataSource($source);
2929
if (!method_exists($db, 'getLog')):
3030
continue;
3131
endif;

lib/Cake/tests/Case/Console/Command/SchemaShellTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public function testPluginDotSyntaxWithCreate() {
473473
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
474474
$this->Shell->create();
475475

476-
$db =& ConnectionManager::getDataSource('test');
476+
$db = ConnectionManager::getDataSource('test');
477477
$sources = $db->listSources();
478478
$this->assertTrue(in_array($db->config['prefix'] . 'test_plugin_acos', $sources));
479479

lib/Cake/tests/Case/I18n/I18nTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function tearDown() {
5555

5656
function testTranslationCaching() {
5757
Configure::write('Config.language', 'cache_test_po');
58-
$i18n =& i18n::getInstance();
58+
$i18n = i18n::getInstance();
5959

6060
// reset internally stored entries
6161
I18n::clear();

lib/Cake/tests/Case/Model/Behavior/AclBehaviorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public function testSetup() {
266266
* @access public
267267
*/
268268
function testSetupMulti() {
269-
$User =& new AclPerson();
269+
$User = new AclPerson();
270270
$this->assertTrue(isset($User->Behaviors->Acl->settings['AclPerson']));
271271
$this->assertEqual($User->Behaviors->Acl->settings['AclPerson']['type'], 'both');
272272
$this->assertTrue(is_object($User->Aro));

lib/Cake/tests/Case/Model/ModelDeleteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ function testDeleteLinks() {
540540
*/
541541
function testDeleteLinksWithPLuginJoinModel() {
542542
$this->loadFixtures('Article', 'ArticlesTag', 'Tag');
543-
$Article =& new Article();
543+
$Article = new Article();
544544
$Article->unbindModel(array('hasAndBelongsToMany' => array('Tag')), false);
545545
unset($Article->Tag, $Article->ArticleTags);
546546
$Article->bindModel(array('hasAndBelongsToMany' => array(

lib/Cake/tests/Case/Model/ModelValidationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ function testValidatesWithAssociations() {
565565
);
566566

567567
$Something = new Something();
568-
$JoinThing =& $Something->JoinThing;
568+
$JoinThing = $Something->JoinThing;
569569

570570
$JoinThing->validate = array('doomed' => array('rule' => 'notEmpty'));
571571

@@ -618,7 +618,7 @@ function testValidatesWithModelsAndSaveAll() {
618618
)
619619
);
620620
$Something = new Something();
621-
$JoinThing =& $Something->JoinThing;
621+
$JoinThing = $Something->JoinThing;
622622

623623
$JoinThing->validate = array('doomed' => array('rule' => 'notEmpty'));
624624
$expectedError = array('doomed' => array('This field cannot be left blank'));

lib/Cake/tests/Case/Model/ModelWriteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,7 @@ function testSaveAllAssociatedTransactionNoRollback() {
30163016
$testDb = ConnectionManager::getDataSource('test');
30173017

30183018
$mock = $this->getMock('DboSource', array(), array(), 'MockTransactionAssociatedDboSource', false);
3019-
$db =& ConnectionManager::create('mock_transaction_assoc', array(
3019+
$db = ConnectionManager::create('mock_transaction_assoc', array(
30203020
'datasource' => 'MockTransactionAssociatedDboSource',
30213021
));
30223022
$this->mockObjects[] = $db;

0 commit comments

Comments
 (0)