Completed
Push — master ( 922505...49fe4c )
by Boudry
05:20
created

CondorcetVersion   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getObjectVersion() 0 11 2
1
<?php
2
/*
3
    Condorcet PHP Class, with Schulze Methods and others !
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;
11
12
use Condorcet\Condorcet;
13
14
// Generic for many Condorcet Class
15
trait CondorcetVersion
16
{
17
    // Build by Version
18
    protected $_objectVersion = Condorcet::VERSION;
19
20 59
    public function getObjectVersion (string $options = null) : string
21
    {
22 59
        switch ($options) :
23 59
            case 'MAJOR':
24 1
                $version = explode('.', $this->_objectVersion);
25 1
                return $version[0].'.'.$version[1];
26
27
            default:
28 59
                return $this->_objectVersion;
29
        endswitch;
30
    }
31
}
32