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

Phalcon 2 BETA 3: Phalcon\Mvc\Router doesn't implement Phalcon\Mvc\RouterInterface

I'm not sure if there is any change to Phalcon\Mvc\Router in Phalcon 2 but it doesn't seem to implement Phalcon\Mvc\RouterInterface while for Phalcon 1.3.4, it works as expected (Router is an instance of RouterInterface).

<?php
echo Phalcon\Version::get(), PHP_EOL;
var_dump((new Phalcon\Mvc\Router()) instanceof Phalcon\Mvc\RouterInterface);
$ref = new ReflectionClass('Phalcon\\Mvc\\Router');
var_dump($ref->getInterfaceNames());

Output:

2.0.0 BETA 3
bool(false)
array(0) {
}

My env: PHP 5.6.4, Debian.

Thanks.

edited Jan '15

A quick look at phalcon/mvc/router.zep shows that the Router class doesn't implement both Phalcon\Mvc\RouterInterface and Phalcon\DI\InjectionAwareInterface. Is it on purpose or do I miss something?



5.1k

Just add issue on github :)

The issue is fixed by b2903192238c79baec8f7290a06ce6d290fecaa8.