phalcon/ide-stubs

Return Route, not RouteInterface in Phalcon\Mvc\Router\Group::add

cyberhck opened this issue ยท 1 comments

I'm bundling ide-stubs project in a plugins project and distributing as a PhpStorm plugin. (Still haven't gotten around to automate that yet, but will soon ๐Ÿ™‚ ) a user reported that Phalcon\Mvc\Router\Group::add doesn't return the correct data.

The PHPDoc for \Phalcon\Mvc\Router\Group::add states, that add() on a group would return an instance of Phalcon\Mvc\RouteInterface but it really returns an instance of Phalcon\Mvc\Route

This results in PHPStorm not finding the convert() method on a group object.

Here's the issue fossapps/PhpStorm-Phalcon-Autocomplete#3 which he created you can follow

Actually Phalcon\Mvc\Router\Route implements Phalcon\Mvc\Router\RouteInterface so return hint is correct. We'll need add convert to the RouteInterface in the Phalcon 4.0.0. Refs: phalcon/cphalcon#13380