Data::getCode()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php
2
3
/*
4
 * This file is part of the GestPayWS library.
5
 *
6
 * (c) Manuel Dalla Lana <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EndelWar\GestPayWS\Data;
13
14
/**
15
 * Class Data
16
 * @package EndelWar\GestPayWS\Data
17
 */
18
abstract class Data
19
{
20
    /**
21
     * @param $costantName
22
     * @return bool|mixed
23
     */
24 4
    public static function getCode($costantName)
25
    {
26 4
        $costantName = strtoupper($costantName);
27 4
        if (defined("static::$costantName")) {
28 2
            return constant("static::$costantName");
29
        }
30
31 2
        return false;
32
    }
33
}
34