CouldNotSendNotification::invalidReceiver()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace NotificationChannels\AwsSns\Exceptions;
4
5
use NotificationChannels\AwsSns\SnsMessage;
6
7
class CouldNotSendNotification extends \Exception
8
{
9 1
    public static function invalidReceiver()
10
    {
11 1
        return new static(
12 1
            'The notifiable did not have a receiving phone number. Add a routeNotificationForSns
13
            method or one of the conventional attributes to your notifiable.'
14
        );
15
    }
16
17 1
    public static function invalidMessageObject($message)
18
    {
19 1
        $type = is_object($message) ? get_class($message) : gettype($message);
20
21 1
        return new static(
22 1
            'Notification was not sent. The message should be a instance of `'.SnsMessage::class."` and a `{$type}` was given."
23
        );
24
    }
25
}
26