Completed
Push — master ( b22df9...4eff91 )
by Marcus
02:10
created

Enum::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3.3332

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 4
cts 6
cp 0.6667
rs 9.9332
c 0
b 0
f 0
cc 3
nc 2
nop 1
crap 3.3332
1
<?php
2
3
namespace Mbright\Validation\Rule\Validate\MySql;
4
5
use Mbright\Validation\Rule\Validate\InValues;
6
7
class Enum extends InValues
8
{
9 6
    public function __construct(array $array)
10
    {
11 6
        $arrayCount = count($array);
12
13 6
        if ($arrayCount <= 0 || $arrayCount > 65535) {
14 6
            throw new \InvalidArgumentException('Enum must have 1 value and no more than 65,535 values');
15
        }
16
17
        parent::__construct($array);
18
    }
19
}
20