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

GetEventsQuery   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A page() 0 4 1
A pageSize() 0 4 1
A since() 0 4 1
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