Skip to content

Commit 1995e5b

Browse files
committed
#1096 Removed utility parameters from functions
1 parent 182db67 commit 1995e5b

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

library/Application/Update/UpdateDoiImportAndConferencesFields.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
use Opus\Translate\Dao;
3535

3636
/**
37+
* Updates enrichment fields used by DOI import functionality.
38+
*
3739
* Changes names of enrichment fields for doi based metadata import to new OPUS default.
3840
* Changes names of existing and adds new enrichment fields for conferences.
3941
*
@@ -67,13 +69,11 @@ class Application_Update_UpdateDoiImportAndConferencesFields extends Application
6769
public function run()
6870
{
6971
$this->log("Updating enrichment fieds for doi import and conferences as well as their translations");
70-
$colors = new ConsoleColors();
71-
7272
// Iterate through the keys
7373
foreach ($this->keyNames as $oldKeyString => $newKeyString) {
7474
$this->log("Updating '$oldKeyString' -> '$newKeyString'");
75-
$this->updateEnrichments($oldKeyString, $newKeyString, $colors);
76-
$this->updateTranslations($oldKeyString, $newKeyString, $colors);
75+
$this->updateEnrichments($oldKeyString, $newKeyString);
76+
$this->updateTranslations($oldKeyString, $newKeyString);
7777
}
7878
}
7979

@@ -84,8 +84,10 @@ public function run()
8484
* @param string $newKeyString
8585
* @param object $colors
8686
*/
87-
public function updateEnrichments($oldKeyString, $newKeyString, $colors)
87+
public function updateEnrichments($oldKeyString, $newKeyString)
8888
{
89+
$colors = new ConsoleColors();
90+
8991
// Identify already existing enrichment fields
9092
$oldField = EnrichmentKey::fetchByName($oldKeyString);
9193
$newField = EnrichmentKey::fetchByName($newKeyString);
@@ -131,8 +133,10 @@ public function updateEnrichmentKey($enrichmentKey, $newKey)
131133
* @param string $newKeyString
132134
* @param object $colors
133135
*/
134-
public function updateTranslations($oldKeyString, $newKeyString, $colors)
136+
public function updateTranslations($oldKeyString, $newKeyString)
135137
{
138+
$colors = new ConsoleColors();
139+
136140
$manager = new Application_Translate_TranslationManager();
137141

138142
// Identify already existing modified new translation keys

0 commit comments

Comments
 (0)