ChargeType::isValid()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace PHPSC\PagSeguro\Requests\PreApprovals;
3
4
/**
5
 * @author Luís Otávio Cobucci Oblonczyk <[email protected]>
6
 */
7
class ChargeType
8
{
9
    /**
10
     * @var string
11
     */
12
    const AUTOMATIC = 'auto';
13
14
    /**
15
     * @var string
16
     */
17
    const MANUAL = 'manual';
18
19
    /**
20
     * @param string $type
21
     *
22
     * @return boolean
23
     */
24 6
    public static function isValid($type)
25
    {
26 6
        return in_array($type, [static::AUTOMATIC, static::MANUAL]);
27
    }
28
}
29