Completed
Pull Request — master (#96)
by Spencer
126:15 queued 61:20
created

InvalidParameterException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 2
c 3
b 1
f 1
lcom 0
cbo 0
dl 0
loc 27
rs 10

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
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