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

QueryConfiguration   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 60
ccs 14
cts 14
cp 1
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setPerPage() 0 3 1
A getDelimiter() 0 3 1
A getPerPage() 0 3 1
A setPageName() 0 3 1
A setDelimiter() 0 3 1
A getPageName() 0 3 1
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