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

Problems Upgrading to 2.0.9

I'm starting to upgrade the Phalcon. I could replace the phalcon.so for the new after compile it, but then running the app I get this error:

Fatal error: Declaration of Websites\Services\Template\Renderer::setEventsManager() must be compatible with Phalcon\Events\EventsAwareInterface::setEventsManager(Phalcon\Events\ManagerInterface $eventsManager)

So I check the documentation about Events Manager, and I am using the implementation as the example exposed in the docs (https://docs.phalcon.io/en/latest/reference/events.html):

public function setEventsManager($eventsManager) { $this->_eventsManager = $eventsManager; }

And the problem persists, What it is really causing this problem?

You need put into function in controller what implement interface the same type of variable.. In your case:

public function setEventsManager(Phalcon\Events\ManagerInterface $eventsManager) { $this->_eventsManager = $eventsManager; }


Hi and thanks for answer. But I follow having the same error message even when I changed the line to:

public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager)

Also I had tried with: \Phalcon\Events\EventsAwareInterface; , but is not working