| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 91.67% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | abstract class Method |
||
| 19 | { |
||
| 20 | use CondorcetVersion; |
||
| 21 | |||
| 22 | public static $_maxCandidates = null; |
||
| 23 | |||
| 24 | protected $_selfElection; |
||
| 25 | protected $_Result; |
||
| 26 | |||
| 27 | 4 | public function __construct (Election $mother) |
|
| 28 | { |
||
| 29 | 4 | $this->_selfElection = $mother; |
|
| 30 | |||
| 31 | 4 | if (!is_null(static::$_maxCandidates) && $this->_selfElection->countCandidates() > static::$_maxCandidates) : |
|
| 32 | throw new CondorcetException(101, static::METHOD_NAME[0].' is configured to accept only '.static::$_maxCandidates.' candidates'); |
||
|
1 ignored issue
–
show
|
|||
| 33 | endif; |
||
| 34 | 4 | } |
|
| 35 | |||
| 36 | abstract protected function getStats () : array; |
||
| 37 | |||
| 38 | 4 | protected function createResult (array $result) : Result |
|
| 46 | ); |
||
| 47 | } |
||
| 49 |