mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-27 03:21:01 +00:00
Make updateAuthor code simpler to read
This commit is contained in:
parent
c57f69d967
commit
eeabca8090
1 changed files with 10 additions and 8 deletions
|
@ -83,15 +83,17 @@ class EntriesExport
|
||||||
*/
|
*/
|
||||||
public function updateAuthor($method)
|
public function updateAuthor($method)
|
||||||
{
|
{
|
||||||
$this->author = $method.' authors';
|
if ('entry' !== $method) {
|
||||||
|
$this->author = $method . ' authors';
|
||||||
|
|
||||||
if ('entry' === $method) {
|
return $this;
|
||||||
$publishedBy = $this->entries[0]->getPublishedBy();
|
}
|
||||||
if (!empty($publishedBy)) {
|
|
||||||
$this->author = implode(', ', $this->entries[0]->getPublishedBy());
|
$this->author = $this->entries[0]->getDomainName();
|
||||||
} else {
|
|
||||||
$this->author = $this->entries[0]->getDomainName();
|
$publishedBy = $this->entries[0]->getPublishedBy();
|
||||||
}
|
if (!empty($publishedBy)) {
|
||||||
|
$this->author = implode(', ', $publishedBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
Loading…
Reference in a new issue