CommandMappingException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
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 26
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 8 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Imedia\Ammit\UI\Resolver\Exception;
5
6
/**
7
 * @author Guillaume MOREL <[email protected]>
8
 */
9
class CommandMappingException extends AbstractNormalizableCommandResolverException
10
{
11
    /**
12
     * @inheritdoc
13
     * See http://jsonapi.org/examples/#error-objects-basics
14
     * Example:
15
     * {
16
     *   "errors": [
17
     *     {
18
     *       "status": "406",
19
     *       "source": { "pointer": "/data/attributes/firstName" },
20
     *       "title": "Invalid Attribute",
21
     *       "detail": "Array does not contain an element with key firstName"
22
     *     }
23
     *   ]
24
     * }
25
     */
26
    public function normalize(): array
27
    {
28
        return [
29
            'errors' => [
30 1
                parent::normalize()
31
            ]
32
        ];
33
    }
34
}
35