IsolateFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 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