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

Breadcrumb

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

function SpdxLicenses::getIdentifierByName

Returns the short identifier of a license (or license exception) by full name.

Parameters

string $name:

Return value

string|null

File

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

Class

SpdxLicenses

Namespace

Composer\Spdx

Code

public function getIdentifierByName($name) {
    foreach ($this->licenses as $licenseData) {
        if ($licenseData[1] === $name) {
            return $licenseData[0];
        }
    }
    foreach ($this->exceptions as $licenseData) {
        if ($licenseData[1] === $name) {
            return $licenseData[0];
        }
    }
    return null;
}

API Navigation

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