CommandMappingException::normalize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 1
cts 1
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 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