Test Failed
Pull Request — master (#19)
by
unknown
07:17
created

CouldNotSendNotification::invalidReceiver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace NotificationChannels\AfricasTalking\Exceptions;
4
5
use Exception;
6
7
class CouldNotSendNotification extends Exception
8
{
9
    /**
10
     * @param string $error
11
     * @return CouldNotSendNotification
12
     */
13
    public static function serviceRespondedWithAnError(string $error): self
14
    {
15
        return new static("AfricasTalking service responded with an error: {$error}");
16
    }
17
18
19
    public static function invalidReceiver(): self
20
    {
21
        return new static("The notifiable did not have a receiving phone number. Add a routeNotificationForAfricasTalking
22
            method or a phone_number attribute to your notifiable.");
23
    }
24
}
25