Skip to content

Commit 7b58e98

Browse files
committed
v1.1 release
1 parent 3bc0628 commit 7b58e98

File tree

3 files changed

+13
-30
lines changed

3 files changed

+13
-30
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "micro/kernel-boot-dependency",
33
"description": "Micro Framework: Kernel Boot loader - component to provide dependencies",
44
"type": "library",
5-
"version": "2.0",
5+
"version": "1.1",
66
"require": {
77
"micro/kernel": "^1",
88
"micro/autowire": "^1"

src/Boot/DependencyProviderBootLoader.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace 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;
58
use Micro\Component\DependencyInjection\Autowire\ContainerAutowire;
69
use Micro\Component\DependencyInjection\Container;
710
use 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
/**

tests/unit/Plugin/Boot/DependencyProviderBootLoaderTest.php

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
namespace Micro\Framework\Kernel\Plugin\Boot\Test;
44

55
use Micro\Component\DependencyInjection\Container;
6-
use Micro\Framework\Kernel\Configuration\PluginConfigurationInterface;
7-
use Micro\Framework\Kernel\Plugin\ApplicationPluginInterface;
8-
use Micro\Framework\Kernel\Plugin\Boot\DependencyProviderBootLoader;
6+
use Micro\Framework\Kernel\Boot\DependencyProviderBootLoader;
7+
use Micro\Framework\Kernel\Plugin\DependencyProviderInterface;
98
use PHPUnit\Framework\TestCase;
10-
use Plugin\DependencyProviderInterface;
119

1210
class DependencyProviderBootLoaderTest extends TestCase
1311
{
@@ -33,30 +31,7 @@ public function testBoot()
3331
->method('name')
3432
->willReturn('test');
3533

36-
$pluginNotDependencyProvider = new class implements ApplicationPluginInterface
37-
{
38-
private readonly PluginConfigurationInterface $pluginConfiguration;
39-
40-
public function provideDependencies(Container $container): void
41-
{
42-
throw new \Exception('Not Allowed here !');
43-
}
44-
45-
public function name(): string
46-
{
47-
return 'test-plugin';
48-
}
49-
50-
public function configuration(): PluginConfigurationInterface
51-
{
52-
return $this->pluginConfiguration;
53-
}
54-
55-
public function setConfiguration(PluginConfigurationInterface $pluginConfiguration): void
56-
{
57-
$this->pluginConfiguration = $pluginConfiguration;
58-
}
59-
};
34+
$pluginNotDependencyProvider = new class{};
6035

6136
foreach ([ $pluginMock, $pluginNotDependencyProvider ] as $plugin) {
6237
$dataProviderBootLoader->boot($plugin);

0 commit comments

Comments
 (0)