Completed
Push — master ( 3c0dd3...6d048a )
by Andrii
14:00
created

EmptyCollectionDocument::getJsonApi()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace hiapi\jsonApi;
5
6
use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractCollectionDocument;
7
use WoohooLabs\Yin\JsonApi\Schema\JsonApiObject;
8
use WoohooLabs\Yin\JsonApi\Schema\Link\DocumentLinks;
9
10
/**
11
 * Empty collection to return empty array (nothin is found).
12
 *
13
 * @author Andrii Vasyliev <[email protected]>
14
 */
15
final class EmptyCollectionDocument extends AbstractCollectionDocument
16
{
17
    public function __construct()
18
    {
19
        parent::__construct(new EmptyResource);
20
    }
21
22
    public function getJsonApi(): ?JsonApiObject
23
    {
24
        return new JsonApiObject('1.1');
25
    }
26
27
    public function getMeta(): array
28
    {
29
        return [];
30
    }
31
32
    public function getLinks(): ?DocumentLinks
33
    {
34
        return null;
35
    }
36
}
37