RestException::getData()   A
last analyzed

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 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the AMFWebServicesClientBundle package.
5
 *
6
 * (c) Amine Fattouch <http://github.com/fattouchsquall>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace AMF\WebServicesClientBundle\Rest\Exception;
13
14
/**
15
 * Exception class.
16
 *
17
 * @author Mohamed Amine Fattouch <[email protected]>
18
 */
19
class RestException extends \Exception
20
{
21
    /**
22
     * @var array
23
     */
24
    protected $data;
25
26
    /**
27
     * The constructor class.
28
     *
29
     * @param string     $message  The internal exception message.
30
     * @param integer    $code     The internal exception code.
31
     * @param \Exception $previous The previous exception.
32
     * @param array      $data     The wrong data.
33
     */
34
    public function __construct($message = null, $code = 0, \Exception $previous = null, array $data = [])
35
    {
36
        parent::__construct($message, $code, $previous);
37
38
        $this->data = $data;
39
    }
40
41
    /**
42
     * The getter for data.
43
     *
44
     * @return array
45
     */
46
    public function getData()
47
    {
48
        return $this->data;
49
    }
50
}
51