FOSSology
3.2.0rc1
Open Source License Compliance by Open Source Software
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
Types.php
1
<?php
2
/***********************************************************
3
* Copyright (C) 2014 Siemens AG
4
* Author: J.Najjar
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* version 2 as published by the Free Software Foundation.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License along
16
* with this program; if not, write to the Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
***********************************************************/
19
20
namespace
Fossology\Lib\Data
;
21
22
use
Fossology\Lib\Exception
;
23
24
class
Types
25
{
27
protected
$map;
29
protected
$name;
30
31
public
function
__construct($name)
32
{
33
$this->name = $name;
34
}
35
41
function
getTypeName
($type)
42
{
43
if
(array_key_exists($type, $this->map)) {
44
return
$this->map[$type];
45
}
46
throw
new \Exception(
"unknown "
. $this->name .
" id "
. $type);
47
}
48
52
public
function
getMap
()
53
{
54
return
$this->map;
55
}
56
60
public
function
getTypeByName
($name)
61
{
62
return
array_search($name, $this->map);
63
}
64
}
Fossology\Lib\Data\Types\getTypeName
getTypeName($type)
Definition:
Types.php:41
Exception
Fossology\Lib\Data\Types
Definition:
Types.php:24
Fossology\Lib\Data\Types\getMap
getMap()
Definition:
Types.php:52
Fossology\Lib\Data\Types\getTypeByName
getTypeByName($name)
Definition:
Types.php:60
Fossology\Lib\Data
Definition:
AgentRef.php:20
src
lib
php
Data
Types.php
Generated on Mon Jun 29 2020 12:03:42 for FOSSology by
1.8.11