Passed
Push — master ( 229462...d74785 )
by Andreas
02:20 queued 14s
created

Version   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __toString() 0 3 1
A equals() 0 3 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations\Version;
6
7
final class Version
8
{
9
    /** @var string */
10
    private $version;
11
12 134
    public function __construct(string $version)
13
    {
14 134
        $this->version = $version;
15 134
    }
16
17 83
    public function __toString() : string
18
    {
19 83
        return $this->version;
20
    }
21
22
    /**
23
     * @param mixed $object
24
     */
25 52
    public function equals($object) : bool
26
    {
27 52
        return $object instanceof self && $object->version === $this->version;
28
    }
29
}
30