Closed
Description
When we want to you own service for http request, subclass of Nette\Http\Request is required
// contex is instance of Nette\DI\Container
$context->removeService("http.request");
// OwnRequest implements Nette\Http\IRequest
$context->addService("http.request", new OwnRequest());
it throws exception
Nette\InvalidArgumentException: Service 'http.request' must be instance of Nette\Http\Request, OwnRequest given
I think same problem is with all services from Nette\Http package. Only interface can be requested, not class.
Maybe problem is with DI container itself, when removeService is called, I wan't to remove all information about particular service, it seems that in DI container still remains some information about removed service, what isn't desirable.
Metadata
Assignees
Labels
No labels
Activity