Skip to content

Commit d3abd97

Browse files
authored
Merge pull request joomla#45075 from Bodge-IT/upmerges/2025-03-05
[6.0] Upmerges 2025-03-05(4) joomla#44997 caused drone test to fail at installation view checks, code temporarily commented out while investigated. probable cause, use of filesystem classes.
2 parents 84a6d3b + 831642d commit d3abd97

File tree

260 files changed

+990
-727
lines changed

Some content is hidden

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

260 files changed

+990
-727
lines changed

.php-cs-fixer.dist.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@
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,
100+
// There must be no sprintf calls with only the first argument
101+
'no_useless_sprintf' => true,
94102
]
95103
)
96104
->setFinder($finder);

administrator/components/com_actionlogs/src/Model/ActionlogModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = 0)
5858
try {
5959
$user = $userId ? $this->getUserFactory()->loadUserById($userId) : $this->getCurrentUser();
6060
} catch (\UnexpectedValueException $e) {
61-
@trigger_error(\sprintf('UserFactory must be set, this will not be caught anymore in 7.0.'), E_USER_DEPRECATED);
61+
@trigger_error('UserFactory must be set, this will not be caught anymore in 7.0.', E_USER_DEPRECATED);
6262
$user = Factory::getUser($userId);
6363
}
6464

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/Controller/BannerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function allowAdd($data = [])
7171
*/
7272
protected function allowEdit($data = [], $key = 'id')
7373
{
74-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
74+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
7575
$categoryId = 0;
7676

7777
if ($recordId) {

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(DatabaseInterface $db, ?DispatcherInterface $dispatc
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: 2 additions & 2 deletions
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
/**
@@ -91,7 +91,7 @@ protected function allowAdd($data = [])
9191
*/
9292
protected function allowEdit($data = [], $key = 'parent_id')
9393
{
94-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
94+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
9595
$user = $this->app->getIdentity();
9696

9797
// Check "edit" permission on record asset (explicit or inherited)

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
@@ -202,8 +202,7 @@ public function save($data)
202202
}
203203

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

209208
// Load the previous Data

0 commit comments

Comments
 (0)