Skip to content
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

[Symfony 5.2] Cover upgrade path and new features #4824

Closed
TomasVotruba opened this issue Dec 8, 2020 · 13 comments
Closed

[Symfony 5.2] Cover upgrade path and new features #4824

TomasVotruba opened this issue Dec 8, 2020 · 13 comments
Assignees
Labels

Comments

@TomasVotruba
Copy link
Member

TomasVotruba commented Dec 8, 2020

Cover changes and new features from https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md

@TomasVotruba TomasVotruba changed the title [Symfony 5.2] Cover upgrade path [Symfony 5.2] Cover upgrade path and new features Dec 8, 2020
@simivar
Copy link
Contributor

simivar commented Dec 9, 2020

Should those be done in a new set, for example symfony-52?

@TomasVotruba
Copy link
Member Author

Yes! We have one config per Symfony version:

public const SYMFONY_50 = __DIR__ . '/../../../../config/set/symfony50.php';

@simivar
Copy link
Contributor

simivar commented Dec 9, 2020

List of things to do so it's easier to track:

DependencyInjection

  • Deprecated Definition::setPrivate() and Alias::setPrivate(), use setPublic() instead

FrameworkBundle

  • Deprecated the public form.factory, form.type.file, translator, security.csrf.token_manager, serializer, cache_clearer, filesystem and validator services to private.
  • If you configured the framework.cache.prefix_seed option, you might want to add the %kernel.environment% to its value to keep cache namespaces separated by environment of the app
  • Deprecated the lock.RESOURCE_NAME and lock.RESOURCE_NAME.store services and the lock, LockInterface, lock.store and PersistingStoreInterface aliases, use lock.RESOURCE_NAME.factory, lock.factory or LockFactory instead.

Form

  • Deprecated PropertyPathMapper in favor of DataMapper and PropertyPathAccessor.

HttpFoundation

  • Deprecated not passing a Closure together with FILTER_CALLBACK to ParameterBag::filter(); wrap your filter in a closure instead.
  • Deprecated the Request::HEADER_X_FORWARDED_ALL constant, use either Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO or Request::HEADER_X_FORWARDED_AWS_ELB or Request::HEADER_X_FORWARDED_TRAEFIKconstants instead.
  • Deprecated BinaryFileResponse::create(), use __construct() instead

Lock

  • MongoDbStore does not implement BlockingStoreInterface anymore, typehint against PersistingStoreInterface instead.
  • deprecated NotSupportedException, it shouldn't be thrown anymore.
  • deprecated RetryTillSaveStore, logic has been moved in Lock and is not needed anymore.

Mime

  • Deprecated Address::fromString(), use Address::create() instead

Monolog

  • The $actionLevel constructor argument of Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy has been deprecated and replaced by the $inner one which expects an ActivationStrategyInterface to decorate instead.
  • Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy will become final in 6.0.
  • The $actionLevel constructor argument of Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy has been deprecated and replaced by the $inner one which expects an ActivationStrategyInterface to decorate instead.
  • Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy will become final in 6.0

Notifier

- [ ] [BC BREAK] The TransportInterface::send() and AbstractTransport::doSend() methods changed to return a ?SentMessage instance instead of void.

  • [BC BREAK] Changed the type-hint of the $recipient argument in the as*Message() method of EmailNotificationInterface and SmsNotificationInterface to EmailRecipientInterface and SmsRecipientInterface.
  • [BC BREAK] Removed the AdminRecipient.
  • [BC BREAK] Changed the type-hint of the $recipient argument in NotifierInterface::send(), Notifier::getChannels(), ChannelInterface::notifiy() and ChannelInterface::supports() to RecipientInterface.

PropertyAccess

  • Deprecated passing a boolean as the first argument of PropertyAccessor::__construct(). Pass a combination of bitwise flags instead.

PropertyInfo

  • Deprecated the enable_magic_call_extraction context option in ReflectionExtractor::getWriteInfo() and ReflectionExtractor::getReadInfo() in favor of enable_magic_methods_extraction.

TwigBundle

  • Deprecated the public twig service to private.

TwigBridge

- [ ] Changed 2nd argument type of TranslationExtension::__construct() to TranslationNodeVisitor

Validator

  • Deprecated the allowEmptyString option of the Length constraint.
  • Deprecated the NumberConstraintTrait trait.
  • Deprecated setting a Doctrine annotation reader via ValidatorBuilder::enableAnnotationMapping()
  • Deprecated creating a Doctrine annotation reader via ValidatorBuilder::enableAnnotationMapping()

Security

- [ ] [BC break] In the experimental authenticator-based system, * TokenInterface::getUser() returns null in case of unauthenticated session.

  • [BC break] AccessListener::PUBLIC_ACCESS has been removed in favor of AuthenticatedVoter::PUBLIC_ACCESS.
  • Deprecated setProviderKey()/getProviderKey() in favor of setFirewallName()/getFirewallName() in PreAuthenticatedToken, RememberMeToken, SwitchUserToken, UsernamePasswordToken, DefaultAuthenticationSuccessHandler, the old methods will be removed in 6.0.
  • Deprecated the AbstractRememberMeServices::$providerKey property in favor of AbstractRememberMeServices::$firewallName, the old property will be removed in 6.0.

@samsonasik
Copy link
Member

samsonasik commented Jan 28, 2021

@TomasVotruba TranslationExtension is a final class, so it will happen on new instance check or service definition update?

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Jan 28, 2021

@samsonasik What exact change do you talk about? Symfony PR link might help

@samsonasik
Copy link
Member

samsonasik commented Jan 28, 2021

@TomasVotruba it is about this change symfony/symfony@c134425 , The class is shown as final:

final class TranslationExtension extends AbstractExtension

So it must be a "New_" expr or To update the symfony config definition somewhere?

@TomasVotruba
Copy link
Member Author

@samsonasik This class is used only internally in Symfony + as you said, it's final so it cannot be used in userland. We can skip this change

@samsonasik
Copy link
Member

samsonasik commented Feb 6, 2021

@TomasVotruba the Symfony\Component\Security\Core\Authentication\Token\TokenInterface in symfony 5.2 doesn't has Nullable return type hint, so I think it can be skippped.

https://github.com/symfony/symfony/blob/a12db94a06fbfc6077c2613d479f9de559c9af03/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php#L47-L54

what do you think?

@TomasVotruba
Copy link
Member Author

@TomasVotruba the Symfony\Component\Security\Core\Authentication\Token\TokenInterface in symfony 5.2 doesn't has Nullable return type hint, so I think it can be skippped.

Agreed 👍 . Untill it's in PHP itself, e.g. getVaule(): ?int, it can be skipped

@TomasVotruba
Copy link
Member Author

@samsonasik Those can be skipped to then

@TomasVotruba
Copy link
Member Author

Closing as what can we covered with automated upgrade is covered. The rest has multiple options, depends on context or is internal.

In case of any missed thisn, please create an issue with clear diff example

@TomasVotruba
Copy link
Member Author

@samsonasik Thank you for taking care of these

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants