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

Breadcrumb

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

function SpdxLicenses::getLicenseByIdentifier

Returns license metadata by license identifier.

This function adds a link to the full license text to the license metadata. The array returned is in the form of:

[ 0 => full name (string), 1 => osi certified, 2 => link to license text (string), 3 => deprecation status (bool) ]

Parameters

string $identifier:

Return value

array{0: string, 1: bool, 2: string, 3: bool}|null

File

vendor/composer/spdx-licenses/src/SpdxLicenses.php, line 80

Class

SpdxLicenses

Namespace

Composer\Spdx

Code

public function getLicenseByIdentifier($identifier) {
    $key = strtolower($identifier);
    if (!isset($this->licenses[$key])) {
        return null;
    }
    list($identifier, $name, $isOsiApproved, $isDeprecatedLicenseId) = $this->licenses[$key];
    return array(
        $name,
        $isOsiApproved,
        'https://spdx.org/licenses/' . $identifier . '.html#licenseText',
        $isDeprecatedLicenseId,
    );
}

API Navigation

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