File tree Expand file tree Collapse file tree 4 files changed +13
-17
lines changed Expand file tree Collapse file tree 4 files changed +13
-17
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " micro/kernel-boot-dependency" ,
3
3
"description" : " Micro Framework: Kernel Boot loader - component to provide dependencies" ,
4
4
"type" : " library" ,
5
- "version" : " 1.0 " ,
5
+ "version" : " 1.1 " ,
6
6
"require" : {
7
7
"micro/kernel" : " ^1" ,
8
8
"micro/autowire" : " ^1"
Original file line number Diff line number Diff line change 2
2
3
3
namespace Micro \Framework \Kernel \Boot ;
4
4
5
+ use Micro \Component \DependencyInjection \Autowire \AutowireHelperFactory ;
6
+ use Micro \Component \DependencyInjection \Autowire \AutowireHelperFactoryInterface ;
7
+ use Micro \Component \DependencyInjection \Autowire \AutowireHelperInterface ;
5
8
use Micro \Component \DependencyInjection \Autowire \ContainerAutowire ;
6
9
use Micro \Component \DependencyInjection \Container ;
7
10
use Micro \Framework \Kernel \Plugin \DependencyProviderInterface ;
@@ -18,13 +21,18 @@ class DependencyProviderBootLoader implements PluginBootLoaderInterface
18
21
/**
19
22
* @param Container $container
20
23
*/
21
- public function __construct (Container $ container )
24
+ public function __construct (ContainerInterface $ container )
22
25
{
23
26
if (!($ container instanceof ContainerAutowire)) {
24
27
$ container = new ContainerAutowire ($ container );
25
28
}
26
29
27
30
$ this ->container = $ container ;
31
+
32
+ $ this ->container ->register (AutowireHelperInterface::class,
33
+ fn () => (new AutowireHelperFactory ($ this ->container ))
34
+ ->create ()
35
+ );
28
36
}
29
37
30
38
/**
Original file line number Diff line number Diff line change 7
7
/**
8
8
* @TODO: Remove extends for 2.0 version
9
9
*/
10
- interface DependencyProviderInterface extends ApplicationPluginInterface
10
+ interface DependencyProviderInterface
11
11
{
12
12
/**
13
13
* @param Container $container
Original file line number Diff line number Diff line change 3
3
namespace Micro \Framework \Kernel \Plugin \Boot \Test ;
4
4
5
5
use Micro \Component \DependencyInjection \Container ;
6
- use Micro \Framework \Kernel \Plugin \ApplicationPluginInterface ;
7
- use Micro \Framework \Kernel \Plugin \Boot \DependencyProviderBootLoader ;
6
+ use Micro \Framework \Kernel \Boot \DependencyProviderBootLoader ;
8
7
use Micro \Framework \Kernel \Plugin \DependencyProviderInterface ;
9
8
use PHPUnit \Framework \TestCase ;
10
9
@@ -32,18 +31,7 @@ public function testBoot()
32
31
->method ('name ' )
33
32
->willReturn ('test ' );
34
33
35
- $ pluginNotDependencyProvider = new class implements ApplicationPluginInterface
36
- {
37
- public function provideDependencies (Container $ container ): void
38
- {
39
- throw new \Exception ('Not Allowed here ! ' );
40
- }
41
-
42
- public function name (): string
43
- {
44
- return 'test-plugin ' ;
45
- }
46
- };
34
+ $ pluginNotDependencyProvider = new class {};
47
35
48
36
foreach ([ $ pluginMock , $ pluginNotDependencyProvider ] as $ plugin ) {
49
37
$ dataProviderBootLoader ->boot ($ plugin );
You can’t perform that action at this time.
0 commit comments