Passed
Push — master ( 153c68...b3b45e )
by Kylian
01:26
created

ResponseDownload::pushFailMapHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace KriKrixs\object\response;
4
5
use KriKrixs\object\User\User;
6
7
class ResponseDownload extends Response
8
{
9
    private array $downloadedMaps   = [];
10
    private array $failedMaps       = [];
11
12
    /**
13
     * Get downloaded maps hash
14
     * @return array Array of hash
15
     */
16
    public function getDownloadedMapsHash(): array
17
    {
18
        return $this->downloadedMaps;
19
    }
20
21
    /**
22
     * Get failed maps hash
23
     * @return array Array of hash
24
     */
25
    public function getFailedMapsHash(): array
26
    {
27
        return $this->failedMaps;
28
    }
29
30
    /**
31
     * Push a new hash in the downloadedMaps array
32
     * @param string $hash Map hash
33
     * @return ResponseDownload
34
     */
35
    public function pushDownloadMapHash(string $hash): ResponseDownload
36
    {
37
        $this->downloadedMaps[] = $hash;
38
        return $this;
39
    }
40
41
    /**
42
     * Push a new hash in the failedMaps array
43
     * @param string $hash Map hash
44
     * @return ResponseDownload
45
     */
46
    public function pushFailMapHash(string $hash): ResponseDownload
47
    {
48
        $this->failedMaps[] = $hash;
49
        return $this;
50
    }
51
}