Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
75.00% |
3 / 4 |
|
75.00% |
3 / 4 |
CRAP | |
0.00% |
0 / 1 |
| InstallationInput | |
75.00% |
3 / 4 |
|
75.00% |
3 / 4 |
4.25 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getLoginName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPassword | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getEmail | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Value object holding validated installation input parameters. |
| 5 | * |
| 6 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 7 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 8 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 9 | * |
| 10 | * @package phpMyFAQ |
| 11 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 12 | * @copyright 2026 phpMyFAQ Team |
| 13 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 14 | * @link https://www.phpmyfaq.de |
| 15 | * @since 2026-01-31 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Setup; |
| 21 | |
| 22 | use SensitiveParameter; |
| 23 | |
| 24 | readonly class InstallationInput |
| 25 | { |
| 26 | /** |
| 27 | * @param array<string, mixed> $dbSetup |
| 28 | * @param array<string, mixed> $ldapSetup |
| 29 | * @param array<string, mixed> $esSetup |
| 30 | * @param array<string, mixed> $osSetup |
| 31 | */ |
| 32 | /* @mago-expect lint:excessive-parameter-list - mirrors the installation form fields as one immutable input */ |
| 33 | public function __construct( |
| 34 | public array $dbSetup, |
| 35 | public array $ldapSetup, |
| 36 | public array $esSetup, |
| 37 | public array $osSetup, |
| 38 | private string $loginName, |
| 39 | #[SensitiveParameter] |
| 40 | private string $password, |
| 41 | public string $language, |
| 42 | public string $realname, |
| 43 | private string $email, |
| 44 | public string $permLevel, |
| 45 | public string $rootDir, |
| 46 | public bool $ldapEnabled = false, |
| 47 | public bool $esEnabled = false, |
| 48 | public bool $osEnabled = false, |
| 49 | ) { |
| 50 | } |
| 51 | |
| 52 | public function getLoginName(): string |
| 53 | { |
| 54 | return $this->loginName; |
| 55 | } |
| 56 | |
| 57 | public function getPassword(): string |
| 58 | { |
| 59 | return $this->password; |
| 60 | } |
| 61 | |
| 62 | public function getEmail(): string |
| 63 | { |
| 64 | return $this->email; |
| 65 | } |
| 66 | } |