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 22 "name" : " micro/kernel-boot-dependency" ,
33 "description" : " Micro Framework: Kernel Boot loader - component to provide dependencies" ,
44 "type" : " library" ,
5- "version" : " 1.0 " ,
5+ "version" : " 1.1 " ,
66 "require" : {
77 "micro/kernel" : " ^1" ,
88 "micro/autowire" : " ^1"
Original file line number Diff line number Diff line change 22
33namespace Micro \Framework \Kernel \Boot ;
44
5+ use Micro \Component \DependencyInjection \Autowire \AutowireHelperFactory ;
6+ use Micro \Component \DependencyInjection \Autowire \AutowireHelperFactoryInterface ;
7+ use Micro \Component \DependencyInjection \Autowire \AutowireHelperInterface ;
58use Micro \Component \DependencyInjection \Autowire \ContainerAutowire ;
69use Micro \Component \DependencyInjection \Container ;
710use Micro \Framework \Kernel \Plugin \DependencyProviderInterface ;
@@ -18,13 +21,18 @@ class DependencyProviderBootLoader implements PluginBootLoaderInterface
1821 /**
1922 * @param Container $container
2023 */
21- public function __construct (Container $ container )
24+ public function __construct (ContainerInterface $ container )
2225 {
2326 if (!($ container instanceof ContainerAutowire)) {
2427 $ container = new ContainerAutowire ($ container );
2528 }
2629
2730 $ this ->container = $ container ;
31+
32+ $ this ->container ->register (AutowireHelperInterface::class,
33+ fn () => (new AutowireHelperFactory ($ this ->container ))
34+ ->create ()
35+ );
2836 }
2937
3038 /**
Original file line number Diff line number Diff line change 77/**
88 * @TODO: Remove extends for 2.0 version
99 */
10- interface DependencyProviderInterface extends ApplicationPluginInterface
10+ interface DependencyProviderInterface
1111{
1212 /**
1313 * @param Container $container
Original file line number Diff line number Diff line change 33namespace Micro \Framework \Kernel \Plugin \Boot \Test ;
44
55use 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 ;
87use Micro \Framework \Kernel \Plugin \DependencyProviderInterface ;
98use PHPUnit \Framework \TestCase ;
109
@@ -32,18 +31,7 @@ public function testBoot()
3231 ->method ('name ' )
3332 ->willReturn ('test ' );
3433
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 {};
4735
4836 foreach ([ $ pluginMock , $ pluginNotDependencyProvider ] as $ plugin ) {
4937 $ dataProviderBootLoader ->boot ($ plugin );
You can’t perform that action at this time.
0 commit comments