PageViews::getAmount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Telegraph package.
5
 *
6
 * (c) Arthur Edamov <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 */
12
13
declare(strict_types=1);
14
15
namespace Telegraph;
16
17
/**
18
 * Class PageList
19
 *
20
 * This object represents a list of Telegraph articles belonging to an account.
21
 * Most recently created articles first.
22
 *
23
 * @package Telegraph
24
 */
25
class PageViews
26
{
27
    /**
28
     * The number of page views for a Telegraph article.
29
     *
30
     * @var int
31
     */
32
    private $amount;
33
34
    public function __construct(array $data)
35
    {
36
        $this->amount = count($data);
37
    }
38
39
    /**
40
     * Get Page views amount.
41
     *
42
     * @return int
43
     */
44
    public function getAmount(): int
45
    {
46
        return $this->amount;
47
    }
48
}
49