Completed
Push — master ( 77d207...af47af )
by Atymic
05:06
created

CouldNotSendNotification::invalidReceiver()   A

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
    /**
10
     * @return static
11
     */
12 1
    public static function invalidReceiver()
13
    {
14 1
        return new static(
15 1
            'The notifiable did not have a receiving phone number. Add a routeNotificationForSns
16
            method or one of the conventional attributes to your notifiable.'
17
        );
18
    }
19
20
    /**
21
     * @param mixed $message
22
     *
23
     * @return static
24
     */
25 1
    public static function invalidMessageObject($message)
26
    {
27 1
        $type = is_object($message) ? get_class($message) : gettype($message);
28
29 1
        return new static(
30 1
            'Notification was not sent. The message should be a instance of `'.SnsMessage::class."` and a `{$type}` was given."
31
        );
32
    }
33
}
34