Completed
Push — master ( a17b9a...3a4c95 )
by Andrii
01:54
created

Reason::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\charge\modifiers\addons;
12
13
/**
14
 * Reason addon.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class Reason
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $value;
24
25 1
    public function __construct($value)
26
    {
27 1
        $this->value = static::ensureValidValue($value);
28 1
    }
29
30 1
    public function getValue()
31
    {
32 1
        return $this->value;
33
    }
34
35 1
    public static function ensureValidValue($value)
36
    {
37 1
        return (string)$value;
38
    }
39
}
40