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

EqualTo::__toString()   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
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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 equality comparator.
18
 */
19
final class EqualTo implements ComparatorInterface
20
{
21
    /**
22
     * Return true if the versions match.
23
     *
24
     * @param VersionInterface $lVersion
25
     * @param VersionInterface $rVersion
26
     *
27
     * @return boolean
28
     */
29 9
    public function compare(VersionInterface $lVersion, VersionInterface $rVersion)
30
    {
31 9
        return ($lVersion->__toString() === $rVersion->__toString());
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    public function __toString()
38
    {
39 1
        return '=';
40
    }
41
}
42