Passed
Push — master ( e52344...df819b )
by Rafael
09:21
created

AbstractEnumType::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Doctrine\DBAL\Types;
12
13
use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType as BaseEnumType;
14
15
/**
16
 * EnumType
17
 */
18
class AbstractEnumType extends BaseEnumType
19
{
20
    /**
21
     * Set deprecations reasons for deprecated values
22
     *
23
     * @var array
24
     */
25
    protected static $deprecatedReasons = [];
26
27
    /**
28
     * Set description for each values
29
     *
30
     * @var array
31
     */
32
    protected static $descriptions = [];
33
34
    /**
35
     * If the public name should
36
     * be different to the internal one
37
     *
38
     * @var array
39
     */
40
    protected static $publicNames = [];
41
42
    /**
43
     * @param string $type
44
     *
45
     * @return null|string
46
     */
47 1
    public static function getDeprecatedReason($type): ?string
48
    {
49 1
        return static::$deprecatedReasons[$type] ?? null;
50
    }
51
52
    /**
53
     * @param string $type
54
     *
55
     * @return null|string
56
     */
57 1
    public static function getDescription($type): ?string
58
    {
59 1
        return static::$descriptions[$type] ?? null;
60
    }
61
62
    /**
63
     * @param string $type
64
     *
65
     * @return mixed
66
     */
67 1
    public static function getPublicName($type)
68
    {
69 1
        return static::$publicNames[$type] ?? null;
70
    }
71
}
72