Completed
Push — master ( 591856...78eee1 )
by Michel
07:53 queued 05:46
created

InvalidMessage::invalidReference()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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 2
    public static function invalidTariff($tariff)
32
    {
33 2
        return new static("The tarrif on the CMSMS message may only contain a nonzero integer. Was given '{$tariff}'");
34
    }
35
36
    /**
37
     * @param int $minimum
38
     * @param int $maximum
39
     * @return static
40
     */
41
    public static function invalidMultipart($minimum, $maximum)
42
    {
43
        return new static("The number of message parts for sending a multipart message on the CMSMS message may only contain a integer range from 0 to 8. Was given a minimum of '{$minimum}' and maximum of '{$maximum}'");
44
    }
45
}
46