This PR is an alternative to #726. In contrast to #726 this PR keeps backward compatibility by using polyfills. Technically, there are now two different implementations of the form elements, one targeted at laminas-form v2 and a different one targeted at laminas-form v3. Using Composers autoload feature, the implementation corresponding to the installed laminas-form version is loaded and put into the right place using class_alias.
In case you are skeptical about this technique, I'd like to refer to laminas-form 2.15.x series, which itself used the same principle to support both laminas-servicemanager v2 and v3. Have a look at their composer.json, autoload file and polyfills.
This PR is an alternative to #726. In contrast to #726 this PR keeps backward compatibility by using polyfills. Technically, there are now two different implementations of the form elements, one targeted at laminas-form v2 and a different one targeted at laminas-form v3. Using Composers autoload feature, the implementation corresponding to the installed laminas-form version is loaded and put into the right place using
class_alias
.In case you are skeptical about this technique, I'd like to refer to laminas-form 2.15.x series, which itself used the same principle to support both laminas-servicemanager v2 and v3. Have a look at their composer.json, autoload file and polyfills.