Completed
Push — master ( 8c2aeb...d71f39 )
by Semyon
07:15
created

CouldNotSendNotification::make()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace SemyonChetvertnyh\ApnNotificationChannel\Exceptions;
4
5
use Pushok\ApnsResponseInterface;
6
7
class CouldNotSendNotification extends \Exception
8
{
9
    /**
10
     * @var \Pushok\ApnsResponseInterface
11
     */
12
    protected $response;
13
14
    /**
15
     * Create an instance of exception.
16
     *
17
     * @param  string  $message
18
     * @param  int  $errorCode
19
     * @return static
20
     */
21
    public static function make($message, $errorCode)
22
    {
23
        return new static($message, $errorCode);
24
    }
25
26
    /**
27
     * Attach the response.
28
     *
29
     * @param  \Pushok\ApnsResponseInterface  $response
30
     * @return $this
31
     */
32
    public function withResponse(ApnsResponseInterface $response)
33
    {
34
        $this->response = $response;
35
36
        return $this;
37
    }
38
39
    /**
40
     * Get a response.
41
     *
42
     * @return \Pushok\ApnsResponseInterface
43
     */
44
    public function getResponse()
45
    {
46
        return $this->response;
47
    }
48
}
49