Passed
Branch develop (2fd4b5)
by Alexey
01:46
created

Permission::getLabel()   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
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * @author   Ne-Lexa
6
 * @license  MIT
7
 * @link     https://github.com/Ne-Lexa/google-play-scraper
8
 */
9
10
namespace Nelexa\GPlay\Model;
11
12
/**
13
 * Contains information about application permissions.
14
 */
15
class Permission implements \JsonSerializable
16
{
17
    use JsonSerializableTrait;
18
19
    /** @var string Permission label. */
20
    private $label;
21
22
    /** @var string Permission description. */
23
    private $description;
24
25
    /**
26
     * Creates an object with information about one of the permissions of the Android application.
27
     *
28
     * @param string $label Permission label.
29
     * @param string $description Permission description.
30
     */
31 1
    public function __construct(string $label, string $description)
32
    {
33 1
        $this->label = $label;
34 1
        $this->description = $description;
35 1
    }
36
37
    /**
38
     * Returns permission label.
39
     *
40
     * @return string Permission label.
41
     */
42
    public function getLabel(): string
43
    {
44
        return $this->label;
45
    }
46
47
    /**
48
     * Returns permission description.
49
     *
50
     * @return string Permission description.
51
     */
52
    public function getDescription(): string
53
    {
54
        return $this->description;
55
    }
56
57
    /**
58
     * Returns class properties as an array.
59
     *
60
     * @return array Class properties as an array.
61
     */
62
    public function asArray(): array
63
    {
64
        return [
65
            'label' => $this->label,
66
            'description' => $this->description,
67
        ];
68
    }
69
}
70