InvalidMessage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidMultipart() 0 3 1
A invalidOriginator() 0 3 1
A invalidReference() 0 3 1
1
<?php
2
3
namespace NotificationChannels\Cmsms\Exceptions;
4
5
use Exception;
6
7
class InvalidMessage extends Exception
8
{
9 3
    public static function invalidReference(string $reference): self
10
    {
11 3
        return new static("The reference on the CMSMS message may only contain 1 - 32 alphanumeric characters. Was given '{$reference}'");
12
    }
13
14 2
    public static function invalidOriginator(string $originator): self
15
    {
16 2
        return new static("The originator on the CMSMS message may only contain 1 - 11 characters. Was given '{$originator}'");
17
    }
18
19 1
    public static function invalidMultipart(int $minimum, int $maximum): self
20
    {
21 1
        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}'");
22
    }
23
}
24