Error Middleware slim 4

Hello Guys
Im very new to slim and read the documentation but didnt quite got the error Middleware working. Could you please help me?
see stackoverflow for details: