Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
BootstrapEngineContext
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Core\Bootstrap\Configurator;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Core\Access\Domain\Repository\AccessRepositoryInterface;
12use App\Core\Engine\Domain\DataSource\DynamicDataProviderRegistry;
13use App\Core\Engine\Domain\Repository\MetadataRepositoryInterface;
14use App\Core\Engine\Infrastructure\Repository\SqlAuditRepository;
15use App\Core\Event\SystemEventDispatcher;
16use App\Core\Instance\Application\Service\InstanceContextManagerInterface;
17use App\Core\Instance\Application\Service\RemoteInstanceEngineGatewayInterface;
18use App\Modules\About\Application\Service\SystemDiagnosticsServiceInterface;
19use App\Modules\Profiles\Domain\Repository\ProfilePermissionRepositoryInterface;
20use Nyholm\Psr7\Factory\Psr17Factory;
21use PDO;
22use Twig\Environment as TwigEnvironment;
23use Yiisoft\Cache\CacheInterface;
24use Yiisoft\Session\SessionInterface;
25use Yiisoft\Translator\TranslatorInterface;
26
27/**
28 * Bootstrap Engine Configuration Context DTO.
29 *
30 * Encapsulates core system and infrastructure dependencies required by BootstrapEngineFactory.
31 *
32 * @package App\Core\Bootstrap\Configurator
33 */
34final readonly class BootstrapEngineContext
35{
36    /**
37     * BootstrapEngineContext constructor.
38     *
39     * @param PDO                                        $pdo                    Active PDO connection.
40     * @param string                                     $prefix                 Database table prefix.
41     * @param TwigEnvironment                            $twig                   Configured Twig environment.
42     * @param SystemEventDispatcher                      $eventDispatcher        System event bus.
43     * @param SqlAuditRepository                         $auditRepo              SQL audit log repository.
44     * @param MetadataRepositoryInterface                $metadataRepo           Metadata repository instance.
45     * @param CacheInterface                             $cache                  Cache interface.
46     * @param Psr17Factory                               $psr17Factory           PSR-17 Factory instance.
47     * @param DynamicDataProviderRegistry|null           $dataProviderRegistry   Dynamic data provider registry.
48     * @param SystemDiagnosticsServiceInterface|null     $diagnosticsService     Diagnostics service.
49     * @param InstanceContextManagerInterface|null       $instanceContextManager Instance context manager.
50     * @param RemoteInstanceEngineGatewayInterface|null  $remoteGateway         Remote instance gateway.
51     * @param AccessRepositoryInterface|null             $accessRepo             Access repository instance.
52     * @param ProfilePermissionRepositoryInterface|null  $profileRepo            Profile repository instance.
53     * @param SessionInterface|null                      $session                Session interface instance.
54     * @param string                                     $appProfile             Application deployment profile.
55     */
56    public function __construct(
57        public PDO                                    $pdo,
58        public string                                 $prefix,
59        public TwigEnvironment                        $twig,
60        public SystemEventDispatcher                  $eventDispatcher,
61        public SqlAuditRepository                     $auditRepo,
62        public MetadataRepositoryInterface            $metadataRepo,
63        public CacheInterface                         $cache,
64        public Psr17Factory                           $psr17Factory,
65        public ?DynamicDataProviderRegistry           $dataProviderRegistry = null,
66        public ?SystemDiagnosticsServiceInterface     $diagnosticsService = null,
67        public ?InstanceContextManagerInterface       $instanceContextManager = null,
68        public ?RemoteInstanceEngineGatewayInterface  $remoteGateway = null,
69        public ?AccessRepositoryInterface             $accessRepo = null,
70        public ?ProfilePermissionRepositoryInterface  $profileRepo = null,
71        public ?SessionInterface                      $session = null,
72        public string                                 $appProfile = 'client',
73        public ?PDO                                   $clientPdo = null,
74        public ?TranslatorInterface                   $translator = null
75    ) {
76    }
77}