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
Namespace
Composer\SpdxCode
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,
);
}