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

Refactor conversion of PHPDoc to type declarations #4591

Open
wants to merge 1 commit into
base: master
from

Conversation

@julienfalque
Copy link
Member

julienfalque commented Oct 13, 2019

This PR:

  • implements some points of #4511
  • fixes #4605
  • refactors parts of PhpdocToParamTypeFixer and PhpdocToReturnTypeFixer to ease sharing common logic.
@nicolas-grekas nicolas-grekas mentioned this pull request Oct 13, 2019
2 of 7 tasks complete
@julienfalque julienfalque force-pushed the julienfalque:types-expression-class branch 2 times, most recently from 777cb40 to aba296c Oct 13, 2019
@kubawerlos

This comment has been minimized.

Copy link
Contributor

kubawerlos commented Oct 23, 2019

Could we instead of abstract fixers introduce - as @SpacePossum suggested one day - a namespace of manipulators?

@julienfalque

This comment has been minimized.

Copy link
Member Author

julienfalque commented Oct 23, 2019

Not sure what you mean exactly?

@kubawerlos

This comment has been minimized.

Copy link
Contributor

kubawerlos commented Oct 23, 2019

Similarly like we have Tokenizer we can create Manipulator and store there classes to be called by PhpdocToParamTypeFixer and PhpdocToReturnTypeFixer.

AbstractPhpdocToTypeDeclarationFixer does not have any property has properties that all are in practice constants, thus the class is set of functions that do stuff for the fixers, similar as all analyzers.

@julienfalque

This comment has been minimized.

Copy link
Member Author

julienfalque commented Oct 23, 2019

Indeed, some parts of the new abstract class could probably be extracted to some "analyzer" class, but some are quite specific to these fixers. I'll have a closer look shortly.

@julienfalque julienfalque force-pushed the julienfalque:types-expression-class branch 5 times, most recently from b1d0f80 to 982d539 Nov 3, 2019
@julienfalque julienfalque force-pushed the julienfalque:types-expression-class branch from 982d539 to 336a3d4 Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.