-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.power
More file actions
70 lines (65 loc) · 1.76 KB
/
code.power
File metadata and controls
70 lines (65 loc) · 1.76 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
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(Notifi::class, 'Gitea.Notifications')
->share('Gitea.Notifications', [$this, 'getNotifications'], true);
$container->alias(Repository::class, 'Gitea.Notifications.Repository')
->share('Gitea.Notifications.Repository', [$this, 'getRepository'], true);
$container->alias(Thread::class, 'Gitea.Notifications.Thread')
->share('Gitea.Notifications.Thread', [$this, 'getThread'], true);
}
/**
* Get the Notifications class
*
* @param Container $container The DI container.
*
* @return Notifi
* @since 3.2.0
*/
public function getNotifications(Container $container): Notifi
{
return new Notifi(
$container->get('Gitea.Utilities.Http'),
$container->get('Gitea.Dynamic.Uri'),
$container->get('Gitea.Utilities.Response')
);
}
/**
* Get the Repository class
*
* @param Container $container The DI container.
*
* @return Repository
* @since 3.2.0
*/
public function getRepository(Container $container): Repository
{
return new Repository(
$container->get('Gitea.Utilities.Http'),
$container->get('Gitea.Dynamic.Uri'),
$container->get('Gitea.Utilities.Response')
);
}
/**
* Get the Thread class
*
* @param Container $container The DI container.
*
* @return Thread
* @since 3.2.0
*/
public function getThread(Container $container): Thread
{
return new Thread(
$container->get('Gitea.Utilities.Http'),
$container->get('Gitea.Dynamic.Uri'),
$container->get('Gitea.Utilities.Response')
);
}