Passed
Push — master ( 641929...562012 )
by Alexey
06:04 queued 12s
created

ClusterPage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright (c) Ne-Lexa
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 *
11
 * @see https://github.com/Ne-Lexa/google-play-scraper
12
 */
13
14
namespace Nelexa\GPlay\Model;
15
16
use Nelexa\GPlay\GPlayApps;
17
18
/**
19
 * Contains the title and link to the cluster page.
20
 *
21
 * @see GPlayApps::getClusterPages() Returns an iterator of cluster pages.
22
 * @see GPlayApps::getClusterApps() Returns an iterator of applications from the Google Play store for the specified cluster page.
23
 */
24
class ClusterPage
25
{
26
    /** @var string title cluster page */
27
    private $title;
28
29
    /** @var string cluster page url */
30
    private $url;
31
32
    /**
33
     * Creates an object with information about the cluster page.
34
     *
35
     * @param string $title cluster page title
36
     * @param string $url   cluster page url
37
     */
38 16
    public function __construct(string $title, string $url)
39
    {
40 16
        $this->title = $title;
41 16
        $this->url = $url;
42
    }
43
44
    /**
45
     * Returns the cluster page title.
46
     *
47
     * @return string cluster page title
48
     */
49 3
    public function getTitle(): string
50
    {
51 3
        return $this->title;
52
    }
53
54
    /**
55
     * Returns the cluster page url.
56
     *
57
     * @return string cluster page url
58
     */
59 17
    public function getUrl(): string
60
    {
61 17
        return $this->url;
62
    }
63
}
64