63 $this->attribution =
"";
64 $this->declaredLicense =
"NOASSERTION";
65 $this->discoveredLicenses =
"";
71 if (array_key_exists(
'licensed', $result)) {
72 $licensed = $result[
"licensed"];
73 if (array_key_exists(
"declared", $licensed)) {
74 $this->declaredLicense = $licensed[
"declared"];
76 if (array_key_exists(
"facets", $licensed) &&
77 array_key_exists(
"core", $licensed[
"facets"])) {
78 $core = $licensed[
"facets"][
"core"];
79 if (array_key_exists(
"files", $core)) {
80 $this->files = intval($core[
"files"]);
82 if (array_key_exists(
"attribution", $core) &&
83 array_key_exists(
"parties", $core[
"attribution"])) {
84 $this->attribution = substr(
85 implode(
", ", $core[
'attribution'][
'parties']), 0, 100);
87 if (array_key_exists(
"discovered", $core) &&
88 array_key_exists(
"expressions", $core[
"discovered"])) {
89 $this->discoveredLicenses = substr(
90 implode(
", ", $core[
'discovered'][
'expressions']), 0, 100);
95 if (array_key_exists(
"described", $result)) {
96 $described = $result[
"described"];
97 if (array_key_exists(
"sourceLocation", $described) &&
98 array_key_exists(
"url", $described[
"sourceLocation"])) {
99 $this->url = $described[
"sourceLocation"][
"url"];
100 }
else if (array_key_exists(
"urls", $described) &&
101 array_key_exists(
"version", $described[
"urls"])) {
102 $this->url = $described[
"urls"][
"version"];
104 if (array_key_exists(
"releaseDate", $described)) {
105 $this->release = $described[
"releaseDate"];
109 if (array_key_exists(
"scores", $result) &&
110 array_key_exists(
"effective", $result[
"scores"])) {
111 $this->score = $result[
"scores"][
"effective"];