1
0
Fork 0

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
pull/12257/head
jrfnl 2024-12-31 01:47:43 +01:00
parent ab390f6bf1
commit ccdfb56078
No known key found for this signature in database
GPG Key ID: 88BCD0973A23BCC6
1 changed files with 6 additions and 0 deletions

View File

@ -281,9 +281,15 @@ class GitHubDriver extends VcsDriver
case 'tidelift': case 'tidelift':
$result[$key]['url'] = 'https://tidelift.com/funding/github/' . $item['url']; $result[$key]['url'] = 'https://tidelift.com/funding/github/' . $item['url'];
break; break;
case 'polar':
$result[$key]['url'] = 'https://polar.sh/' . basename($item['url']);
break;
case 'buy_me_a_coffee': case 'buy_me_a_coffee':
$result[$key]['url'] = 'https://www.buymeacoffee.com/' . basename($item['url']); $result[$key]['url'] = 'https://www.buymeacoffee.com/' . basename($item['url']);
break; break;
case 'thanks_dev':
$result[$key]['url'] = 'https://thanks.dev/' . basename($item['url']);
break;
case 'otechie': case 'otechie':
$result[$key]['url'] = 'https://otechie.com/' . basename($item['url']); $result[$key]['url'] = 'https://otechie.com/' . basename($item['url']);
break; break;