Skip to content

[Console] Readd missing php-doc parameter for constructor #42281

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

Merged
merged 1 commit into from
Jul 27, 2021

Conversation

brosenberger
Copy link
Contributor

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets no
License MIT
Doc PR symfony/symfony-docs#...

partly revert the php constroctur php doc (readd missing php-doc for $name and $description) even if they not that meaningfull

This is needed as Magento2 uses this library and needs all php-doc parameter for interception compilation. if there are any missing parameters (in this case $name and $description) break compile step as the parameters are missmatching the actual parameters:
image
(AbstractConfigOption extends InputOption)

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@kassner
Copy link

kassner commented Jul 27, 2021

The change was introduced in #41992

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

This looks like an issue of the tool that you are using there. I'm very much against re-introducing redundant doc block annotations.

@carsonbot carsonbot changed the title Readd missing php-doc parameter for constructor [Console] Readd missing php-doc parameter for constructor Jul 27, 2021
@brosenberger
Copy link
Contributor Author

brosenberger commented Jul 27, 2021

@derrabus i agree that those comments are not really usefull, nethertheless all magento2 builds use this module and do generate interceptors (for a precompiled aop solution) which uses the method parameter php-doc (if present) - therefore many shops have to update their versions either to fixate it to v4.4.26 or add a patch where the @params are added again to gain a green build

@derrabus
Copy link
Member

Okay and why can't this be fixed on Magento's side?

@hostep
Copy link

hostep commented Jul 27, 2021

@derrabus: Magento really needs to fix this, but the release cycle of Magento is super slow and upgrades from one version of Magento to another are very tedious and take a lot of time, even for minor releases. So even if Magento released a new version (next one is scheduled for 2022, they will only release security fixes in 2021 anymore), it would take people a lot of time and effort to upgrade to it.

@alcaeus
Copy link
Contributor

alcaeus commented Jul 27, 2021

@brosenberger There are multiple packages that do the same thing, including many Doctrine packages. These two parameters are self-explanatory through the signature and the documentation adds no value (especially since Symfony no longer publishes this documentation IIRC).

Slow release process aside, I don't think this issue should be fixed anywhere but in Magento itself.

@derrabus
Copy link
Member

So Magento is basically not doing bugfix releases?

@fascinosum
Copy link

@alcaeus IMHO, using a mixed approach for DocBlock annotation may be not the best. At least when you read reduced DocBlock, it does not contribute to a better understanding. I would say it can be confusing
Speaking of best practices: https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#59-param

@nicolas-grekas
Copy link
Member

Are you completely sure this is the only phpdoc that Magento needs? We removed much more, that's why I'm asking.
I'm fine reverting in 4.4, but we should keep that change in 5.4 IMHO.

@viktym
Copy link

viktym commented Jul 27, 2021

@nicolas-grekas currently Magento has dependency on "symfony/console": "~4.4.0".
Do you have any ETA when symfony/console:4.4.29 with this fix for Magento can be released?

@mortenbirkelund
Copy link

So Magento is basically not doing bugfix releases?

Magento make quarterly releases, and anything else has to be patched manually on each shops either by using magentos patch tool (with a limited amount of patches) ; by using patch command on Linux or a library like cweagans.
https://devdocs.magento.com/guides/v2.4/comp-mgr/patching.html

So this is possible, but as stated by @hostep it will require alot of work by alot of people (all shops individually)
A bug fix release of symfony/console would be the easiest solution by far, and then hopefully magento will fix the actual problem in next release.

@derrabus
Copy link
Member

and then hopefully magento will fix the actual problem in next release.

They'll have to. We really cannot anticipate which doc block change might break this little Magento tool again.

Do you have any ETA when symfony/console:4.4.29 with this fix for Magento can be released?

The next regular release would be by the end of August.

@IbrahimS2
Copy link

@derrabus I fully agree with you, Why in the world is Magento not reading the "variables type properly", it is already defined in the construct itself! if not then and only then can fall back to PHP variables annotations.

Anyhow, I think the point here is to be part of the solution; if we can let this one slide so not everyone gets into this problem until a proper fix is presented in Magento would be highly appreciated.

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Agreed.

@derrabus
Copy link
Member

Thank you @brosenberger.

@derrabus derrabus merged commit 7f0641f into symfony:4.4 Jul 27, 2021
@derrabus
Copy link
Member

To be extra-sure: Can you please test your Magento installations with:

{
    "symfony/console": "^4.4.29@dev"
}

… and confirm that the issue is gone and that there is no other doc block that breaks that tool?

@derrabus
Copy link
Member

As suggested by @nicolas-grekas, I have reverted the change while merging to the 5.4 branch.

@thomas-kl1
Copy link

@nicolas-grekas you shouldn't pay the Magento debt :(

@chernenm-zz
Copy link

To be extra-sure: Can you please test your Magento installations with:

{
    "symfony/console": "^4.4.29@dev"
}

… and confirm that the issue is gone and that there is no other doc block that breaks that tool?

hi @derrabus, Thank you for your help with this. We can confirm that everything works on Magento side with this change.

@ihor-sviziev
Copy link

Hi @derrabus,
Could you release a stable version of the symfony/console as a hotfix for the Magento?

@derrabus
Copy link
Member

Could you release a stable version of the symfony/console as a hotfix for the Magento?

@fabpot just did that.

@ihor-sviziev
Copy link

FYI The original issue in the laminas-code with incorrect argument type detection when @param is not declared for all parameters got fixed in laminas/laminas-code#95 and released https://github.com/laminas/laminas-code/releases/tag/4.4.3

@brosenberger brosenberger deleted the patch-1 branch November 10, 2021 14:18
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.