Skip to content

Commit 595008c

Browse files
authored
[5.4] Fix deprecated direct property access of model state (joomla#45704)
* [5.4] Remove direct property access of model state * Update phpstan-baseline.neon
1 parent ca0d511 commit 595008c

File tree

27 files changed

+50
-54
lines changed

27 files changed

+50
-54
lines changed

administrator/components/com_banners/src/View/Banner/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function (Toolbar $childBar) use ($checkedOut, $canDo, $user, $isNew) {
138138
} else {
139139
$toolbar->cancel('banner.cancel');
140140

141-
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $canDo->get('core.edit')) {
141+
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $canDo->get('core.edit')) {
142142
$toolbar->versions('com_banners.banner', $this->item->id);
143143
}
144144
}

administrator/components/com_banners/src/View/Client/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function (Toolbar $childBar) use ($checkedOut, $canDo, $isNew) {
147147
} else {
148148
$toolbar->cancel('client.cancel');
149149

150-
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $canDo->get('core.edit')) {
150+
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $canDo->get('core.edit')) {
151151
$toolbar->versions('com_banners.client', $this->item->id);
152152
}
153153
}

administrator/components/com_contact/src/View/Contact/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo, $user) {
193193

194194
$toolbar->cancel('contact.cancel');
195195

196-
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $itemEditable) {
196+
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $itemEditable) {
197197
$toolbar->versions('com_contact.contact', $this->item->id);
198198
}
199199

administrator/components/com_content/src/View/Article/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo, $user) {
230230
$toolbar->cancel('article.cancel', 'JTOOLBAR_CLOSE');
231231

232232
if (!$isNew) {
233-
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $itemEditable) {
233+
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $itemEditable) {
234234
$toolbar->versions('com_content.article', $this->item->id);
235235
}
236236

administrator/components/com_contenthistory/src/View/History/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function addToolbar(): Toolbar
105105

106106
// Clean up input to ensure a clean url.
107107
$filter = InputFilter::getInstance();
108-
$aliasArray = explode('.', $this->state->item_id);
108+
$aliasArray = explode('.', $this->state->get('item_id'));
109109

110110
if ($aliasArray[1] === 'category') {
111111
$option = 'com_categories';

administrator/components/com_finder/src/View/Searches/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function display($tpl = null)
112112
$this->state = $model->getState();
113113
$this->filterForm = $model->getFilterForm();
114114
$this->activeFilters = $model->getActiveFilters();
115-
$this->enabled = $this->state->params->get('gather_search_statistics', 0);
115+
$this->enabled = $this->state->get('params')->get('gather_search_statistics', 0);
116116
$this->canDo = ContentHelper::getActions('com_finder');
117117
$uri = Uri::getInstance();
118118
$link = 'index.php?option=com_config&view=component&component=com_finder&return=' . base64_encode($uri);

administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function (Toolbar $childBar) use ($checkedOut, $canDo, $user, $isNew) {
171171
} else {
172172
$toolbar->cancel('newsfeed.cancel');
173173

174-
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $canDo->get('core.edit')) {
174+
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $canDo->get('core.edit')) {
175175
$toolbar->versions('com_newsfeeds.newsfeed', $this->item->id);
176176
}
177177
}

administrator/components/com_tags/src/View/Tag/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo) {
169169

170170
$toolbar->cancel('tag.cancel');
171171

172-
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $itemEditable) {
172+
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $itemEditable) {
173173
$toolbar->versions('com_tags.tag', $this->item->id);
174174
}
175175
}

administrator/components/com_users/src/View/Note/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function (Toolbar $childBar) use ($checkedOut, $canDo, $user, $isNew) {
138138
} else {
139139
$toolbar->cancel('note.cancel');
140140

141-
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $canDo->get('core.edit')) {
141+
if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $canDo->get('core.edit')) {
142142
$toolbar->versions('com_users.note', $this->item->id);
143143
}
144144
}

components/com_contact/src/View/Form/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function display($tpl = null)
116116
}
117117

118118
// Create a shortcut to the parameters.
119-
$this->params = $this->state->params;
119+
$this->params = $this->state->get('params');
120120

121121
// Escape strings for HTML output
122122
$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx', ''));

0 commit comments

Comments
 (0)