1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the Micro framework package. |
||
5 | * |
||
6 | * (c) Stanislau Komar <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Micro\Framework\Kernel; |
||
13 | |||
14 | use Micro\Component\DependencyInjection\Container; |
||
15 | use Micro\Framework\Kernel\Plugin\PluginBootLoaderInterface; |
||
16 | |||
17 | /** |
||
18 | * The kernel is needed for plugin management. A plugin can be any class object. |
||
19 | */ |
||
20 | interface KernelInterface |
||
21 | { |
||
22 | /** |
||
23 | * Get service Dependency Injection Container. |
||
24 | * |
||
25 | * @api |
||
26 | */ |
||
27 | public function container(): Container; |
||
28 | |||
29 | /** |
||
30 | * @throws \RuntimeException |
||
31 | */ |
||
32 | public function addBootLoader(PluginBootLoaderInterface $bootLoader): self; |
||
33 | |||
34 | /** |
||
35 | * @param iterable<PluginBootLoaderInterface> $bootLoaders |
||
36 | * |
||
37 | * @throws \RuntimeException |
||
38 | */ |
||
39 | public function setBootLoaders(iterable $bootLoaders): self; |
||
40 | |||
41 | /** |
||
42 | * Run application. |
||
43 | * |
||
44 | * @api |
||
45 | */ |
||
46 | public function run(): void; |
||
47 | |||
48 | /** |
||
49 | * @param class-string $applicationPluginClass |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
50 | */ |
||
51 | public function loadPlugin(string $applicationPluginClass): void; |
||
52 | |||
53 | /** |
||
54 | * Iterate plugins with the specified type. |
||
55 | * |
||
56 | * @template T of object |
||
57 | * |
||
58 | * @psalm-param class-string<T>|null $interfaceInherited if empty, each connected plugin will be iterated |
||
59 | |||
60 | * |
||
61 | * @return \Traversable<T|object> Application plugins iterator |
||
62 | * |
||
63 | * @api |
||
64 | */ |
||
65 | public function plugins(string $interfaceInherited = null): \Traversable; |
||
66 | } |
||
67 |