Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
7 / 7 |
CRAP | |
100.00% |
1 / 1 |
| TenantContext | |
100.00% |
7 / 7 |
|
100.00% |
7 / 7 |
7 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getTenantId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getHostname | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getTablePrefix | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getConfigDir | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPlan | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getQuotas | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Tenant context |
| 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-02-08 |
| 16 | */ |
| 17 | |
| 18 | declare(strict_types=1); |
| 19 | |
| 20 | namespace phpMyFAQ\Tenant; |
| 21 | |
| 22 | readonly class TenantContext |
| 23 | { |
| 24 | public function __construct( |
| 25 | private int $tenantId, |
| 26 | private string $hostname, |
| 27 | private string $tablePrefix, |
| 28 | private string $configDir, |
| 29 | private string $plan, |
| 30 | private TenantQuotas $quotas, |
| 31 | ) { |
| 32 | } |
| 33 | |
| 34 | public function getTenantId(): int |
| 35 | { |
| 36 | return $this->tenantId; |
| 37 | } |
| 38 | |
| 39 | public function getHostname(): string |
| 40 | { |
| 41 | return $this->hostname; |
| 42 | } |
| 43 | |
| 44 | public function getTablePrefix(): string |
| 45 | { |
| 46 | return $this->tablePrefix; |
| 47 | } |
| 48 | |
| 49 | public function getConfigDir(): string |
| 50 | { |
| 51 | return $this->configDir; |
| 52 | } |
| 53 | |
| 54 | public function getPlan(): string |
| 55 | { |
| 56 | return $this->plan; |
| 57 | } |
| 58 | |
| 59 | public function getQuotas(): TenantQuotas |
| 60 | { |
| 61 | return $this->quotas; |
| 62 | } |
| 63 | } |