Completed
Push — master ( 07b2d7...571547 )
by Jasper
04:00
created

InvalidResponseDocument::jsonSerialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Swis\JsonApi\Client;
4
5
use Swis\JsonApi\Client\Errors\ErrorCollection;
6
use Swis\JsonApi\Client\Interfaces\DocumentInterface;
7
8
class InvalidResponseDocument implements DocumentInterface
9
{
10
    /**
11
     * @return \Swis\JsonApi\Client\Interfaces\DataInterface
12
     */
13
    public function getData()
14
    {
15
        return null;
16
    }
17
18
    /**
19
     * @return \Swis\JsonApi\Client\Errors\ErrorCollection
20
     */
21
    public function getErrors(): ErrorCollection
22
    {
23
        return new ErrorCollection();
24
    }
25
26
    /**
27
     * @return bool
28
     */
29
    public function hasErrors(): bool
30
    {
31
        return false;
32
    }
33
34
    /**
35
     * @return mixed
36
     */
37
    public function getMeta(): array
38
    {
39
        return [];
40
    }
41
42
    /**
43
     * @return mixed
44
     */
45
    public function getLinks(): array
46
    {
47
        return [];
48
    }
49
50
    /**
51
     * @return mixed
52
     */
53
    public function getIncluded(): Collection
54
    {
55
        return new Collection();
56
    }
57
58
    /**
59
     * @return mixed
60
     */
61
    public function getJsonapi()
62
    {
63
        return null;
64
    }
65
66
    /**
67
     * Specify data which should be serialized to JSON.
68
     *
69
     * @see  http://php.net/manual/en/jsonserializable.jsonserialize.php
70
     *
71
     * @return mixed data which can be serialized by <b>json_encode</b>,
72
     *               which is a value of any type other than a resource
73
     *
74
     * @since 5.4.0
75
     */
76
    public function jsonSerialize()
77
    {
78
        return $this->toArray();
79
    }
80
81
    /**
82
     * @return array
83
     */
84
    public function toArray(): array
85
    {
86
        return [];
87
    }
88
}
89