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

MinimaxWinning::looking()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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
}