Skip to content

Commit 324c519

Browse files
authored
Merge pull request #2 from Micro-PHP/release-1.1
Release 1.1
2 parents 9c35c1a + 7b58e98 commit 324c519

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
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": "1.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
/**

src/Plugin/DependencyProviderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @TODO: Remove extends for 2.0 version
99
*/
10-
interface DependencyProviderInterface extends ApplicationPluginInterface
10+
interface DependencyProviderInterface
1111
{
1212
/**
1313
* @param Container $container

tests/unit/Plugin/Boot/DependencyProviderBootLoaderTest.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
namespace Micro\Framework\Kernel\Plugin\Boot\Test;
44

55
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;
87
use Micro\Framework\Kernel\Plugin\DependencyProviderInterface;
98
use 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);

0 commit comments

Comments
 (0)