Skip to content

Commit 57c8beb

Browse files
committed
Rename and fix the main class
1 parent b732a31 commit 57c8beb

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
"php": "~7.0",
1818
"php-di/php-di": "^6.0.0",
1919
"php-di/invoker": "^2.0.0",
20-
"slim/slim": "^3.9.0"
20+
"slim/slim": "^4.0.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "~6.0"
23+
"phpunit/phpunit": "~6.0",
24+
"zendframework/zend-diactoros": "^2.1"
2425
}
2526
}

src/App.php renamed to src/Bridge.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace DI\Bridge\Slim;
44

5+
use DI\Container;
56
use Invoker\Invoker;
67
use Invoker\ParameterResolver\AssociativeArrayResolver;
78
use Invoker\ParameterResolver\Container\TypeHintContainerResolver;
89
use Invoker\ParameterResolver\DefaultValueResolver;
910
use Invoker\ParameterResolver\ResolverChain;
1011
use Psr\Container\ContainerInterface;
12+
use Slim\App;
1113
use Slim\Factory\AppFactory;
1214
use \Invoker\CallableResolver as InvokerCallableResolver;
1315

@@ -17,10 +19,12 @@
1719
* As you can see, this class is very basic and is only useful to get started quickly.
1820
* You can also very well *not* use it and build the container manually.
1921
*/
20-
class App
22+
class Bridge
2123
{
22-
public static function boot(ContainerInterface $container)
24+
public static function create(ContainerInterface $container = null): App
2325
{
26+
$container = $container ?: new Container;
27+
2428
AppFactory::setContainer($container);
2529
$callableResolver = new InvokerCallableResolver($container);
2630
AppFactory::setCallableResolver(new CallableResolver($callableResolver));

0 commit comments

Comments
 (0)