InvalidParameterMemberError::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 3
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