File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 17
17
"php" : " ~7.0" ,
18
18
"php-di/php-di" : " ^6.0.0" ,
19
19
"php-di/invoker" : " ^2.0.0" ,
20
- "slim/slim" : " ^3.9 .0"
20
+ "slim/slim" : " ^4.0 .0"
21
21
},
22
22
"require-dev" : {
23
- "phpunit/phpunit" : " ~6.0"
23
+ "phpunit/phpunit" : " ~6.0" ,
24
+ "zendframework/zend-diactoros" : " ^2.1"
24
25
}
25
26
}
Original file line number Diff line number Diff line change 1
- <?php
1
+ <?php declare (strict_types= 1 );
2
2
3
3
namespace DI \Bridge \Slim ;
4
4
5
+ use DI \Container ;
5
6
use Invoker \Invoker ;
6
7
use Invoker \ParameterResolver \AssociativeArrayResolver ;
7
8
use Invoker \ParameterResolver \Container \TypeHintContainerResolver ;
8
9
use Invoker \ParameterResolver \DefaultValueResolver ;
9
10
use Invoker \ParameterResolver \ResolverChain ;
10
11
use Psr \Container \ContainerInterface ;
12
+ use Slim \App ;
11
13
use Slim \Factory \AppFactory ;
12
14
use \Invoker \CallableResolver as InvokerCallableResolver ;
13
15
17
19
* As you can see, this class is very basic and is only useful to get started quickly.
18
20
* You can also very well *not* use it and build the container manually.
19
21
*/
20
- class App
22
+ class Bridge
21
23
{
22
- public static function boot (ContainerInterface $ container)
24
+ public static function create (ContainerInterface $ container = null ): App
23
25
{
26
+ $ container = $ container ?: new Container ;
27
+
24
28
AppFactory::setContainer ($ container );
25
29
$ callableResolver = new InvokerCallableResolver ($ container );
26
30
AppFactory::setCallableResolver (new CallableResolver ($ callableResolver ));
You can’t perform that action at this time.
0 commit comments