Inconsistencies in the way different view helpers load plugins meant that while most helpers worked without a renderer being attached on $this->view, a few failed.
This PR brings the few cases where plugins weren't successfully created when $this->view wasn't populated into line with the others and includes unit tests that fail before the change.
Are you fixing a BC Break?
Arguably?
In some older versions of PHP (ie 7.4) some of these cases (eg FormSelect::getFormHiddenHelper()) would work (because $this->view being null only became a TypeError for method_exists() in PHP 8.0) and then stopped working on current PHP versions.
So these fixes would make code that worked for people under older versions of PHP continue to work as they uplift their PHP and Laminas versions.
Description
Inconsistencies in the way different view helpers load plugins meant that while most helpers worked without a renderer being attached on $this->view, a few failed.
This PR brings the few cases where plugins weren't successfully created when $this->view wasn't populated into line with the others and includes unit tests that fail before the change.
Arguably? In some older versions of PHP (ie 7.4) some of these cases (eg FormSelect::getFormHiddenHelper()) would work (because $this->view being null only became a TypeError for method_exists() in PHP 8.0) and then stopped working on current PHP versions. So these fixes would make code that worked for people under older versions of PHP continue to work as they uplift their PHP and Laminas versions.
There is a little background on: https://discourse.laminas.dev/t/laminas-form-view-helper-retrieval-consistency/3591