FOSSology  4.4.0
Open Source License Compliance by Open Source Software
License.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2014 Siemens AG
4  Authors: Johannes Najjar, Andreas Würl
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
9 namespace Fossology\Lib\Data;
10 
11 class License extends LicenseRef
12 {
16  private $text;
20  private $url;
24  private $risk;
28  private $detectorType;
32  private $spdxId;
33 
34  function __construct($id, $shortName, $fullName, $risk, $text, $url, $detectorType, $spdxId = null)
35  {
36  parent::__construct($id, $shortName, $fullName, $spdxId);
37  $this->text = $text;
38  $this->url = $url;
39  $this->risk = $risk;
40  $this->detectorType = $detectorType;
41  $this->spdxId = $spdxId;
42  }
43 
47  public function getRisk()
48  {
49  return $this->risk;
50  }
51 
55  public function getDetectorType()
56  {
57  return $this->detectorType;
58  }
59 
63  public function getSpdxId()
64  {
65  return LicenseRef::convertToSpdxId($this->getShortName(), $this->spdxId);
66  }
67 
71  public function getText()
72  {
73  return $this->text;
74  }
75 
79  public function getUrl()
80  {
81  return $this->url;
82  }
83 
85  public function getRef()
86  {
87  return new parent($this->getId(), $this->getShortName(),
88  $this->getFullName(), $this->getSpdxId());
89  }
90 }
static convertToSpdxId($shortname, $spdxId)
Given a license's shortname and spdx id, give out spdx id to use in reports.
Definition: LicenseRef.php:106