Skip to content

Instantly share code, notes, and snippets.

Created February 13, 2020 15:51
What would you like to do?
POC for
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
use \Psr\Container\ContainerInterface;
require './vendor/autoload.php';
class TypeHintTestController {
private $container;
public function __construct(ContainerInterface $container) {
$this->container = $container;
public function index(Request $request, Response $response, array $args) {
$response->getBody()->write("From: " . get_class($this->container));
return $response;
$app = new \Slim\App;
$app->get('/', '\TypeHintTestController:index');
Copy link

it works, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment