-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Expand file tree
/
Copy pathBootContext.php
More file actions
35 lines (28 loc) · 809 Bytes
/
BootContext.php
File metadata and controls
35 lines (28 loc) · 809 Bytes
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
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\AppFramework\Bootstrap;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\IServerContainer;
use Psr\Container\ContainerInterface;
class BootContext implements IBootContext {
public function __construct(
private ContainerInterface $appContainer,
) {
}
#[\Override]
public function getAppContainer(): ContainerInterface {
return $this->appContainer;
}
#[\Override]
public function getServerContainer(): ContainerInterface {
return $this->appContainer->get(IServerContainer::class);
}
#[\Override]
public function injectFn(callable $fn) {
return (new FunctionInjector($this->appContainer))->injectFn($fn);
}
}