Copeland::looking()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
/*
3
    Part of COPELAND method Module - From the original Condorcet PHP
4
5
    Condorcet PHP - Election manager and results calculator.
6
    Designed for the Condorcet method. Integrating a large number of algorithms extending Condorcet. Expandable for all types of voting systems.
7
8
    By Julien Boudry and contributors - MIT LICENSE (Please read LICENSE.txt)
9
    https://github.com/julien-boudry/Condorcet
10
*/
11
declare(strict_types=1);
12
13
namespace CondorcetPHP\Condorcet\Algo\Methods\Copeland;
14
15
use CondorcetPHP\Condorcet\Algo\Methods\PairwiseStatsBased_Core;
16
17
// Copeland is a Condorcet Algorithm | http://en.wikipedia.org/wiki/Copeland_method
18
class Copeland extends PairwiseStatsBased_Core
19
{
20
    // Method Name
21
    public const METHOD_NAME = ['Copeland'];
22
23
    protected $_countType = 'balance';
24
25
26
/////////// COMPUTE ///////////
27
28
    //:: COPELAND ALGORITHM. :://
29
30 7
    protected function looking (array $challenge) : int
31
    {
32 7
        return max($challenge);
33
    }
34
}
35