Completed
Push — master ( 4be545...15ae11 )
by Beñat
01:37
created

GetEventsQuery::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 3
1
<?php
2
3
/*
4
 * This file is part of the Shared Kernel library.
5
 *
6
 * Copyright (c) 2016-present LIN3S <[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
declare(strict_types=1);
13
14
namespace LIN3S\SharedKernel\Application\Event;
15
16
/**
17
 * @author Beñat Espiña <[email protected]>
18
 */
19
class GetEventsQuery
20
{
21
    private $page;
22
    private $pageSize;
23
    private $since;
24
25
    public function __construct(int $page, int $pageSize, string $since = null)
26
    {
27
        $this->page = $page;
28
        $this->pageSize = $pageSize;
29
        $this->since = null === $since ? null : new \DateTimeImmutable($since);
30
    }
31
32
    public function page() : int
33
    {
34
        return $this->page;
35
    }
36
37
    public function pageSize() : int
38
    {
39
        return $this->pageSize;
40
    }
41
42
    public function since() : ?\DateTimeImmutable
43
    {
44
        return $this->since;
45
    }
46
}
47