FOSSology  4.4.0
Open Source License Compliance by Open Source Software
FileNode.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2023 Siemens AG
4  SPDX-FileContributor: Gaurav Mishra <mishra.gaurav@siemens.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7  */
8 
9 namespace Fossology\Lib\Data\Report;
10 
11 class FileNode
12 {
17  private $comments = [];
22  private $acknowledgements = [];
27  private $concludedLicenses = [];
32  private $isCleared = false;
37  private $scanners = [];
42  private $copyrights = [];
43 
50  public function addComment(?string $comment): FileNode
51  {
52  if (!empty($comment)) {
53  $this->comments[] = $comment;
54  }
55  return $this;
56  }
57 
64  public function setComments(array $comments): FileNode
65  {
66  $this->comments = $comments;
67  return $this;
68  }
69 
76  public function addAcknowledgement(?string $acknowledgement): FileNode
77  {
78  if (!empty($acknowledgement)) {
79  $this->acknowledgements[] = $acknowledgement;
80  }
81  return $this;
82  }
83 
91  {
92  $this->acknowledgements = $acknowledgements;
93  return $this;
94  }
95 
102  public function addConcludedLicense(?string $concludedLicense): FileNode
103  {
104  if (!empty($concludedLicense)) {
105  $this->concludedLicenses[] = $concludedLicense;
106  }
107  return $this;
108  }
109 
116  public function setIsCleared(bool $isCleared): FileNode
117  {
118  $this->isCleared = $isCleared;
119  return $this;
120  }
121 
128  public function addScanner(?string $scanner): FileNode
129  {
130  if (!empty($scanner)) {
131  $this->scanners[] = $scanner;
132  }
133  return $this;
134  }
135 
142  public function addCopyright(?string $copyright): FileNode
143  {
144  if (!empty($copyright)) {
145  $this->copyrights[] = $copyright;
146  }
147  return $this;
148  }
149 
153  public function getComments(): array
154  {
155  return $this->comments;
156  }
157 
161  public function getAcknowledgements(): array
162  {
164  }
165 
169  public function getConcludedLicenses(): array
170  {
172  }
173 
177  public function isCleared(): bool
178  {
179  return $this->isCleared;
180  }
181 
185  public function getScanners(): array
186  {
187  return $this->scanners;
188  }
189 
193  public function getCopyrights(): array
194  {
195  return $this->copyrights;
196  }
197 }
setAcknowledgements(array $acknowledgements)
Definition: FileNode.php:90
addAcknowledgement(?string $acknowledgement)
Definition: FileNode.php:76
addComment(?string $comment)
Definition: FileNode.php:50
addConcludedLicense(?string $concludedLicense)
Definition: FileNode.php:102
addCopyright(?string $copyright)
Definition: FileNode.php:142