Skip to content

Commit 6ab1ee9

Browse files
authored
[5.3] Removing calls to legacy ->set() (joomla#44011)
* Removing calls to legacy ->set() * Codestyle * Removing additional calls
1 parent 9f5a53b commit 6ab1ee9

File tree

25 files changed

+66
-71
lines changed

25 files changed

+66
-71
lines changed

administrator/components/com_fields/tmpl/field/edit.php

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,24 @@
5555
<?php endforeach; ?>
5656
</div>
5757
<div class="col-lg-3">
58-
<?php $this->set(
59-
'fields',
60-
[
61-
[
62-
'published',
63-
'state',
64-
'enabled',
65-
],
66-
'group_id',
67-
'assigned_cat_ids',
68-
'access',
69-
'language',
70-
'note',
71-
]
72-
); ?>
58+
<?php $this->fields = [
59+
[
60+
'published',
61+
'state',
62+
'enabled',
63+
],
64+
'group_id',
65+
'assigned_cat_ids',
66+
'access',
67+
'language',
68+
'note',
69+
]; ?>
7370
<?php echo LayoutHelper::render('joomla.edit.global', $this); ?>
74-
<?php $this->set('fields', null); ?>
71+
<?php $this->fields = null; ?>
7572
</div>
7673
</div>
7774
<?php echo HTMLHelper::_('uitab.endTab'); ?>
78-
<?php $this->set('ignore_fieldsets', ['fieldparams']); ?>
75+
<?php $this->ignore_fieldsets = ['fieldparams']; ?>
7976
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
8077
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', Text::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?>
8178
<fieldset id="fieldset-publishingdata" class="options-form">

administrator/components/com_fields/tmpl/group/edit.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,22 @@
4141
<?php echo $this->form->renderField('description'); ?>
4242
</div>
4343
<div class="col-lg-3">
44-
<?php $this->set(
45-
'fields',
46-
[
47-
[
48-
'published',
49-
'state',
50-
'enabled',
51-
],
52-
'access',
53-
'language',
54-
'note',
55-
]
56-
); ?>
44+
<?php $this->fields = [
45+
[
46+
'published',
47+
'state',
48+
'enabled',
49+
],
50+
'access',
51+
'language',
52+
'note',
53+
]; ?>
5754
<?php echo LayoutHelper::render('joomla.edit.global', $this); ?>
58-
<?php $this->set('fields', null); ?>
55+
<?php $this->fields = null; ?>
5956
</div>
6057
</div>
6158
<?php echo HTMLHelper::_('uitab.endTab'); ?>
62-
<?php $this->set('ignore_fieldsets', ['fieldparams']); ?>
59+
<?php $this->ignore_fieldsets = ['fieldparams']; ?>
6360
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
6461
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', Text::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?>
6562
<fieldset id="fieldset-rules" class="options-form">

administrator/components/com_menus/src/Model/MenutypesModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getTypeOptions()
145145
*/
146146
public function addReverseLookupUrl($option)
147147
{
148-
$this->rlu[MenusHelper::getLinkKey($option->request)] = $option->get('title');
148+
$this->rlu[MenusHelper::getLinkKey($option->request)] = $option->title;
149149
}
150150

151151
/**

administrator/components/com_messages/src/Model/ConfigModel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public function getItem()
8585
}
8686

8787
foreach ($rows as $row) {
88-
$item->set($row->cfg_name, $row->cfg_value);
88+
$property = $row->cfg_name;
89+
$item->$property = $row->cfg_value;
8990
}
9091

9192
$this->preprocessData('com_messages.config', $item);

administrator/components/com_messages/src/View/Message/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function addToolbar()
105105
$sender = $this->getUserFactory()->loadUserById($this->item->user_id_from);
106106

107107
if (
108-
$sender->id !== $app->getIdentity()->get('id') && ($sender->authorise('core.admin')
108+
$sender->id !== $app->getIdentity()->id && ($sender->authorise('core.admin')
109109
|| $sender->authorise('core.manage', 'com_messages') && $sender->authorise('core.login.admin'))
110110
&& $app->getIdentity()->authorise('core.manage', 'com_users')
111111
) {

administrator/components/com_plugins/src/Helper/PluginsHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function parseXMLTemplateFile($templateBaseDir, $templateDir)
116116
}
117117

118118
foreach ($xml as $key => $value) {
119-
$data->set($key, $value);
119+
$data->$key = $value;
120120
}
121121
}
122122

administrator/components/com_templates/src/Helper/TemplatesHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function parseXMLTemplateFile($templateBaseDir, $templateDir)
9999
}
100100

101101
foreach ($xml as $key => $value) {
102-
$data->set($key, $value);
102+
$data->$key = $value;
103103
}
104104
}
105105

administrator/components/com_users/src/Helper/Mfa.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static function getConfigurationInterface(User $user): ?string
112112
$view->setDocument($app->getDocument());
113113
$view->returnURL = base64_encode(Uri::getInstance()->toString());
114114
$view->user = $user;
115-
$view->set('forHMVC', true);
115+
$view->forHMVC = true;
116116
$view->setLanguage($app->getLanguage());
117117

118118
@ob_start();

api/components/com_contact/src/Controller/ContactController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private function _sendEmail($data, $contact, $emailCopyToSender)
205205

206206
if ($contact->email_to == '' && $contact->user_id != 0) {
207207
$contact_user = $this->getUserFactory()->loadUserById($contact->user_id);
208-
$contact->email_to = $contact_user->get('email');
208+
$contact->email_to = $contact_user->email;
209209
}
210210

211211
$templateData = [

components/com_contact/src/Controller/DisplayController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function display($cachable = false, $urlparams = [])
6969
$vName = $this->input->get('view', 'categories');
7070
$this->input->set('view', $vName);
7171

72-
if ($this->app->getIdentity()->get('id')) {
72+
if ($this->app->getIdentity()->id) {
7373
$cachable = false;
7474
}
7575

0 commit comments

Comments
 (0)