-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route::getName() return type #15880
Comments
That is correct. You have not set the name of the route. The first parameter in the constructor is the pattern not the name $route = new \Phalcon\Mvc\Router\Route('example');
var_dump($route->getName()); // null
$route->setName('my-route');
var_dump($route->getName()); // my-route |
@niden The feature might work as expected, but according to the stub file the return value can never be null. $route = new \Phalcon\Mvc\Router\Route('example');
function doStuff(string $name) {
echo $name;
}
doStuff($route->getName()); // Fatal error: Uncaught TypeError: Argument 1 passed to doStuff() must be of the type string, null given
$route->setName('my-route');
doStuff($route->getName()); // my-route |
@dcolt Ack sorry. I misunderstood. That is indeed a bug we need to address. |
Transferring this to the main repo for fixing |
Resolved in #15881 Thank you @jarnstedt and @dcolt |
Hi!
The
\Phalcon\Mvc\Router\Route::getName()
return typestring
seems to be incorrect.outputs
https://github.com/phalcon/ide-stubs/blob/v4.1.0/src/Phalcon/Mvc/Router/Route.php#L202
The text was updated successfully, but these errors were encountered: