Completed
Push — master ( 57c87f...c28b62 )
by Elf
05:03
created

ApiResponseException::getResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace ElfSundae\Laravel\Api\Exceptions;
4
5
use RuntimeException;
6
use ElfSundae\Laravel\Api\Http\ApiResponse;
7
8
class ApiResponseException extends RuntimeException
9
{
10
    /**
11
     * The underlying response instance.
12
     *
13
     * @var \ElfSundae\Laravel\Api\Http\ApiResponse
14
     */
15
    protected $response;
16
17
    /**
18
     * Create a new exception instance.
19
     *
20
     * @param  mixed  $data
21
     * @param  int  $code
22
     * @param  array  $headers
23
     * @param  int  $options
24
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
25
     */
26
    public function __construct($data = null, $code = -1, $headers = [], $options = 0)
27
    {
28
        $this->response = new ApiResponse($data, $code, $headers, $options);
29
    }
30
31
    /**
32
     * Get the underlying response instance.
33
     *
34
     * @return \ElfSundae\Laravel\Api\Http\ApiResponse
35
     */
36
    public function getResponse()
37
    {
38
        return $this->response;
39
    }
40
}
41