Closed designermonkey closed 6 years ago
Changing the server creation to:
$server = Server::createServer([$app, 'handle'],
$_SERVER,
$_GET,
$_POST,
$_COOKIE,
$_FILES
);
seems to work.
Good catch. The docs need a fix. The __invokable method has been removed in version 3. However it suggests to use the process()
method. Not sure if there is a better way to do this than your example.
@xtreamwayz Either handle
or process
work; since process
requires that the second argument be a request handler, however, handle
is better in this situation. PHP will ignore any arguments the method does not accept, making it safe.
Here is the documented code:
This fails as
$app
is not callable.Stratigility v3 and Diactoros v1.7.1