Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\Instance\Application\Service; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use App\Core\Instance\Domain\Model\ClientInstance; |
| 12 | |
| 13 | /** |
| 14 | * Instance Context Manager Interface. |
| 15 | * |
| 16 | * @package App\Core\Instance\Application\Service |
| 17 | */ |
| 18 | interface InstanceContextManagerInterface |
| 19 | { |
| 20 | /** |
| 21 | * Returns currently active instance ID (or null for local admin console). |
| 22 | * |
| 23 | * @return int|null Instance ID or null if local. |
| 24 | */ |
| 25 | public function getActiveInstanceId(): ?int; |
| 26 | |
| 27 | /** |
| 28 | * Returns active ClientInstance domain model or null if local. |
| 29 | * |
| 30 | * @return ClientInstance|null Active instance or null. |
| 31 | */ |
| 32 | public function getActiveInstance(): ?ClientInstance; |
| 33 | |
| 34 | /** |
| 35 | * Checks if current execution context is connected to a remote client instance. |
| 36 | * |
| 37 | * @return bool True if remote instance is active. |
| 38 | */ |
| 39 | public function isRemote(): bool; |
| 40 | |
| 41 | /** |
| 42 | * Switches context to local admin console. |
| 43 | */ |
| 44 | public function switchToLocal(): void; |
| 45 | |
| 46 | /** |
| 47 | * Switches context to specified remote client instance. |
| 48 | * |
| 49 | * @param int $instanceId Target instance ID. |
| 50 | * @return bool True if switch succeeded, false if instance not found/inactive. |
| 51 | */ |
| 52 | public function switchToInstance(int $instanceId): bool; |
| 53 | |
| 54 | /** |
| 55 | * Returns all available active instances for context selection dropdown. |
| 56 | * |
| 57 | * @return list<ClientInstance> List of active instances. |
| 58 | */ |
| 59 | public function getAllActiveInstances(): array; |
| 60 | } |