Skip to content

Commit

Permalink
680 - storing authors inside composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Kuhlmay committed Dec 28, 2023
1 parent 8d151ba commit 518ca73
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Classes/Domain/Model/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,14 +637,24 @@ public function setSourceLanguage(string $sourceLanguage): void
public function getComposerInfo(): array
{
// TODO: consider moving this into the CodeTemplates
// TODO: authors are not stored here
$authors = [];
foreach ($this->persons as $person) {
$author = [
'name' => $person->getName()
];
if ($person->getRole() !== '') {
$author['role'] = $person->getRole();
}
$authors[] = $author;
}

$extensionKey = $this->extensionKey;
$composerExtensionKey = strtolower(str_replace('_', '-', $extensionKey));
$info = [
'name' => strtolower(str_replace('_', '', GeneralUtility::camelCaseToLowerCaseUnderscored($this->vendorName))) . '/' . $composerExtensionKey,
'type' => 'typo3-cms-extension',
'description' => $this->description,
'authors' => [],
'authors' => $authors,
'license' => 'GPL-2.0-or-later',
'require' => [
'typo3/cms-core' => '^12.4'
Expand Down Expand Up @@ -681,15 +691,6 @@ public function getComposerInfo(): array
]
]
];
foreach ($this->persons as $person) {
$author = [
'name' => $person->getName()
];
if ($person->getRole() !== '') {
$author['role'] = $person->getRole();
}
$info['authors'][] = $author;
}
return $info;
}
}

0 comments on commit 518ca73

Please sign in to comment.