Passed
Branch master (73ca69)
by Boudry
03:33
created

MinimaxWinning   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A looking() 0 4 1
1
<?php
2
/*
3
    Minimax part of the Condorcet PHP Class
4
5
    By Julien Boudry - MIT LICENSE (Please read LICENSE.txt)
6
    https://github.com/julien-boudry/Condorcet
7
*/
8
declare(strict_types=1);
9
10
namespace Condorcet\Algo\Methods;
11
12
use Condorcet\Algo\Methods\PairwiseStatsBased_Core;
13
use Condorcet\Algo\MethodInterface;
14
15
// Minimax is a Condorcet Algorithm | http://en.wikipedia.org/wiki/Schulze_method
16
class MinimaxWinning extends PairwiseStatsBased_Core
17
{
18
    // Method Name
19
    public const METHOD_NAME = ['Minimax Winning','MinimaxWinning','Minimax','Minimax_Winning','Simpson','Simpson-Kramer','Simpson-Kramer Method','Simpson Method'];
20
21
    protected $_countType = 'worst_pairwise_defeat_winning';
22
23
24
/////////// COMPUTE ///////////
25
26
    //:: SIMPSON ALGORITHM. :://
27
28 1
    protected function looking (array $challenge) : int
29
    {
30 1
        return min($challenge);
31
    }
32
}