fix: error in funding composer.json block bricks frontend (#3239)

* fix: error in funding `composer.json` block bricks frontend

* simplify

* Apply fixes from StyleCI

[ci skip] [skip ci]

Co-authored-by: luceos <luceos@users.noreply.github.com>
This commit is contained in:
David Wheatley 2021-12-29 03:25:03 +01:00 committed by GitHub
parent 53c3d13047
commit 8fac735be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -436,8 +436,8 @@ class Extension implements Arrayable
$links['support'] = "mailto:$supportEmail";
}
if (($funding = $this->composerJsonAttribute('funding')) && count($funding)) {
$links['donate'] = $funding[0]['url'];
if (($funding = $this->composerJsonAttribute('funding')) && is_array($funding) && ($fundingUrl = Arr::get($funding, '0.url'))) {
$links['donate'] = $fundingUrl;
}
$links['authors'] = [];