Skip to content

Commit 2a96bc6

Browse files
authored
[5.3 ]Improve components code using TernaryToNullCoalescingRector rule (#44877)
1 parent 81b0269 commit 2a96bc6

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ protected function populateState()
974974
if ($pk) {
975975
$table = $this->getTable();
976976
$table->load($pk);
977-
$forcedClientId = isset($table->client_id) ? $table->client_id : $forcedClientId;
977+
$forcedClientId = $table->client_id ?? $forcedClientId;
978978
}
979979

980980
if (isset($forcedClientId) && $forcedClientId != $clientId) {

administrator/components/com_workflow/src/Model/StageModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function save($data)
106106

107107
// Make sure we use the correct extension when editing an existing workflow
108108
$key = $table->getKeyName();
109-
$pk = (isset($data[$key])) ? $data[$key] : (int) $this->getState($this->getName() . '.id');
109+
$pk = $data[$key] ?? (int) $this->getState($this->getName() . '.id');
110110

111111
if ($pk > 0) {
112112
$table->load($pk);

administrator/components/com_workflow/src/Model/TransitionModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function save($data)
156156

157157
// Make sure we use the correct workflow_id when editing an existing transition
158158
$key = $table->getKeyName();
159-
$pk = (isset($data[$key])) ? $data[$key] : (int) $this->getState($this->getName() . '.id');
159+
$pk = $data[$key] ?? (int) $this->getState($this->getName() . '.id');
160160

161161
if ($pk > 0) {
162162
$table->load($pk);

administrator/components/com_workflow/src/Model/WorkflowModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function save($data)
9393

9494
// Make sure we use the correct extension when editing an existing workflow
9595
$key = $table->getKeyName();
96-
$pk = (isset($data[$key])) ? $data[$key] : (int) $this->getState($this->getName() . '.id');
96+
$pk = $data[$key] ?? (int) $this->getState($this->getName() . '.id');
9797

9898
if ($pk > 0) {
9999
$table->load($pk);

0 commit comments

Comments
 (0)