Version::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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 167
    public function __construct(string $version)
13
    {
14 167
        $this->version = $version;
15 167
    }
16
17 113
    public function __toString() : string
18
    {
19 113
        return $this->version;
20
    }
21
22
    /**
23
     * @param mixed $object
24
     */
25 59
    public function equals($object) : bool
26
    {
27 59
        return $object instanceof self && $object->version === $this->version;
28
    }
29
}
30