Passed
Push — refactor/backendModule-ValueOb... ( 4b052a...ab393e )
by Tomas Norre
18:18 queued 15:01
created

ModuleSettings::getItemsPerPage()   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.037

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 3
cp 0.6667
crap 1.037
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AOE\Crawler\Value;
6
7
/*
8
 * (c) 2020 AOE GmbH <[email protected]>
9
 *
10
 * This file is part of the TYPO3 Crawler Extension.
11
 *
12
 * It is free software; you can redistribute it and/or modify it under
13
 * the terms of the GNU General Public License, either version 2
14
 * of the License, or any later version.
15
 *
16
 * For the full copyright and license information, please read the
17
 * LICENSE.txt file that was distributed with this source code.
18
 *
19
 * The TYPO3 project - inspiring people to share!
20
 */
21
22
final class ModuleSettings
23
{
24
    /**
25
     * @var string
26
     */
27
    private $processListMode;
28
29
    /**
30
     * @var string
31
     */
32
    private $crawlAction;
33
34
    /**
35
     * @var int
36
     */
37
    private $depth;
38
39
    /**
40
     * @var bool
41
     */
42
    private $logResultLog;
43
44
    /**
45
     * @var int
46
     */
47
    private $itemsPerPage;
48
49
    /**
50
     * @var string
51
     */
52
    private $logDisplay;
53
54
    /**
55
     * @var bool
56
     */
57
    private $logFeVars;
58
59 1
    public function __construct(
60
        string $processListMode,
61
        string $crawlAction,
62
        int $depth,
63
        bool $logResultLog,
64
        int $itemsPerPage,
65
        string $logDisplay,
66
        bool $logFeVars
67
    ) {
68 1
        $this->processListMode = $processListMode;
69 1
        $this->crawlAction = $crawlAction;
70 1
        $this->depth = $depth;
71 1
        $this->logResultLog = $logResultLog;
72 1
        $this->itemsPerPage = $itemsPerPage;
73 1
        $this->logDisplay = $logDisplay;
74 1
        $this->logFeVars = $logFeVars;
75 1
    }
76
77 1
    public static function fromArray(array $array): self
78
    {
79 1
        return new self(
80 1
            $array['processListMode'],
81 1
            $array['crawlaction'],
82 1
            $array['depth'],
83 1
            $array['log_resultLog'],
84 1
            $array['itemPerPage'],
85 1
            $array['log_display'],
86 1
            $array['log_feVars']
87
        );
88
    }
89
90 1
    public function getProcessListMode(): string
91
    {
92 1
        return $this->processListMode;
93
    }
94
95 1
    public function getCrawlAction(): string
96
    {
97 1
        return $this->crawlAction;
98
    }
99
100 1
    public function getDepth(): int
101
    {
102 1
        return $this->depth;
103
    }
104
105 1
    public function isLogResultLog(): bool
106
    {
107 1
        return $this->logResultLog;
108
    }
109
110 1
    public function getItemsPerPage(): int
111
    {
112 1
        return $this->itemsPerPage;
113
    }
114
115 1
    public function getLogDisplay(): string
116
    {
117 1
        return $this->logDisplay;
118
    }
119
120 1
    public function isLogFeVars(): bool
121
    {
122 1
        return $this->logFeVars;
123
    }
124
}
125