CouldNotSendNotification   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidMessageObject() 0 6 2
A invalidReceiver() 0 4 1
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