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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A nonPersistent() 0 3 1
A persistent() 0 3 1
A __construct() 0 3 1
A toInt() 0 3 1
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