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

VarChar   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 11
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
1
<?php
2
3
namespace Mbright\Validation\Rule\Validate\MySql;
4
5
use Mbright\Validation\Rule\Validate\Strlen;
6
7
/**
8
 * Validates that data can be inserted into one of the following column types:
9
 * - Varchar
10
 * - Varbinary
11
 */
12
class VarChar extends Strlen
13
{
14 6
    public function __construct(int $len)
15
    {
16 6
        if ($len > 65535 || $len < 0) {
17 6
            throw new \InvalidArgumentException('Varchar can only accept lenghts between 0 and 65535');
18
        }
19
20
        parent::__construct($len);
21
    }
22
}
23