InvalidAttributeError   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
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 17
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:28 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 InvalidAttributeError.
14
 */
15
class InvalidAttributeError extends Error
16
{
17
    /**
18
     * @param string $property
19
     * @param string $type
20
     */
21
    public function __construct($property, $type)
22
    {
23
        parent::__construct(
24
            'Invalid Attribute',
25
            sprintf('Attribute `%s` for resource `%s` is not valid.', $property, $type),
26
            'bad_request'
27
        );
28
29
        $this->setSource('pointer', '/data/attributes');
30
    }
31
}
32