FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Findings.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2020 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
11 namespace Fossology\UI\Api\Models;
12 
17 class Findings
18 {
19 
24  private $scanner;
25 
30  private $conclusion;
31 
36  private $copyright;
37 
45  public function __construct($scanner = null, $conclusion = null, $copyright = null)
46  {
47  $this->setScanner($scanner);
48  $this->setConclusion($conclusion);
49  $this->setCopyright($copyright);
50  }
51 
55  public function getScanner()
56  {
57  return $this->scanner;
58  }
59 
63  public function getConclusion()
64  {
65  return $this->conclusion;
66  }
67 
71  public function getCopyright()
72  {
73  return $this->copyright;
74  }
75 
79  public function setScanner($scanner)
80  {
81  if (is_array($scanner)) {
82  $this->scanner = $scanner;
83  } elseif (is_string($scanner)) {
84  $this->scanner = [$scanner];
85  } elseif ($scanner === null && empty($this->scanner)) {
86  $this->scanner = null;
87  }
88  }
89 
93  public function setConclusion($conclusion)
94  {
95  if (is_array($conclusion)) {
96  $this->conclusion = $conclusion;
97  } elseif (is_string($conclusion)) {
98  $this->conclusion = [$conclusion];
99  } elseif ($conclusion === null && empty($this->conclusion)) {
100  $this->conclusion = null;
101  }
102  }
103 
107  public function setCopyright($copyright)
108  {
109  if (is_array($copyright)) {
110  $this->copyright = $copyright;
111  } elseif (is_string($copyright)) {
112  $this->copyright = [$copyright];
113  } elseif ($copyright === null && empty($this->copyright)) {
114  $this->copyright = null;
115  }
116  }
117 
123  public function getArray()
124  {
125  return [
126  'scanner' => $this->getScanner(),
127  'conclusion' => $this->getConclusion(),
128  'copyright' => $this->getCopyright()
129  ];
130  }
131 }
Model holding information about license findings and conclusions.
Definition: Findings.php:18
__construct($scanner=null, $conclusion=null, $copyright=null)
Definition: Findings.php:45
Abstract class to provide interface to scanners.
Definition: scanners.hpp:52