GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DelegatingTransactionHandler   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 49
c 0
b 0
f 0
wmc 7
lcom 1
cbo 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A begin() 0 6 2
A commit() 0 6 2
A rollback() 0 6 2
1
<?php
2
3
/**
4
 * Workflow library.
5
 *
6
 * @package    workflow
7
 * @author     David Molineus <[email protected]>
8
 * @copyright  2014-2017 netzmacht David Molineus
9
 * @license    LGPL 3.0 https://github.com/netzmacht/workflow
10
 * @filesource
11
 */
12
13
declare(strict_types=1);
14
15
namespace Netzmacht\Workflow\Transaction;
16
17
/**
18
 * Class DelegatingTransactionHandler delegates transaction commands to its children handlers.
19
 *
20
 * @package Netzmacht\Workflow\Transaction
21
 */
22
class DelegatingTransactionHandler implements TransactionHandler
23
{
24
    /**
25
     * Transaction handler.
26
     *
27
     * @var TransactionHandler[]
28
     */
29
    private $transactionHandlers;
30
31
    /**
32
     * DelegatingTransactionHandler constructor.
33
     *
34
     * @param TransactionHandler[] $transactionHandlers Child transaction handlers.
35
     */
36
    public function __construct(array $transactionHandlers)
37
    {
38
        $this->transactionHandlers = $transactionHandlers;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function begin(): void
45
    {
46
        foreach ($this->transactionHandlers as $handler) {
47
            $handler->begin();
48
        }
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function commit(): void
55
    {
56
        foreach ($this->transactionHandlers as $handler) {
57
            $handler->commit();
58
        }
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function rollback(): void
65
    {
66
        foreach ($this->transactionHandlers as $handler) {
67
            $handler->rollback();
68
        }
69
    }
70
}
71