Failed Conditions
Push — master ( 51f284...368556 )
by Jonathan
02:26
created

VersionFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createVersion() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations;
6
7
use Doctrine\Migrations\Configuration\Configuration;
8
9
/**
10
 * @var internal
11
 */
12
final class VersionFactory
13
{
14
    /** @var Configuration */
15
    private $configuration;
16
17
    /** @var VersionExecutorInterface */
18
    private $versionExecutor;
19
20 132
    public function __construct(Configuration $configuration, VersionExecutorInterface $versionExecutor)
21
    {
22 132
        $this->configuration   = $configuration;
23 132
        $this->versionExecutor = $versionExecutor;
24 132
    }
25
26 71
    public function createVersion(string $version, string $migrationClassName) : Version
27
    {
28 71
        return new Version(
29 71
            $this->configuration,
30 71
            $version,
31 71
            $migrationClassName,
32 71
            $this->versionExecutor
33
        );
34
    }
35
}
36