zendframework / zend-expressive-zendrouter

zend-mvc Router integration for Expressive
BSD 3-Clause "New" or "Revised" License
10 stars 8 forks source link

Zend\Expressive\Route will not accept anything other than objects implementing the MiddlewareInterface starting in version 3.0.0 #45

Closed spencer237 closed 5 years ago

spencer237 commented 6 years ago

Hello everyone please i have this problem : we detected usage of "callable" for path "/nkenmoe" using methods GET. Please update your code to create middleware instances implementing MiddlewareInterface; use decorators for callable middleware if needed. in C:\xampp\htdocs\mon_mvc\vendor\zendframework\zend-expressive-router\src\Route.php on line 296

weierophinney commented 6 years ago

Can you provide a sample of code that results in this error, please, so we can provide you with a solution?

If you are calling new Route(. . .), the answer is pretty simple: you will need to decorate your callable middleware using one of either Zend\Stratigility\middleware() or Zend\Stratigility\doublePassMiddleware() when you provide it to the constructor. Which one is necessary will depend on the signature of the callable you are using.

spencer237 commented 6 years ago

Thanks @weierophinney i'm try