DbVersionRepositoryFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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