FOSSology
4.4.0
Open Source License Compliance by Open Source Software
Types.php
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2014 Siemens AG
4
Author: J.Najjar
5
6
SPDX-License-Identifier: GPL-2.0-only
7
*/
8
9
namespace
Fossology\Lib\Data;
10
11
use
Fossology\Lib\Exception
;
12
13
class
Types
14
{
16
protected
$map;
18
protected
$name;
19
20
public
function
__construct($name)
21
{
22
$this->name = $name;
23
}
24
30
function
getTypeName
($type)
31
{
32
if
(array_key_exists($type, $this->map)) {
33
return
$this->map[$type];
34
}
35
throw
new \Exception(
"unknown "
. $this->name .
" id "
. $type);
36
}
37
41
public
function
getMap
()
42
{
43
return
$this->map;
44
}
45
49
public
function
getTypeByName
($name)
50
{
51
return
array_search($name, $this->map);
52
}
53
}
Fossology\Lib\Data\Types
Definition:
Types.php:14
Fossology\Lib\Data\Types\getTypeByName
getTypeByName($name)
Definition:
Types.php:49
Fossology\Lib\Data\Types\getMap
getMap()
Definition:
Types.php:41
Fossology\Lib\Data\Types\getTypeName
getTypeName($type)
Definition:
Types.php:30
Fossology\Lib\Exception
Fossology exception.
Definition:
Exception.php:15
src
lib
php
Data
Types.php
Generated on Mon Nov 18 2024 07:37:13 for FOSSology by
1.9.1