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.

DeliveryMode::nonPersistent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Model\Basic\Message;
5
6
final class DeliveryMode
7
{
8
    private const NON_PERSISTENT = 1;
9
    private const PERSISTENT = 2;
10
11
    private static $nonPersistent;
12
    private static $persistent;
13
14
    private $mode;
15
16 4
    private function __construct(int $mode)
17
    {
18 4
        $this->mode = $mode;
19 4
    }
20
21
    /**
22
     * Message will be lost in case of server crash
23
     */
24 4
    public static function nonPersistent(): self
25
    {
26 4
        return self::$nonPersistent ?? self::$nonPersistent = new self(self::NON_PERSISTENT);
27
    }
28
29
    /**
30
     * Will persist the message to disk on the server, meaning it will be restored
31
     * in case of a server crash (applies only to durable queues)
32
     */
33 14
    public static function persistent(): self
34
    {
35 14
        return self::$persistent ?? self::$persistent = new self(self::PERSISTENT);
36
    }
37
38 12
    public function toInt(): int
39
    {
40 12
        return $this->mode;
41
    }
42
}
43