ExecutedMigration   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 37
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getExecutionTime() 0 4 1
A getExecutedAt() 0 4 1
A getVersion() 0 4 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