Skip to content

Commit

Permalink
Removing unneeded assignments by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Apr 29, 2011
1 parent 228230e commit 07b84a7
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Utility/Sanitize.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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']) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper.php
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/elements/sql_dump.ctp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/tests/Case/Console/Command/SchemaShellTest.php
Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/tests/Case/I18n/I18nTest.php
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/tests/Case/Model/Behavior/AclBehaviorTest.php
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/tests/Case/Model/ModelDeleteTest.php
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/tests/Case/Model/ModelValidationTest.php
Expand Up @@ -565,7 +565,7 @@ function testValidatesWithAssociations() {
);

$Something = new Something();
$JoinThing =& $Something->JoinThing;
$JoinThing = $Something->JoinThing;

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

Expand Down Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/tests/Case/Model/ModelWriteTest.php
Expand Up @@ -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;
Expand Down

0 comments on commit 07b84a7

Please sign in to comment.