Passed
Pull Request — master (#126)
by Zing
04:30
created

QueryConfiguration::setPerPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Zing\QueryBuilder;
4
5
class QueryConfiguration
6
{
7
    /**
8
     * @phpstan-var non-empty-string
9
     * @var string
10
     */
11
    private static $delimiter = ',';
12
    /** @var int */
13
    private static $perPage = 15;
14
    /** @var string */
15
    private static $pageName = 'per_page';
16
17
    /**
18
     * @phpstan-return non-empty-string
19
     * @return string
20
     */
21 33
    public static function getDelimiter(): string
22
    {
23 33
        return self::$delimiter;
24
    }
25
26
    /**
27
     * @phpstan-param non-empty-string $delimiter
28
     * @param string $delimiter
29
     */
30 1
    public static function setDelimiter(string $delimiter): void
31
    {
32 1
        self::$delimiter = $delimiter;
33 1
    }
34
35
    /**
36
     * @return int
37
     */
38 4
    public static function getPerPage(): int
39
    {
40 4
        return self::$perPage;
41
    }
42
43
    /**
44
     * @param int $perPage
45
     */
46 46
    public static function setPerPage(int $perPage): void
47
    {
48 46
        self::$perPage = $perPage;
49 46
    }
50
51
    /**
52
     * @return string
53
     */
54 1
    public static function getPageName(): string
55
    {
56 1
        return self::$pageName;
57
    }
58
59
    /**
60
     * @param string $pageName
61
     */
62 46
    public static function setPageName(string $pageName): void
63
    {
64 46
        self::$pageName = $pageName;
65 46
    }
66
67
68
}
69