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

1 Method

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