feat: upgrade to Symfony 6.4/7.0 and PHP 8.1#93
Open
jaapromijn wants to merge 1 commit intomasterfrom
Open
Conversation
- PHP: ^7.3 → ^8.1 - All Symfony constraints: ^4.4 || ^5.0 → ^6.4 || ^7.0 - Remove symfony/security-guard (dropped in Symfony 6) - Remove symfony/templating (dropped in Symfony 6) - Remove sensio/framework-extra-bundle (dropped in Symfony 7) - Replace php-http/guzzle6-adapter with guzzle7-adapter - Update twig/twig to ^3.0 - Update haydenpierce/class-finder to ^0.5.0 - Update league/html-to-markdown to ^5.0 - Update gisostallenberg/response-content-negotiation-bundle to ^2.0 - Update rollerworks/password-strength-validator to ^1.7 - Update doctrine/collections to ^1.6 || ^2.0 - Update doctrine/orm to ^2.17 || ^3.0 - Update doctrine/persistence to ^2.0 || ^3.0 - Update doctrine/doctrine-bundle to ^2.7 - Update stof/doctrine-extensions-bundle to ^1.9 - Update php-http/httplug-bundle to ^1.16 || ^2.0 - Add symfony/password-hasher and symfony/deprecation-contracts - Update require-dev: phpstan ^1.0, phpunit ^10, rector ^1.0, php-cs-fixer ^3.0 - Remove deprecated require-dev packages (security-checker, composer-unused, composer-require-checker) - Update branch-alias to 3.0.x-dev Security: - Rewrite UserBundleAuthenticator to extend AbstractLoginFormAuthenticator (new authenticator system, replaces Guard) - Replace GuardAuthenticatorHandler with UserAuthenticatorInterface in AuthenticateUserSubscriber Controllers: - Replace @Route/@IsGranted docblock annotations with PHP 8 attributes - Use Symfony\Component\Routing\Attribute\Route (not Annotation\Route) - Use Symfony\Component\Security\Http\Attribute\IsGranted - Remove unused Session injection from RegistrationController and ResetController Password hashing: - Replace UserPasswordEncoderInterface with UserPasswordHasherInterface - Replace encodePassword() with hashPassword() throughout Session: - Replace SessionInterface injection with RequestStack in FlashSubscriber Services: - Update service wiring for new security services - Replace @security.user_password_encoder.generic with @security.password_hasher - Replace @security.authentication.guard_handler with @security.user_authenticator - Replace @session with @request_stack where needed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the bundle from Symfony 4/5 / PHP 7.3 to Symfony ^6.4 || ^7.0 and PHP ^8.1.
This is required to unblock the
eindhoven-doetproject's upgrade to Symfony 7.4 / PHP 8.4.Changes
composer.json
^7.3→^8.1^4.4 || ^5.0→^6.4 || ^7.0sensio/framework-extra-bundle,symfony/security-guard,symfony/templating,php-http/guzzle6-adapterphp-http/guzzle7-adapter ^1.0haydenpierce/class-finder ^0.5,league/html-to-markdown ^5.0,gisostallenberg/response-content-negotiation-bundle ^2.0Security (Guard → new Authenticator system)
UserBundleAuthenticatorrewritten fromAbstractFormLoginAuthenticator(Guard) toAbstractLoginFormAuthenticatorwithPassport/UserBadge/PasswordCredentialsAPIAuthenticateUserSubscribermigrated fromGuardAuthenticatorHandlertoUserAuthenticatorInterfacePassword hashing
UserPasswordEncoderInterface→UserPasswordHasherInterfaceencodePassword()→hashPassword()in all affected filesControllers
@Route/@IsGranteddocblock annotations converted to PHP 8#[Route]/#[IsGranted]attributes (Symfony 6+ namespaces)Services
services.yaml: updated service references for password hasher, user authenticator, request stackTesting needed