Completed
Pull Request — master (#96)
by Spencer
62:28
created

InvalidParameterException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 4
1
<?php
2
3
/*
4
 * This file is part of JSON-API.
5
 *
6
 * (c) Toby Zerner <[email protected]>
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 Tobscure\JsonApi\Exception;
13
14
use Exception;
15
use Throwable;
16
17
class InvalidParameterException extends Exception
18
{
19
    /**
20
     * @var string The parameter that caused this exception.
21
     */
22
    private $invalidParameter;
23
24
    /**
25
     * {@inheritdoc}
26
     *
27
     * @param string $invalidParameter The parameter that caused this exception.
28
     */
29
    public function __construct($message = '', $code = 0, Throwable $previous = null, $invalidParameter = '')
30
    {
31
        parent::__construct($message, $code, $previous);
32
33
        $this->invalidParameter = $invalidParameter;
34
    }
35
36
    /**
37
     * @return string The parameter that caused this exception.
38
     */
39
    public function getInvalidParameter()
40
    {
41
        return $this->invalidParameter;
42
    }
43
}
44