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