Skip to content

Commit 61ef204

Browse files
authored
Remove useless clone statement (#44843)
`$this->getTable()` always return new table object, so having clone statement here is useless, thus I remove it.
1 parent b4eb00a commit 61ef204

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

administrator/components/com_banners/src/Model/BannerModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public function save($data)
442442
// Alter the name for save as copy
443443
if ($input->get('task') == 'save2copy') {
444444
/** @var \Joomla\Component\Banners\Administrator\Table\BannerTable $origTable */
445-
$origTable = clone $this->getTable();
445+
$origTable = $this->getTable();
446446
$origTable->load($input->getInt('id'));
447447

448448
if ($data['name'] == $origTable->name) {

administrator/components/com_categories/src/Model/CategoryModel.php

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

535535
// Alter the title for save as copy
536536
if ($input->get('task') == 'save2copy') {
537-
$origTable = clone $this->getTable();
537+
$origTable = $this->getTable();
538538
$origTable->load($input->getInt('id'));
539539

540540
if ($data['title'] == $origTable->title) {

administrator/components/com_contact/src/Model/ContactModel.php

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

317317
// Alter the name for save as copy
318318
if ($input->get('task') == 'save2copy') {
319-
$origTable = clone $this->getTable();
319+
$origTable = $this->getTable();
320320
$origTable->load($input->getInt('id'));
321321

322322
if ($data['name'] == $origTable->name) {

administrator/components/com_fields/src/Model/FieldModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function save($data)
140140
$input = Factory::getApplication()->getInput();
141141

142142
if ($input->get('task') == 'save2copy') {
143-
$origTable = clone $this->getTable();
143+
$origTable = $this->getTable();
144144
$origTable->load($input->getInt('id'));
145145

146146
if ($data['title'] == $origTable->title) {

administrator/components/com_guidedtours/src/Model/StepModel.php

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

100100
if ($input->get('task') == 'save2copy') {
101-
$origTable = clone $this->getTable();
101+
$origTable = $this->getTable();
102102
$origTable->load($input->getInt('id'));
103103

104104
$data['published'] = 0;

administrator/components/com_guidedtours/src/Model/TourModel.php

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

7070
if ($input->get('task') == 'save2copy') {
71-
$origTable = clone $this->getTable();
71+
$origTable = $this->getTable();
7272
$origTable->load($input->getInt('id'));
7373

7474
$data['published'] = 0;

administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php

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

216216
// Alter the name for save as copy
217217
if ($input->get('task') == 'save2copy') {
218-
$origTable = clone $this->getTable();
218+
$origTable = $this->getTable();
219219
$origTable->load($input->getInt('id'));
220220

221221
if ($data['name'] == $origTable->name) {

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

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

119119
if ($input->get('task') == 'save2copy') {
120-
$origTable = clone $this->getTable();
120+
$origTable = $this->getTable();
121121

122122
// Alter the title for save as copy
123123
if ($origTable->load(['title' => $data['title']])) {

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

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

169169
if ($input->get('task') == 'save2copy') {
170-
$origTable = clone $this->getTable();
170+
$origTable = $this->getTable();
171171

172172
// Alter the title for save as copy
173173
if ($origTable->load(['title' => $data['title']])) {

administrator/components/com_workflow/src/Model/WorkflowModel.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

108108
if ($input->get('task') == 'save2copy') {
109-
$origTable = clone $this->getTable();
109+
$origTable = $this->getTable();
110110

111111
// Alter the title for save as copy
112112
if ($origTable->load(['title' => $data['title']])) {

0 commit comments

Comments
 (0)