Skip to content

Commit 362ec5e

Browse files
authored
Merge pull request joomla#45035 from richard67/5.4-dev-upmerge-2025-02-28
[5.4] Upmerge changes from 5.3-dev 2025-02-28
2 parents 377000b + f61dca9 commit 362ec5e

File tree

219 files changed

+523
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+523
-465
lines changed

.php-cs-fixer.dist.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@
9191
'native_function_invocation' => ['include' => ['@compiler_optimized']],
9292
// Adds null to type declarations when parameter have a default null value
9393
'nullable_type_declaration_for_default_null_value' => true,
94+
// Removes unneeded parentheses around control statements
95+
'no_unneeded_control_parentheses' => true,
96+
// Using isset($var) && multiple times should be done in one call.
97+
'combine_consecutive_issets' => true,
98+
// Calling unset on multiple items should be done in one call
99+
'combine_consecutive_unsets' => true,
94100
]
95101
)
96102
->setFinder($finder);

administrator/components/com_associations/src/Helper/AssociationsHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private static function getExtensionHelperClassName($extensionName)
193193
*/
194194
private static function getExtensionRealName($extensionName)
195195
{
196-
return !str_contains($extensionName, 'com_') ? $extensionName : substr($extensionName, 4);
196+
return !str_starts_with($extensionName, 'com_') ? $extensionName : substr($extensionName, 4);
197197
}
198198

199199
/**
@@ -593,7 +593,7 @@ public static function canCheckinItem($extensionName, $typeName, $itemId)
593593

594594
$userId = Factory::getUser()->id;
595595

596-
return ($item->{$checkedOutFieldName} == $userId || $item->{$checkedOutFieldName} == 0);
596+
return $item->{$checkedOutFieldName} == $userId || $item->{$checkedOutFieldName} == 0;
597597
}
598598

599599
/**

administrator/components/com_associations/src/View/Associations/HtmlView.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ public function display($tpl = null)
174174

175175
// Dynamic filter form.
176176
// This selectors doesn't have to activate the filter bar.
177-
unset($this->activeFilters['itemtype']);
178-
unset($this->activeFilters['language']);
177+
unset($this->activeFilters['itemtype'], $this->activeFilters['language']);
179178

180179
// Remove filters options depending on selected type.
181180
if (empty($support['state'])) {
@@ -249,7 +248,7 @@ protected function addToolbar()
249248
{
250249
$user = $this->getCurrentUser();
251250

252-
if (isset($this->typeName) && isset($this->extensionName)) {
251+
if (isset($this->typeName, $this->extensionName)) {
253252
$helper = AssociationsHelper::getExtensionHelper($this->extensionName);
254253
$title = $helper->getTypeTitle($this->typeName);
255254

administrator/components/com_banners/src/Table/BannerTable.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher
5757

5858
$this->created = Factory::getDate()->toSql();
5959
$this->setColumnAlias('published', 'state');
60+
$this->setColumnAlias('title', 'name');
6061
}
6162

6263
/**

administrator/components/com_categories/src/Controller/CategoryController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function allowAdd($data = [])
7676
{
7777
$user = $this->app->getIdentity();
7878

79-
return ($user->authorise('core.create', $this->extension) || \count($user->getAuthorisedCategories($this->extension, 'core.create')));
79+
return $user->authorise('core.create', $this->extension) || \count($user->getAuthorisedCategories($this->extension, 'core.create'));
8080
}
8181

8282
/**

administrator/components/com_checkin/src/Model/CheckinModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function checkin($ids = [])
102102

103103
$fields = $db->getTableColumns($tn, false);
104104

105-
if (!(isset($fields['checked_out']) && isset($fields['checked_out_time']))) {
105+
if (!(isset($fields['checked_out'], $fields['checked_out_time']))) {
106106
continue;
107107
}
108108

@@ -183,7 +183,7 @@ public function getItems()
183183

184184
$fields = $db->getTableColumns($tn, false);
185185

186-
if (!(isset($fields['checked_out']) && isset($fields['checked_out_time']))) {
186+
if (!(isset($fields['checked_out'], $fields['checked_out_time']))) {
187187
continue;
188188
}
189189

administrator/components/com_config/src/Controller/ComponentController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function save($key = null, $urlVar = null)
8686
}
8787

8888
// Remove the permissions rules data if user isn't allowed to edit them.
89-
if (!$user->authorise('core.admin', $option) && isset($data['params']) && isset($data['params']['rules'])) {
89+
if (!$user->authorise('core.admin', $option) && isset($data['params']['rules'])) {
9090
unset($data['params']['rules']);
9191
}
9292

administrator/components/com_config/src/Model/ComponentModel.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ public function save($data)
201201
}
202202

203203
// We don't need this anymore
204-
unset($data['option']);
205-
unset($data['params']['rules']);
204+
unset($data['option'], $data['params']['rules']);
206205
}
207206

208207
// Load the previous Data

administrator/components/com_contact/src/Extension/ContactComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function getContexts(): array
142142
*/
143143
protected function getTableNameForSection(?string $section = null)
144144
{
145-
return ($section === 'category' ? 'categories' : 'contact_details');
145+
return $section === 'category' ? 'categories' : 'contact_details';
146146
}
147147

148148
/**

administrator/components/com_content/src/Model/ArticleModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ public function save($data)
649649
$input = $app->getInput();
650650
$filter = InputFilter::getInstance();
651651

652-
if (isset($data['metadata']) && isset($data['metadata']['author'])) {
652+
if (isset($data['metadata']['author'])) {
653653
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
654654
}
655655

0 commit comments

Comments
 (0)