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

CommandMappingException   A

Complexity

Total Complexity 1

Size/Duplication

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalize() 0 4 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