Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Fatal error: Declaration of Multiple\Frontend\Module::registerAutoloaders(?Phalcon\DiInterface $di = NULL) must be compatible wi

I very need multiple structure application. I used phalcon v3, now migrating v4.

I get error: Fatal error: Declaration of Multiple\Frontend\Module::registerAutoloaders(?Phalcon\DiInterface $di = NULL) must be compatible with Phalcon\Mvc\ModuleDefinitionInterface::registerAutoloaders(?Phalcon\Di\DiInterface $container = NULL) in frontend/Module.php on line 13

I cloned https://github.com/phalcon/mvc/tree/master/multiple and get same error. Please, help :(



3.9k
Accepted
answer
use Phalcon\Di\DiInterface;

Yeah, it looks like you're not specifying the namespace of the interface properly.

v4 did move some things around too, so if that project was written for v3, that might cause some issues.



982
use Phalcon\Di\DiInterface;

Thank you!!!