Following-up on my bug report about typehinted scalar parameters. The fix that resolved this bug also introduced a rather inconvenient BC break.
With non-typehinted scalar parameters, it's not necessary to pass all parameters to isLinkCurrent method:
$presenter->isLinkCurrent(':Homepage:default', []);
In this example, calling the method works even if the requested action has required arguments. By calling it without the arguments, I simply mean to ask "Is the current page at Homepage:default?" without checking exact parameters.
If the action has PHP-7-scalar typehints, I cannot longer call isLinkCurrent without its arguments:
public function renderDefault(int $id)
{
}
...
$presenter->isLinkCurrent(':Homepage:default', []); // fails on PHP-7
BC break aside, I think it also reduces the scope where isLinkCurrent is usable. Before PHP 7, I could use it for checking whether am I in a concrete Presenter:action pair without caring about exact arguments.
For example if I want to always render a template block when I am at Article:default
, in the past I could have used {ifCurrent Article:default}
. Now, I have to pass the arguments to the macro.
Ideally, the isLinkCurrent/ifCurrent functionality should not depend on generating links because it should behave independently of each other because of different requirements for these functionalities.
If this issue is a logical conclusion of the suggested behaviour in #112 and the current behaviour is fine for everyone, feel free to close this issue.
Thanks!