Passed
Push — master ( 93c0a5...b2d39c )
by Stephen
54s queued 11s
created

ApplyMap   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
1
<?php
2
3
namespace Monooso\Apposite\Rules;
4
5
use Illuminate\Contracts\Validation\Rule;
6
7
class ApplyMap extends Apply implements Rule
8
{
9
    /**
10
     * Initialise the custom rule
11
     *
12
     * @param string $key
13
     * @param array  $map
14
     */
15 2
    public function __construct(string $key, array $map)
16
    {
17 2
        (array_key_exists($key, $map))
18 1
            ? parent::__construct(true, $map[$key])
19 1
            : parent::__construct(false, []);
20 2
    }
21
}
22