Skip to content

[Console] Revert adding return type on Command::execute() #51458

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

Closed
wants to merge 1 commit into from

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Aug 22, 2023

Q A
Branch? 7.0
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

I tried running a Symfony v7 "webapp-pack" and this is all that is needed to not force doctrine to release new major versions to support it.

*/
public function getConfigTreeBuilder(): TreeBuilder;
public function getConfigTreeBuilder();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one has already been delayed from 6.0 to 7.0, throwing a deprecation warning since 5.3.

Same for the Command execute method. If 2.5 years is not enough to get them to release a version with a return type, what will happen in 8.0 in 2 years ? Will we delay it again ?

Copy link
Member Author

@nicolas-grekas nicolas-grekas Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. We need to be sure maintainers have received the message. /cc @Seldaek for monolog-bundle and @derrabus I guess for Doctrine?

Good for twig-extra-bundle (but it's still is missing a return type for TwigExtraExtension::load)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, for the void type in load, I'm fine with delaying it to give more time if needed, as that's much newer (we started reporting a deprecation for it in 6.2 only)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

monolog-bunde updated symfony/monolog-bundle#461

@stof
Copy link
Member

stof commented Aug 22, 2023

Btw, the dev version of TwigExtraBundle has the native return type.

* @throws \InvalidArgumentException in case of unknown driver type
*/
protected function loadObjectManagerCacheDriver(array $objectManager, ContainerBuilder $container, string $cacheName): void
protected function loadObjectManagerCacheDriver(array $objectManager, ContainerBuilder $container, string $cacheName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one could be skipped from this PR. There is an open PR in DoctrineBundle removing the method override entirely (which can be done in a minor version) because the implementation in DoctrineBundle matches the implementation in the bridge in all supported Symfony versions (as it does not support older versions anymore where the bridge was different)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the hint (here is the PR in question: doctrine/DoctrineBundle#1692)

@nicolas-grekas nicolas-grekas changed the title Revert adding return types on Command, ConfigurationInterface and AbstractDoctrineExtension [Console] Revert adding return type on Command::execute() Aug 23, 2023
@nicolas-grekas
Copy link
Member Author

PR updated to target only Command::execute()

@stof
Copy link
Member

stof commented Aug 23, 2023

@nicolas-grekas Command::execute is also a method for which we already delayed the update. So do we have a plan to avoid delaying it forever ?

@nicolas-grekas
Copy link
Member Author

Forever I don't know, but we must ensure we keep working with Doctrine, and their next major is not close to any adoption. DBAL also would need a new major. We don't have a choice for now.

@derrabus
Copy link
Member

Do you have a list of Doctrine commands that are affected by this? I don't want to be the one blocking that return type forever. The ORM should be fine and the DBAL has two commands that need to be patched. Anything else?

@stof
Copy link
Member

stof commented Aug 23, 2023

@derrabus looks like most ORM commands in 2.16.x are affected. They don't have native return types.

@derrabus
Copy link
Member

Right, my bad. I was looking at the wrong branch. 🙈

@derrabus
Copy link
Member

derrabus commented Aug 23, 2023

See doctrine/orm#10919.

Command::execute() wasn't the only method that was in my way: The other one was HelperInterface::getName(). With that PR applied (and after patching the DBAL the same way), the ORM's test suite runs green with Symfony 7.

@wouterj
Copy link
Member

wouterj commented Aug 23, 2023

HelperInterface::getName() is also one that we delayed explicitly for Doctrine in 6.0 already: #43028

So if the ORM PR gets merged, I think we can close this one without merging. I fully agree with @stof that we should be very reluctant to delay return types for yet another major version, even if this means pushing maintainers for important ecosystem projects like Doctrine or Monolog imho.

@derrabus
Copy link
Member

PRs have been merged to DBAL 3.7 and ORM 2.17.

@nicolas-grekas
Copy link
Member Author

Closing then, thanks for the update on Doctrine's side.

@nicolas-grekas nicolas-grekas deleted the ret-types branch September 12, 2023 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy