Completed
Push — master ( 78c033...223eb1 )
by Michel
12s
created

InvalidMessage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidReference() 0 4 1
A invalidOriginator() 0 4 1
A invalidTariff() 0 4 1
1
<?php
2
3
namespace NotificationChannels\Cmsms\Exceptions;
4
5
use Exception;
6
7
class InvalidMessage extends Exception
8
{
9
    /**
10
     * @param string $reference
11
     * @return static
12
     */
13 3
    public static function invalidReference($reference)
14
    {
15 3
        return new static("The reference on the CMSMS message may only contain 1 - 32 alphanumeric characters. Was given '{$reference}'");
16
    }
17
18
    /**
19
     * @param string $originator
20
     * @return static
21
     */
22 2
    public static function invalidOriginator($originator)
23
    {
24 2
        return new static("The originator on the CMSMS message may only contain 1 - 11 characters. Was given '{$originator}'");
25
    }
26
27
    /**
28
     * @param int $tariff
29
     * @return static
30
     */
31
    public static function invalidTariff($tariff)
32
    {
33
        return new static("The tarrif on the CMSMS message may only contain a nonzero integer. Was given '{$tariff}'");
34
    }
35
}
36