InvalidSortError   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 16
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 InvalidSortError.
14
 */
15
class InvalidSortError extends Error
16
{
17
    /**
18
     * @param string $paramName
19
     */
20
    public function __construct($paramName)
21
    {
22
        parent::__construct(
23
            'Invalid Sort Parameter',
24
            sprintf('Sorting by `%s` not supported.', $paramName),
25
            'bad_request'
26
        );
27
28
        $this->setSource('parameter', 'sort');
29
    }
30
}
31