ExecutedMigration::getExecutionTime()   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\Metadata;
6
7
use DateTimeImmutable;
8
use Doctrine\Migrations\Version\Version;
9
10
/**
11
 * Represents an already executed migration.
12
 * The migration might be not available anymore.
13
 */
14
final class ExecutedMigration
15
{
16
    /** @var Version */
17
    private $version;
18
19
    /** @var DateTimeImmutable|null */
20
    private $executedAt;
21
22
    /**
23
     * Seconds
24
     *
25
     * @var float|null
26
     */
27
    public $executionTime;
28
29 56
    public function __construct(Version $version, ?DateTimeImmutable $executedAt = null, ?float $executionTime = null)
30
    {
31 56
        $this->version       = $version;
32 56
        $this->executedAt    = $executedAt;
33 56
        $this->executionTime = $executionTime;
34 56
    }
35
36 5
    public function getExecutionTime() : ?float
37
    {
38 5
        return $this->executionTime;
39
    }
40
41 6
    public function getExecutedAt() : ?DateTimeImmutable
42
    {
43 6
        return $this->executedAt;
44
    }
45
46 48
    public function getVersion() : Version
47
    {
48 48
        return $this->version;
49
    }
50
}
51