Completed
Branch dev-1.8.x (7905e8)
by Boudry
03:47
created

VoteConstraint   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
wmc 1
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isVoteAllow() 0 4 1
evaluateVote() 0 1 ?
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;
12
13
abstract class VoteConstraint
14
{
15 1
    public static function isVoteAllow (Election $election, Vote $vote) : bool
16
    {
17 1
        return static::evaluateVote($vote->getContextualRanking($election));
18
    }
19
20
    abstract static function evaluateVote (array $vote) : bool;
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
21
}