Skip to content

Commit df0a839

Browse files
committed
require Slim 4.2 and use createFromContainer for app instance creation
1 parent bd11c84 commit df0a839

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"php": "~7.1",
1818
"php-di/php-di": "^6.0.0",
1919
"php-di/invoker": "^2.0.0",
20-
"slim/slim": "^4.0.0"
20+
"slim/slim": "^4.2.0"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "~6.0",

src/Bridge.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ public static function create(ContainerInterface $container = null): App
2525
{
2626
$container = $container ?: new Container;
2727

28-
AppFactory::setContainer($container);
2928
$callableResolver = new InvokerCallableResolver($container);
3029
AppFactory::setCallableResolver(new CallableResolver($callableResolver));
3130

32-
$app = AppFactory::create();
31+
$app = AppFactory::createFromContainer($container);
3332

3433
$controllerInvoker = self::createControllerInvoker($container);
3534
$app->getRouteCollector()->setDefaultInvocationStrategy($controllerInvoker);

tests/RoutingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function injects_route_placeholder_over_request_attribute()
118118
public function resolve_controller_from_container()
119119
{
120120
$app = Bridge::create();
121-
$app->get('/', [UserController::class, 'dashboard']);
121+
$app->get('/', UserController::class . ':dashboard');
122122

123123
$response = $app->handle(RequestFactory::create());
124124
$this->assertEquals('Hello world!', (string) $response->getBody());

0 commit comments

Comments
 (0)