function SpdxLicenses::loadExceptions
Return value
void
1 call to SpdxLicenses::loadExceptions()
- SpdxLicenses::__construct in vendor/
composer/ spdx-licenses/ src/ SpdxLicenses.php
File
-
vendor/
composer/ spdx-licenses/ src/ SpdxLicenses.php, line 242
Class
Namespace
Composer\SpdxCode
private function loadExceptions() {
if (null !== $this->exceptions) {
return;
}
$json = file_get_contents(self::getResourcesDir() . '/' . self::EXCEPTIONS_FILE);
if (false === $json) {
throw new \RuntimeException('Missing exceptions file in ' . self::getResourcesDir() . '/' . self::EXCEPTIONS_FILE);
}
$this->exceptions = array();
foreach (json_decode($json, true) as $identifier => $exception) {
$this->exceptions[strtolower($identifier)] = array(
$identifier,
$exception[0],
);
}
}