MalformedRequest   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 82
ccs 16
cts 16
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getLinks() 0 3 1
A getStatus() 0 4 1
A getCode() 0 3 1
A getTitle() 0 4 1
A getDetail() 0 4 1
A getSource() 0 3 1
A getMeta() 0 3 1
1
<?php
2
3
namespace RealPage\JsonApi\Requests;
4
5
use Neomerx\JsonApi\Contracts\Document\ErrorInterface;
6
7
class MalformedRequest implements ErrorInterface
8
{
9
    /**
10
     * Get a unique identifier for this particular occurrence of the problem.
11
     *
12
     * @return int|string|null
13
     */
14 3
    public function getId()
15
    {
16 3
    }
17
18
    /**
19
     * Get links that may lead to further details about this particular occurrence of the problem.
20
     *
21
     * @return null|array<string,\Neomerx\JsonApi\Contracts\Schema\LinkInterface>
22
     */
23 3
    public function getLinks()
24
    {
25 3
    }
26
27
    /**
28
     * Get the HTTP status code applicable to this problem, expressed as a string value.
29
     *
30
     * @return string|null
31
     */
32 3
    public function getStatus()
33
    {
34 3
        return 400; // bad request
35
    }
36
37
    /**
38
     * Get an application-specific error code, expressed as a string value.
39
     *
40
     * @return string|null
41
     */
42 3
    public function getCode()
43
    {
44 3
    }
45
46
    /**
47
     * Get a short, human-readable summary of the problem.
48
     *
49
     * It should not change from occurrence to occurrence of the problem, except for purposes of localization.
50
     *
51
     * @return string|null
52
     */
53 3
    public function getTitle()
54
    {
55 3
        return 'Request json malformed';
56
    }
57
58
    /**
59
     * Get a human-readable explanation specific to this occurrence of the problem.
60
     *
61
     * @return string|null
62
     */
63 3
    public function getDetail()
64
    {
65 3
        return 'The request json is malformed and could not be parsed.';
66
    }
67
68
    /**
69
     * An object containing references to the source of the error, optionally including any of the following members:
70
     *    "pointer"   - A JSON Pointer [RFC6901] to the associated entity in the request document
71
     *                  [e.g. "/data" for a primary data object, or "/data/attributes/title" for a specific attribute].
72
     *    "parameter" - An optional string indicating which query parameter caused the error.
73
     *
74
     * @return array|null
75
     */
76 3
    public function getSource()
77
    {
78 3
    }
79
80
    /**
81
     * Get error meta information.
82
     *
83
     * @return array|null
84
     */
85 3
    public function getMeta()
86
    {
87 3
    }
88
}
89