Passed
Pull Request — master (#2)
by Andreas
11:41
created

GatewayException::invalidGatewayName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 2
c 1
b 1
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Larium\Pay;
6
7
use RuntimeException;
8
9
class GatewayException extends RuntimeException
10
{
11 1
    public static function notImplemented($transaction, $gateway): self
12
    {
13 1
        return new self(
14 1
            sprintf("Gateway `%s` does not support `%s` transaction", $gateway, $transaction)
15 1
        );
16
    }
17
18 1
    public static function invalidGatewayName($name): self
19
    {
20 1
        return new self(
21 1
            sprintf("Could not resolve gateway with name `%s`", $name)
22 1
        );
23
    }
24
25
    public static function gatewayAlreadyRegistered($name): self
26
    {
27
        return new self(
28
            sprintf("Gateway with name `%s` is already registered", $name)
29
        );
30
    }
31
}
32