Blob   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 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
 * - Blob
10
 * - Text
11
 */
12
class Blob extends Strlen
13
{
14
    /**
15
     * @param int $len Acceptable string length.
16
     */
17 6
    public function __construct(int $len)
18
    {
19 6
        if ($len < 0 || $len > (pow(2, 16))) {
20 6
            throw new \InvalidArgumentException('Blob & Text can only accept lengths between 0 - 2^16');
21
        }
22
23
        parent::__construct($len);
24
    }
25
}
26