We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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 :(



4.1k
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.



1.3k
use Phalcon\Di\DiInterface;

Thank you!!!