Checker::passes()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
crap 2
1
<?php
2
3
namespace DeGraciaMathieu\FreezeMyScalar;
4
5
use DeGraciaMathieu\FreezeMyScalar\Exceptions;
6
7
class Checker 
8
{
9
    /**
10
     * @param  string $rule
11
     * @param  mixed $content
12
     * @throws \DeGraciaMathieu\FreezeMyScalar\Exceptions\UnexpectedValueException
13
     * @return void
14
     */
15 3
    public static function passes($rule, $content)
16
    {
17 3
        $rule = new $rule;
18
19 3
        if (! $rule->verify($content)) {
20 1
            throw new Exceptions\UnexpectedValueException();
21
        }
22 2
    }
23
}
24