Completed
Pull Request — master (#33)
by
unknown
02:16
created

CommandMappingException::normalize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
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 1
        return ['errors' => parent::normalize()];
29
    }
30
}
31