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.

Transaction::commit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 10
ccs 6
cts 6
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Client\Channel\Transaction;
5
6
use Innmind\AMQP\{
7
    Client\Channel\Transaction as TransactionInterface,
8
    Transport\Connection,
9
    Transport\Frame\Channel,
10
};
11
12
final class Transaction implements TransactionInterface
13
{
14
    private $connection;
15
    private $channel;
16
17 16
    public function __construct(Connection $connection, Channel $channel)
18
    {
19 16
        $this->connection = $connection;
20 16
        $this->channel = $channel;
21 16
    }
22
23 6
    public function select(): TransactionInterface
24
    {
25
        $this
26 6
            ->connection
27 6
            ->send($this->connection->protocol()->transaction()->select(
28 6
                $this->channel
29
            ))
30 6
            ->wait('tx.select-ok');
31
32 6
        return $this;
33
    }
34
35 2
    public function commit(): TransactionInterface
36
    {
37
        $this
38 2
            ->connection
39 2
            ->send($this->connection->protocol()->transaction()->commit(
40 2
                $this->channel
41
            ))
42 2
            ->wait('tx.commit-ok');
43
44 2
        return $this;
45
    }
46
47 2
    public function rollback(): TransactionInterface
48
    {
49
        $this
50 2
            ->connection
51 2
            ->send($this->connection->protocol()->transaction()->rollback(
52 2
                $this->channel
53
            ))
54 2
            ->wait('tx.rollback-ok');
55
56 2
        return $this;
57
    }
58
}
59