Passed
Push — main ( a2d9fb...be9758 )
by Daniel
02:34
created

ResponderFactory::createPingResponder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Usox\HyperSonic\FeatureSet\V1161\Responder;
6
7
use Usox\HyperSonic\Response\ResponderInterface;
8
9
final class ResponderFactory implements ResponderFactoryInterface
10
{
11
    /**
12
     * @param array{
13
     *  ignoredArticles: string,
14
     *  index: array<array{
15
     *    name: string,
16
     *    artist: array<array{
17
     *      id: string,
18
     *      name: string,
19
     *      coverArt: string,
20
     *      artistImageUrl: string,
21
     *      albumCount: int,
22
     *      starred?: string
23
     *    }>
24
     *  }>
25
     * } $artistList
26
     */
27 1
    public function createArtistsResponder(
28
        array $artistList
29
    ): ResponderInterface {
30 1
        return new ArtistsResponder(
31
            $artistList,
32
        );
33
    }
34
35
    /**
36
     * @param array{
37
     *  valid: string,
38
     *  email: string,
39
     *  licenseExpires: string
40
     * } $licenseData
41
     */
42 1
    public function createLicenseResponder(
43
        array $licenseData
44
    ): ResponderInterface {
45 1
        return new LicenseResponder(
46
            $licenseData,
47
        );
48
    }
49
50 1
    public function createPingResponder(): ResponderInterface
51
    {
52 1
        return new PingResponder();
53
    }
54
55 1
    public function createCoverArtResponder(
56
        string $coverArt,
57
        string $contentType,
58
    ): ResponderInterface {
59 1
        return new CoverArtResponder(
60
            $coverArt,
61
            $contentType,
62
        );
63
    }
64
}
65