Passed
Push — master ( 291666...ef8eea )
by Boudry
03:25
created

NoTie::evaluateVote()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 1
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 3
1
<?php
2
/*
3
    Condorcet PHP - Election manager and results calculator.
4
    Designed for the Condorcet method. Integrating a large number of algorithms extending Condorcet. Expandable for all types of voting systems.
5
6
    By Julien Boudry and contributors - MIT LICENSE (Please read LICENSE.txt)
7
    https://github.com/julien-boudry/Condorcet
8
*/
9
declare(strict_types=1);
10
11
namespace Condorcet\Constraints;
12
13
use Condorcet\VoteConstraint;
14
15
class NoTie extends VoteConstraint
16
{
17 1
    protected static function evaluateVote (array $vote): bool
18
    {
19 1
        foreach ($vote as $oneRank) :
20 1
            if (count($oneRank) > 1) :
21 1
                return false;
22
            endif;
23
        endforeach;
24
25 1
        return true;
26
    }
27
}