Completed
Push — master ( 60aec0...f632bc )
by Andreas
12:47 queued 10:41
created

GatewayException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 23
ccs 4
cts 5
cp 0.8
rs 10
c 1
b 1
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A notImplemented() 0 6 1
A invalidGatewayName() 0 6 1
A gatewayAlreadyRegistered() 0 6 1
1
<?php
2
3
namespace Larium\Pay;
4
5
use RuntimeException;
6
7
class GatewayException extends RuntimeException
8
{
9 1
    public static function notImplemented($method)
10
    {
11
        return new self(
12 1
            sprintf("Method `%s` is not supported!", $method)
13
        );
14
    }
15
16 1
    public static function invalidGatewayName($name)
17
    {
18
        return new self(
19 1
            sprintf("Could not resolve gateway with name `%s`", $name)
20
        );
21
    }
22
23
    public static function gatewayAlreadyRegistered($name)
24
    {
25
        return new self(
26
            sprintf("Gateway with name `%s` is already registered", $name)
27
        );
28
    }
29
}
30