Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
9 / 9 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
MigrationConfig | |
100.00% |
9 / 9 |
|
100.00% |
6 / 6 |
6 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
isProcessAll | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getChunkSize | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPickSize | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getCustomParameter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getCustomParameters | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License |
6 | * as published by the Free Software Foundation; under version 2 |
7 | * of the License (non-upgradable). |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * |
18 | * Copyright (c) 2020 (original work) Open Assessment Technologies SA; |
19 | */ |
20 | |
21 | declare(strict_types=1); |
22 | |
23 | namespace oat\tao\model\task\migration; |
24 | |
25 | class MigrationConfig |
26 | { |
27 | /** @var int */ |
28 | private $chunkSize; |
29 | |
30 | /** @var array */ |
31 | private $customParameters; |
32 | |
33 | /** @var int */ |
34 | private $pickSize; |
35 | |
36 | /** @var bool */ |
37 | private $processAll; |
38 | |
39 | public function __construct( |
40 | array $parameters, |
41 | int $chunkSize, |
42 | int $pickSize, |
43 | bool $processAll |
44 | ) { |
45 | $this->chunkSize = $chunkSize; |
46 | $this->customParameters = $parameters; |
47 | $this->pickSize = $pickSize; |
48 | $this->processAll = $processAll; |
49 | } |
50 | |
51 | public function isProcessAll(): bool |
52 | { |
53 | return $this->processAll; |
54 | } |
55 | |
56 | public function getChunkSize(): int |
57 | { |
58 | return $this->chunkSize; |
59 | } |
60 | |
61 | public function getPickSize(): int |
62 | { |
63 | return $this->pickSize; |
64 | } |
65 | |
66 | /** |
67 | * @return mixed |
68 | */ |
69 | public function getCustomParameter(string $name) |
70 | { |
71 | return $this->customParameters[$name] ?? null; |
72 | } |
73 | |
74 | public function getCustomParameters(): array |
75 | { |
76 | return $this->customParameters; |
77 | } |
78 | } |