InvalidParameterMemberError   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 11/28/15
5
 * Time: 1:31 AM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace NilPortugues\Api\JsonApi\Server\Errors;
11
12
/**
13
 * Class InvalidParameterError.
14
 */
15
class InvalidParameterMemberError extends Error
16
{
17
    /**
18
     * @param string $paramName
19
     * @param string $fieldKey
20
     * @param string $fieldName
21
     */
22
    public function __construct($paramName, $fieldKey, $fieldName)
23
    {
24
        parent::__construct(
25
            'Invalid Parameter',
26
            sprintf('Parameter member `%s` not supported.', $paramName),
27
            'bad_request'
28
        );
29
30
        $this->setSource('parameter', sprintf('%s[%s]', $fieldName, $fieldKey));
31
    }
32
}
33