Issues (6)

src/KernelInterface.php (1 issue)

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\Component\DependencyInjection\ContainerInterface;
16
use Micro\Framework\Kernel\Plugin\PluginBootLoaderInterface;
17
18
/**
19
 * The kernel is needed for plugin management. A plugin can be any class object.
20
 */
21
interface KernelInterface
22
{
23
    /**
24
     * Application mode (dev, prod, test).
25
     *
26
     * @psalm-suppress PossiblyUnusedMethod
27
     */
28
    public function getMode(): AppModeEnum;
29
30
    /**
31
     * Get service Dependency Injection Container.
32
     *
33
     * @api
34
     *
35
     * @psalm-suppress PossiblyUnusedMethod
36
     */
37
    public function container(): ContainerInterface;
38
39
    /**
40
     * @throws \RuntimeException
41
     *
42
     * @psalm-suppress PossiblyUnusedMethod
43
     * @psalm-suppress PossiblyUnusedReturnValue
44
     */
45
    public function addBootLoader(PluginBootLoaderInterface $bootLoader): self;
46
47
    /**
48
     * @param iterable<PluginBootLoaderInterface> $bootLoaders
49
     *
50
     * @throws \RuntimeException
51
     *
52
     * @psalm-suppress PossiblyUnusedReturnValue
53
     * @psalm-suppress PossiblyUnusedMethod
54
     */
55
    public function setBootLoaders(iterable $bootLoaders): self;
56
57
    /**
58
     * Run application.
59
     *
60
     * @api
61
     */
62
    public function run(): void;
63
64
    /**
65
     * @param class-string $applicationPluginClass
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string.
Loading history...
66
     */
67
    public function loadPlugin(string $applicationPluginClass): void;
68
69
    /**
70
     * Iterate plugins with the specified type.
71
     *
72
     * @template T of object
73
     *
74
     * @psalm-param class-string<T>|null $interfaceInherited if empty, each connected plugin will be iterated
75
     *
76
     * @return \Traversable<T|object> Application plugins iterator
77
     *
78
     * @api
79
     */
80
    public function plugins(?string $interfaceInherited = null): \Traversable;
81
}
82