Skip to content

Commit f2667d0

Browse files
Code cleanup (#44572)
1 parent 3142583 commit f2667d0

File tree

14 files changed

+14
-20
lines changed

14 files changed

+14
-20
lines changed

components/com_config/src/Model/ModulesModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
9999
}
100100

101101
// Attempt to load the xml file.
102-
if (!$xml = simplexml_load_file($formFile)) {
102+
if (!simplexml_load_file($formFile)) {
103103
throw new \Exception(Text::_('JERROR_LOADFILE_FAILED'));
104104
}
105105
}

components/com_config/src/Model/TemplatesModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
113113
}
114114

115115
// Attempt to load the xml file.
116-
if (!$xml = simplexml_load_file($formFile)) {
116+
if (!simplexml_load_file($formFile)) {
117117
throw new \Exception(Text::_('JERROR_LOADFILE_FAILED'));
118118
}
119119

components/com_contact/src/Model/CategoriesModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ public function getItems()
139139
}
140140

141141
/**
142-
* Gets the id of the parent category for the selected list of categories
142+
* Gets the parent category for the selected list of categories
143143
*
144-
* @return integer The id of the parent category
144+
* @return CategoryNode|null The parent category
145145
*
146146
* @since 1.6.0
147147
*/

components/com_contact/src/Model/ContactModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function getItem($pk = null)
252252
}
253253

254254
// Compute access permissions.
255-
if (($access = $this->getState('filter.access'))) {
255+
if ($this->getState('filter.access')) {
256256
// If the access filter has been set, we already know this user can view.
257257
$data->params->set('access-view', true);
258258
} else {

components/com_contact/src/Service/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function getCategorySegment($id, $query)
126126

127127
if ($this->noIDs) {
128128
foreach ($path as &$segment) {
129-
list($id, $segment) = explode(':', $segment, 2);
129+
[, $segment] = explode(':', $segment, 2);
130130
}
131131
}
132132

components/com_content/src/Helper/QueryHelper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ public static function orderbySecondary($orderby, $orderDate = 'created', ?Datab
172172
*/
173173
public static function getQueryDate($orderDate, ?DatabaseInterface $db = null)
174174
{
175-
$db = $db ?: Factory::getDbo();
176-
177175
switch ($orderDate) {
178176
case 'modified':
179177
$queryDate = ' CASE WHEN a.modified IS NULL THEN a.created ELSE a.modified END';

components/com_content/src/Model/ArticleModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function getItem($pk = null)
249249
}
250250

251251
// Compute view access permissions.
252-
if ($access = $this->getState('filter.access')) {
252+
if ($this->getState('filter.access')) {
253253
// If the access filter has been set, we already know this user can view.
254254
$data->params->set('access-view', true);
255255
} else {

components/com_content/src/Service/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function getCategorySegment($id, $query)
127127

128128
if ($this->noIDs) {
129129
foreach ($path as &$segment) {
130-
list($id, $segment) = explode(':', $segment, 2);
130+
[, $segment] = explode(':', $segment, 2);
131131
}
132132
}
133133

components/com_finder/src/Model/SearchModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function getItems()
113113
$results = [];
114114

115115
// Convert the rows to result objects.
116-
foreach ($items as $rk => $row) {
116+
foreach ($items as $row) {
117117
// Build the result object.
118118
if (\is_resource($row->object)) {
119119
$result = unserialize(stream_get_contents($row->object));

components/com_newsfeeds/src/Model/NewsfeedModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function &getItem($pk = null)
179179

180180
// Compute access permissions.
181181

182-
if ($access = $this->getState('filter.access')) {
182+
if ($this->getState('filter.access')) {
183183
// If the access filter has been set, we already know this user can view.
184184
$data->params->set('access-view', true);
185185
} else {

0 commit comments

Comments
 (0)