-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathConfigProvider.php
More file actions
55 lines (50 loc) · 1.49 KB
/
Copy pathConfigProvider.php
File metadata and controls
55 lines (50 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
declare(strict_types=1);
namespace Admin\Setting;
use Admin\Setting\Handler\GetViewSettingHandler;
use Admin\Setting\Handler\PostStoreSettingHandler;
use Admin\Setting\Service\SettingService;
use Admin\Setting\Service\SettingServiceInterface;
use Dot\DependencyInjection\Factory\AttributedServiceFactory;
use Mezzio\Application;
/**
* @phpstan-type ConfigType array{
* dependencies: DependenciesType,
* }
* @phpstan-type DependenciesType array{
* delegators: non-empty-array<class-string, array<class-string>>,
* factories: non-empty-array<class-string, class-string>,
* aliases: non-empty-array<class-string, class-string>,
* }
*/
class ConfigProvider
{
/**
* @return ConfigType
*/
public function __invoke(): array
{
return [
'dependencies' => $this->getDependencies(),
];
}
/**
* @return DependenciesType
*/
public function getDependencies(): array
{
return [
'delegators' => [
Application::class => [RoutesDelegator::class],
],
'factories' => [
PostStoreSettingHandler::class => AttributedServiceFactory::class,
GetViewSettingHandler::class => AttributedServiceFactory::class,
SettingService::class => AttributedServiceFactory::class,
],
'aliases' => [
SettingServiceInterface::class => SettingService::class,
],
];
}
}