FeatureVoter::vote()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 8
loc 8
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 5
nc 1
nop 3
crap 2
1
<?php
2
3
namespace Jlis\Judge\Voters;
4
5
use Jlis\Judge\Feature;
6
use Jlis\Judge\Contracts\VoterInterface;
7
8
/**
9
 * @author Julius Ehrlich <[email protected]>
10
 */
11 View Code Duplication
class FeatureVoter implements VoterInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 5
    public function vote($parameter = null, $user = null, array $additional = [])
17
    {
18 5
        return Feature::decide(
19 5
            $parameter,
20 5
            $user,
21 5
            isset($additional['defaultIfNotFound']) ? (bool) $additional['defaultIfNotFound'] : false
22 5
        );
23
    }
24
}
25