Total Complexity | 5 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class TransactionManager |
||
12 | { |
||
13 | /** |
||
14 | * @var Configuration |
||
15 | */ |
||
16 | private $configuration; |
||
17 | |||
18 | /** |
||
19 | * @var TransactionProcessor |
||
20 | */ |
||
21 | private $processor; |
||
22 | |||
23 | /** |
||
24 | * @var TransactionHydrator |
||
25 | */ |
||
26 | private $hydrator; |
||
27 | |||
28 | public function __construct(Configuration $configuration) |
||
29 | { |
||
30 | $this->configuration = $configuration; |
||
31 | |||
32 | $this->processor = new TransactionProcessor($configuration); |
||
33 | $this->hydrator = new TransactionHydrator($configuration); |
||
34 | } |
||
35 | |||
36 | public function getConfiguration(): Configuration |
||
37 | { |
||
38 | return $this->configuration; |
||
39 | } |
||
40 | |||
41 | public function populate(Transaction $transaction): void |
||
42 | { |
||
43 | $this->hydrator->hydrate($transaction); |
||
44 | } |
||
45 | |||
46 | public function process(Transaction $transaction): void |
||
47 | { |
||
48 | $this->processor->process($transaction); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param EntityManagerInterface $em |
||
53 | * |
||
54 | * @return EntityManagerInterface |
||
55 | */ |
||
56 | public function selectStorageSpace(EntityManagerInterface $em): EntityManagerInterface |
||
59 | } |
||
60 | } |
||
61 |