Completed
Push — master ( d366a2...854d4a )
by brian
01:55
created

GreaterThan   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A compare() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
/**
4
 * @copyright   (c) 2014-2017 brian ridley
5
 * @author      brian ridley <[email protected]>
6
 * @license     http://opensource.org/licenses/MIT MIT
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ptlis\SemanticVersion\Comparator;
13
14
use ptlis\SemanticVersion\Version\VersionInterface;
15
16
/**
17
 * Version greater than comparator.
18
 */
19
final class GreaterThan implements ComparatorInterface
20
{
21
    /**
22
     * Return true if the left version is greater than right version.
23
     *
24
     * @param VersionInterface $lVersion
25
     * @param VersionInterface $rVersion
26
     *
27
     * @return boolean
28
     */
29 21
    public function compare(VersionInterface $lVersion, VersionInterface $rVersion)
30
    {
31 21
        return (new LessThan())->compare($rVersion, $lVersion);
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    public function __toString()
38
    {
39 1
        return '>';
40
    }
41
}
42