From ccdfb560783dc6654b09651fb9aa495c40c0bbf7 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 31 Dec 2024 01:47:43 +0100 Subject: [PATCH] GitHubDriver::getFundingInfo(): add support for thanks.dev and polar.sh GitHub looks to have added a dedicated syntax for the thanks.dev funding platform when added to a `funding.yml` file. However, it looks like Composer does not (yet) support this syntax as can be seen from failed Packagist updates of the dev branches of the [PHP_CodeSniffer](https://packagist.org/packages/squizlabs/php_codesniffer#dev-master) and [PHPCompatibility](https://packagist.org/packages/phpcompatibility/php-compatibility) packages. The polar.sh funding platform also appears to be newly supported by GH and missing from the list. This PR fixes both. Refs: * https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository --- src/Composer/Repository/Vcs/GitHubDriver.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Composer/Repository/Vcs/GitHubDriver.php b/src/Composer/Repository/Vcs/GitHubDriver.php index 333410da3..5e773e70c 100644 --- a/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/src/Composer/Repository/Vcs/GitHubDriver.php @@ -281,9 +281,15 @@ class GitHubDriver extends VcsDriver case 'tidelift': $result[$key]['url'] = 'https://tidelift.com/funding/github/' . $item['url']; break; + case 'polar': + $result[$key]['url'] = 'https://polar.sh/' . basename($item['url']); + break; case 'buy_me_a_coffee': $result[$key]['url'] = 'https://www.buymeacoffee.com/' . basename($item['url']); break; + case 'thanks_dev': + $result[$key]['url'] = 'https://thanks.dev/' . basename($item['url']); + break; case 'otechie': $result[$key]['url'] = 'https://otechie.com/' . basename($item['url']); break;