AttributeOverrideException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Mikemirten\Component\JsonApi\Document\Exception;
5
6
use Mikemirten\Component\JsonApi\Document\ResourceObject;
7
8
/**
9
 * AttributeOverrideException
10
 *
11
 * @package Mikemirten\Component\JsonApi\Exception
12
 */
13
class AttributeOverrideException extends DocumentException
14
{
15
    /**
16
     * AttributeOverrideException constructor.
17
     *
18
     * @param ResourceObject  $resource
19
     * @param string          $name
20
     * @param \Exception|null $previous
21
     */
22 1
    public function __construct(ResourceObject $resource, string $name, \Exception $previous = null)
23
    {
24 1
        $message = sprintf('Attribute "%s" already exists inside of [%s]. To set new one, the old one must be removed.', $name, $resource);
25
26 1
        parent::__construct($message, 0, $previous);
27
    }
28
}