-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
NelmioApiDocBundle v5 overview #2215
Comments
Try and and see if https://github.com/rectorphp/rector is a good solution for easy refactoring |
It could make upgrading harder, but it could be the opportunity to drop support for annotations. It seems to be that having both attributes & annotations adds a lot of complexity. Especially when the 2 are mixed |
Just thought I would add this here. As mentioned be @mathroc if a project switches to Attributes from Annotations (which I think makes sense) we would need to provide an upgrade path for going from annotations to attributes to bring most of the install base with us. Fortunately rectorphp gets us there... nearly. See: I have used this method with only one issue I had to manually fix which is this issue with nested annotations: Will see what I can do to resolve this as I would like to migrate my own project. |
This comment was marked as outdated.
This comment was marked as outdated.
Reopening this issue because I encountered various issues in the codebase while attempting to bump Symfony minimum to 6.4 in #2335. Most of these issues were related to updating the tests to prefer attributes over annotations. In the end I strongly believe that in order for this bundle to be ready for the future we will have to move to a major v5 by doing the changes mentioned in this issue. |
Cleanup various references to annotations to their attribute variant #2215
## Description Make classes marked with `@final` final #2215 ## What type of PR is this? (check all applicable) - [ ] Bug Fix - [ ] Feature - [x] Refactor - [ ] Deprecation - [x] Breaking Change - [ ] Documentation Update - [ ] CI ## Checklist - [ ] I have made corresponding changes to the documentation (`docs/`) - [ ] I have made corresponding changes to the changelog (`CHANGELOG.md`)
I think we should start preparing for NelmioApiDocBundle v5 and move forward with this bundle.
PHP 8.1+
First of all I would like to remove support for PHP 7. PHP 7 has been EOL for quite some time now (PHP 7.4 active support stopped 2 years ago https://endoflife.date/php) and is currently preventing us from using new PHP 8 features (typed properties, native attributes, property promotion, union types).
Additionally I would like to start using PHP 8.1 as a minimum instead of PHP 8.0 because:
new
in initializers https://stitcher.io/blog/new-in-php-81#new-in-initializers-rfcnew
as default parametersNelmioApiDocBundle/ApiDocGenerator.php
Line 69 in daadb0b
readonly
propertiespublic readonly
propertyNelmioApiDocBundle/Model/Model.php
Line 39 in daadb0b
Planned changes:
Static analysis
PHP 8 is also a perfect time to start using static analysis tools. That's why I would like to introduce (PHPStan) to this project. This would also include some refactoring here and there to remove PHPStan's detected problems.
Symfony version bump to 6.4+Drop support for Symfony 6.0, 6.1, 6.2 & 6.3Symfony 6.0, 6.1, 6.2 & 6.3 have already stopped receiving bug fixes & security updates which is why a bump to Symfony 6.4 would be ideal, this version also closely align with our new minimum PHP version support.
Additionaly let's keep supporting Symfony 5.4 for now. Support for it should be dropped in a different minor release. Preferably we wait until after November 2024 (end of bug fixes for Symfony 5.4 https://symfony.com/releases/5.4).
General refactoring
void
)NelmioApiDocBundle/PropertyDescriber/PropertyDescriberInterface.php
Line 25 in daadb0b
final
PropertyDescriberInterface
(prefer class decoration)sensio/framework-extra-bundle
? (unmaintained & all annotations are available from Symfony 6.2 onward)The text was updated successfully, but these errors were encountered: