7 namespace Fossology\ReportImport;
13 private static $keys = array(
14 'addConcludedAsDecisions',
15 'addLicenseInfoFromInfoInFile',
16 'addLicenseInfoFromConcluded',
17 'addConcludedAsDecisionsOverwrite',
19 'addConcludedAsDecisionsTBD',
24 protected $createLicensesAsCandidate =
true;
25 protected $createLicensesInfosAsFindings =
true;
26 protected $createConcludedLicensesAsFindings =
false;
27 protected $createConcludedLicensesAsConclusions =
true;
28 protected $overwriteDecisions =
false;
29 protected $addCopyrightInformation =
false;
30 protected $concludeLicenseDecisionType = DecisionTypes::IDENTIFIED;
31 protected $matchLicenseNameWithSPDX =
true;
33 private function getFromArgs($args, $num, $expected=
"true")
35 return array_key_exists(self::$keys[$num],$args) ? $args[self::$keys[$num]] === $expected :
false;
38 function __construct($args)
40 $this->createConcludedLicensesAsConclusions = $this->getFromArgs($args,0);
41 $this->createLicensesInfosAsFindings = $this->getFromArgs($args,1);
42 $this->createConcludedLicensesAsFindings = $this->getFromArgs($args,2);
43 $this->overwriteDecisions = $this->getFromArgs($args,3);
44 $this->addCopyrightInformation = $this->getFromArgs($args,4);
46 $addConcludedAsDecisionsTBD = $this->getFromArgs($args,5);
47 if($addConcludedAsDecisionsTBD)
49 $this->concludeLicenseDecisionType = DecisionTypes::TO_BE_DISCUSSED;
52 $this->createLicensesAsCandidate = $this->getFromArgs($args, 6,
"candidate");
53 $this->matchLicenseNameWithSPDX = $this->getFromArgs($args, 7,
"spdxid");
55 $this->echoConfiguration();
58 private function var_dump($mixed =
null) {
61 $dump = ob_get_contents();
66 public function echoConfiguration()
68 echo
"INFO: \$createLicensesAsCandidate is: " .$this->var_dump($this->createLicensesAsCandidate);
69 echo
"\nINFO: \$createLicensesInfosAsFindings is: " .$this->var_dump($this->createLicensesInfosAsFindings);
70 echo
"\nINFO: \$createConcludedLicensesAsFindings is: " .$this->var_dump($this->createConcludedLicensesAsFindings);
71 echo
"\nINFO: \$createConcludedLicensesAsConclusions is: ".$this->var_dump($this->createConcludedLicensesAsConclusions);
72 echo
"\nINFO: \$overwriteDecisions is: " .$this->var_dump($this->overwriteDecisions);
73 echo
"\nINFO: \$addCopyrightInformation is: " .$this->var_dump($this->addCopyrightInformation);
74 echo
"\nINFO: \$concludeLicenseDecisionType is: " .$this->var_dump($this->concludeLicenseDecisionType);
75 echo
"\nINFO: \$matchLicenseNameWithSPDX is: " .$this->var_dump($this->matchLicenseNameWithSPDX);
84 return $this->createLicensesAsCandidate;
92 return $this->createLicensesInfosAsFindings;
100 return $this->createConcludedLicensesAsFindings;
108 return $this->createConcludedLicensesAsConclusions;
116 return $this->concludeLicenseDecisionType;
125 $this->createConcludedLicensesAsConclusions = $createConcludedLicensesAsConclusions;
134 return $this->overwriteDecisions;
142 return $this->addCopyrightInformation;
151 return $this->matchLicenseNameWithSPDX;
isCreateLicensesInfosAsFindings()
setCreateConcludedLicensesAsConclusions($createConcludedLicensesAsConclusions)
isAddCopyrightInformation()
shouldMatchLicenseNameWithSPDX()
isCreateConcludedLicensesAsConclusions()
isCreateLicensesAsCandidate()
isCreateConcludedLicensesAsFindings()
getConcludeLicenseDecisionType()