RedisException::connect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 7
rs 10
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace Audiens\AdForm\Exception;
4
5
/**
6
 * Exception thrown if Redis fails
7
 */
8
class RedisException extends SeverityAwareException
9
{
10
    protected const MESSAGE = 'Redis connection failed with message: %s';
11
12
    public static function connect($message): self
13
    {
14
        return new self (
15
            sprintf(self::MESSAGE, $message),
16
            0,
17
            null,
18
            SeverityAwareException::SEVERITY_CRITICAL
19
        );
20
    }
21
}
22