Addon.php
1.26 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
56
57
<?php declare( strict_types=1 );
namespace ACP\ConditionalFormat;
use AC\Asset\Location;
use AC\Registerable;
use ACP\ConditionalFormat\Service;
use ACP\ConditionalFormat\Settings\ListScreen\HideOnScreenFactory;
final class Addon implements Registerable {
/**
* @var Location\Absolute
*/
private $location;
/**
* @var RulesRepositoryFactory
*/
private $rules_repository_factory;
/**
* @var HideOnScreenFactory
*/
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 {
$operators = new Operators();
$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 ),
];
foreach ( $services as $service ) {
$service->register();
}
}
}