Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FundCommand.php

function FundCommand::insertFundingData

Parameters

mixed[] $fundings:

Return value

mixed[]

1 call to FundCommand::insertFundingData()
FundCommand::execute in vendor/composer/composer/src/Composer/Command/FundCommand.php
Executes the current command.

File

vendor/composer/composer/src/Composer/Command/FundCommand.php, line 134

Class

FundCommand
@author Nicolas Grekas <p@tchwork.com> @author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Command

Code

private function insertFundingData(array $fundings, CompletePackageInterface $package) : array {
    foreach ($package->getFunding() as $fundingOption) {
        [
            $vendor,
            $packageName,
        ] = explode('/', $package->getPrettyName());
        // ignore malformed funding entries
        if (empty($fundingOption['url'])) {
            continue;
        }
        $url = $fundingOption['url'];
        if (!empty($fundingOption['type']) && $fundingOption['type'] === 'github' && Preg::isMatch('{^https://github.com/([^/]+)$}', $url, $match)) {
            $url = 'https://github.com/sponsors/' . $match[1];
        }
        $fundings[$vendor][$url][] = $packageName;
    }
    return $fundings;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal