Completed
Pull Request — master (#119)
by Toby
03:12
created

InvalidParameterException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 29
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getInvalidParameter() 0 4 1
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
16
class InvalidParameterException extends Exception
17
{
18
    /**
19
     * @var string The parameter that caused this exception.
20
     */
21
    private $invalidParameter;
22
23
    /**
24
     * {@inheritdoc}
25
     *
26
     * @param string $invalidParameter The parameter that caused this exception.
27
     */
28 9
    public function __construct($message = '', $code = 0, $previous = null, $invalidParameter = '')
29
    {
30 9
        parent::__construct($message, $code, $previous);
31
32 9
        $this->invalidParameter = $invalidParameter;
33 9
    }
34
35
    /**
36
     * Get the parameter that caused this exception.
37
     *
38
     * @return string
39
     */
40
    public function getInvalidParameter()
41
    {
42
        return $this->invalidParameter;
43
    }
44
}
45