DbVersionRepositoryFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Bdf\PrimeBundle\Migration;
4
5
use Bdf\Prime\Migration\Version\DbVersionRepository;
6
use Bdf\Prime\ServiceLocator;
7
8
/**
9
 * Create an instance of DbVersionRepository.
10
 */
11
class DbVersionRepositoryFactory
12
{
13
    /**
14
     * @var ServiceLocator
15
     */
16
    private $prime;
17
18
    /**
19
     * PrimeFactory constructor.
20
     */
21 1
    public function __construct(ServiceLocator $prime)
22
    {
23 1
        $this->prime = $prime;
24
    }
25
26
    /**
27
     * Create the repository instance.
28
     */
29 1
    public function create(string $tableName, string $connection = null): DbVersionRepository
30
    {
31 1
        return new DbVersionRepository($this->prime->connection($connection), $tableName);
32
    }
33
}
34