Addon.php
1.35 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
<?php
declare(strict_types=1);
namespace ACP\ConditionalFormat;
use AC\Asset\Location;
use AC\Registerable;
use AC\Services;
use ACP\ConditionalFormat\Settings\ListScreen\HideOnScreenFactory;
final class Addon implements Registerable
{
private $location;
private $rules_repository_factory;
private $hide_on_screen_factory;
public function __construct(
Location\Absolute $location,
RulesRepositoryFactory $rules_repository_factory,
HideOnScreenFactory $hide_on_screen_factory
) {
$this->location = $location;
$this->rules_repository_factory = $rules_repository_factory;
$this->hide_on_screen_factory = $hide_on_screen_factory;
}
public function register(): void
{
$this->create_services()
->register();
}
private function create_services(): Services
{
$operators = new Operators();
return new Services([
new Service\Assets(
$this->location,
$operators,
$this->rules_repository_factory,
$this->hide_on_screen_factory
),
new Service\Formatter($operators, $this->rules_repository_factory),
new Service\ListScreenSettings($this->hide_on_screen_factory),
new Service\Storage($this->rules_repository_factory),
]);
}
}