IsolateFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 26
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
1
<?php
2
3
namespace Isolate\Framework\PersistenceContext\Transaction;
4
5
use Isolate\PersistenceContext;
6
use Isolate\Framework\PersistenceContext\Transaction;
7
use Isolate\PersistenceContext\Transaction\Factory as TransactionFactory;
8
use Isolate\UnitOfWork\Factory as UOWFactory;
9
10
/**
11
 * @api
12
 */
13
class IsolateFactory implements TransactionFactory
14
{
15
    /**
16
     * @var UOWFactory
17
     */
18
    private $uowFactory;
19
20
    /**
21
     * @param UOWFactory $uowFactory
22
     */
23
    public function __construct(UOWFactory $uowFactory)
24
    {
25
        $this->uowFactory = $uowFactory;
26
    }
27
28
    /**
29
     * @param PersistenceContext $persistenceContext
30
     * @return Transaction
31
     * 
32
     * @api
33
     */
34
    public function create(PersistenceContext $persistenceContext)
35
    {
36
        return new Transaction($this->uowFactory->create());
37
    }
38
}
39