-
Notifications
You must be signed in to change notification settings - Fork 659
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
Cli command classes #5858
Cli command classes #5858
Conversation
2cc670f
to
8f1ea1b
Compare
There seems to be an existing bug where multiple relative paths may reference the same file, ending up in the same file being scanned several times. |
73519ad
to
383643f
Compare
383643f
to
fd29ec8
Compare
There's a lot of code being repeated (sometimes with mistakes) between entry points, for example, the php-version fixed here #5855. I see you introduced a |
@orklah I'd like to defer that to subsequent, more focused, PRs. While I certainly agree with the sentiment, this one is quite big already. Here I aimed for bug-for-bug compatibility, to ease the transition. |
Well, seems weird you refactored things in methods only in Psalm entrypoint and not on Psalter then. But apart from that, the PR seems great :) |
Initially I did not intend to do that in this PR, but Psalm was complaining about |
Can relate to that :D |
Thanks!
Is this annoying or is it good? |
It's ok, but I did not expect that - the method was no more complex than the closure originally found in Lines 218 to 236 in 38c452a
Arguably this does not look the most complex part of that method. |
Over the years Psalm's entrypoints have grown quite large. This PR aims to solve it by moving the entrypoint code to their own classes.
Overview of changes:
src/*.php
entrypoints moved to corresponding classes insrc/Psalm/Internal/Cli
folder\Psalm
namespace deprecated and moved toPsalm\Internal\CliUtils
classPsalm\Internal\Cli\Psalm::run()
(originallysrc/psalm.php
) split into multiple methodsPsalm\Internal\Cli\Psalter::run()
(originallysrc/psalter.php
) split into multiple methods