Skip to content

Commit

Permalink
Merge pull request #1166 from NFDI4Chem/remove-duplicated-code
Browse files Browse the repository at this point in the history
refactor: remove redundancy and duplicates
  • Loading branch information
CS76 authored Nov 8, 2024
2 parents 79bd14c + 7866fe2 commit 7bc5702
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/Models/HasDOI.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function generateDOI($doiService)

if ($this->project) {
$projectIdentifier = $this->getIdentifier($this->project, 'identifier');
$suffix = 'P'.$projectIdentifier.'.'.'S'.$identifier;
$suffix = 'P'.$projectIdentifier.'.S'.$identifier;
} else {
$suffix = 'S'.$identifier;
}
Expand All @@ -36,16 +36,14 @@ public function generateDOI($doiService)
$studyIdentifier = $this->getIdentifier($this->study, 'identifier');
if ($this->project) {
$projectIdentifier = $this->getIdentifier($this->project, 'identifier');
$suffix = 'P'.$projectIdentifier.'.'.'S'.$studyIdentifier.'.'.'D'.$identifier;
$suffix = 'P'.$projectIdentifier.'.S'.$studyIdentifier.'.D'.$identifier;
} else {
$suffix = 'S'.$studyIdentifier.'.'.'D'.$identifier;
$suffix = 'S'.$studyIdentifier.'.D'.$identifier;
}
$url = $url.'D'.$identifier;
$resourceType = 'Dataset';
}

$attributes = $this->getMetadata();
$attributes['url'] = $url;
$attributes = $this->getMetadata();
$attributes['url'] = $url;
$attributes['types'] = [
Expand Down

0 comments on commit 7bc5702

Please sign in to comment.