Comments (4)
I was not aware of those reflection methods tbh. Will review those usecases. Thanks for the swift response!
from doctrinemodule.
Could you please elaborate which class implementation has changed (i.e. please name the fully qualified name of that class) between 4.1 and 4.2 from your point of view?
from doctrinemodule.
The image shows it best i guess. the ObjectSelect has been renamed to a Polyfill. Same goes for the other select types i can see in the PR itself.
from doctrinemodule.
Well, you need to look at the whole PR. Though you mentioned the polyfills in your initial issue description, I am not sure if you are aware how polyfills actually work. Please have a look the the following change from the same PR:
First, the file autoload/polyfill-form-elements.php
is included in the autoload
section of composer.json
. Therefore, this file will always be loaded without any conditions.
Second, the file checks which version of laminas/laminas-form
the user has installed. That is the part with null === $reflectionMethod->getReturnType()
. It will be true
for 2.x and false
for 3.x. You can look into a diff of laminas-form 2.x and 3.x to validate that this is actually the case.
Third, the class DoctrineModule\Form\Element\ObjectMultiCheckboxV2Polyfill
is pushed into the right place when laminas-form 2.x is installed using class_alias()
, i.e. it is aliased to DoctrineModule\Form\Element\ObjectMultiCheckbox
. And that is exactly the name it had in earlier versions. Please read the PHP documentation on class_alias: https://www.php.net/manual/en/function.class-alias.php. This function creates an exact copy of the class, i.e. defining the class as ObjectMultiCheckboxV2Polyfill
and aliasing it to ObjectMultiCheckbox
is absolutely identical to defining it directly as ObjectMultiCheckbox
!
So as DoctrineModule 4.1.x and 4.2.0 both provide DoctrineModule\Form\Element\ObjectMultiCheckbox
with the very same signatures, there is no BC break in DoctrineModule 4.2.0.
There is only one case where an update from DoctrineModule 4.1.x to 4.2.0 can cause troubles: If you in your application use laminas-form and you do not have specified laminas-form in your composer.json
, upgrading DoctrineModule to 4.2.0 will upgrade laminas-form from 2.x to 3.x in your application. And that will obviously result in issues, as laminas-form 3.x has BC breaks (that is why it is a new major version).
If that is the case I strongly recommend using a tool like compoer-require-checker which checks if you have so-called soft dependencies in your application.
Lastly, you refer to using polyfills as "kinda risky". I disagree with that statement. In laminas-form, which back then was still called zendframework/zend-form, the same principle was applied in 2.15.x. 2.14.x only supported servicemanager 2.x, 2.15.x supported servicemanager 2.x and 3.x through polyfills. They event went a step further, in 2.16.x they removed support for servicemanager 2.x. Considering that laminas-form (counting both laminas-form and zend-form) has over 16 million installs, I don not think that using polyfills is a risky behaviour.
from doctrinemodule.
Related Issues (20)
- vendor/bin/doctrine-module only works if it's a symlink HOT 12
- Unit tests should be executed with PHP 8.0 HOT 1
- incompatible with doctrine/orm >= 2.12.0 HOT 3
- Missing Versions on Packagist HOT 2
- Deprecate doctrine/cache HOT 8
- Release 5.3.0 with PHP 8.2 Support HOT 5
- Can't install due to conflicting requirements HOT 25
- Current CLI implementation triggers api-tools-mvc-auth events HOT 2
- 6.0.2 regex change is too restrictive HOT 6
- Missing requirement in composer.json HOT 2
- Migration to v6 leads to cache issues HOT 11
- Authentication Error when no credentialCallable is given. HOT 5
- Allow cleanSearchValue method to accept an integer HOT 4
- Mapping error doctrine find, findOneBy, findBy. HOT 1
- Package incorrectly states that it does provide `laminas/laminas-cache-storage-implementation` HOT 3
- Bump to PHP 8.3 ? HOT 3
- orm3 compatibility HOT 1
- Implement CacheItemPoolInterface
- Upgrade to ServiceManager 4 HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctrinemodule.