-
Notifications
You must be signed in to change notification settings - Fork 22
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
Split files for PSR-4 compliance #45
Split files for PSR-4 compliance #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I agree that this is a step in the right direction, I'd like to suggest taking things a step (or two) further if @grogy agrees.
Suggestions:
- Implement Rename Jakub's namespace #26 (rename the namespace) at the same time.
- Use more subdirectories to place classes in logical groups.
For example (more groupings may be possible, but I haven't looked at everything):Output
for theOutput
interface and all classes extending it.Exception[s]
for allExceptions
Yes, that would be a BC-break and necessitate a major release, but that is needed anyhow when addressing #26, so we may as well try to set it up in a way which will make maintenance more intuitive for the future.
Yeah, when I was refactoring the code I noticed that my I dabbled about doing that too, but being a first-time contributor to this project, that seemed a bridge too far to cross on the first PR. |
@grogy Could you please pitch in to say whether you agree with the suggestions above ? Would be great if we could get this PR moving again to eventually get it merged. |
Okay, the codebase is split up into some folders, and I ran phpstan to make sure all links were correct. Unit tests still fail locally (something about |
I readed changes commit to commit and it makes sense. I see a problem that I missed that PR and codebase is far away. For resolve and merge I can rebase and solve it locally and force push it, or you can rebase it onto current master? |
I've rebased the commits, the only big change seemed to have been the GitLabOutput. A difference since the previous base is here |
I noticed the tests were failing on a missing polyfill, so I've added that back in. |
Please load that file via a |
@jrfnl I tried removing it, but that doesn't work in combination with PHP 5.3, so I re-added it as |
Using |
I've removed the commit for now, but as said, it won't work. The assumption made in the comment mentioned by @jrfnl is, in my opinion, out of scope.
If devtools use the existence on Wrapping the polyfill in a |
@jrfnl Did you manage to think about how we're resolving the polyfill issue? I think including it in |
I've taken the liberty to rebase this PR and add an extra commit changing the namespace prefix to Will have a look at the PHP 5.3 failure now. |
(sorry for the long wait, but 🤞🏻 we'll get this merged now soon) |
I've added an extra commit to sort out the test run on PHP 5.3. As the polyfilled class will no longer be loaded via the Composer autoload file (as it doesn't have the expected namespace), the file needs to be When the tests get refactored to PHPUnit, these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I hear you, but a) conflicts will only happen if someone would be using the same namespace and b) the |
Personally, it stings that the PR I made is now made so ugly with this new namespace change (which I think is really ugly, and a step backwards from no namespaces), but it's been nearly a year and I can't really care anymore. Good luck with this PR and the project, and thanks for looking into this after a year |
@roelofr I'm sorry you feel this way and I empathize with your frustration about how long the PR has been open. Has happened to me too often as well. The joys of open source.... |
... to be in line with the other repos in the organisation.
As the tests don't have a dedicated bootstrap file and loading of the `polyfill.php` file is no longer handled via the classmap, a `require` is needed in the test files.
Rebased without changes after the merge of #92 to get past the imaginary merge conflict. |
@roelofr thanks for the merge request. I know that long time to merge is frustrating. I am sorry to you. Today I call with @jrfnl and we discuss about namespaces. We concur that same namespace in whole organization is best way. I am remember that is break change. This change will be released in 2.x version. Merge request looks good and I does not have now some suggest, so I am merged it. Thanks to all in discussion, @roelofr for original MR and @jrfnl for rebase. |
There were many classes combined into single files, which isn't recommended and makes maintaining hard.
For example; Did you know that
\JakubOnderka\PhpParallelLint\ArrayIterator
was actually located insrc/Settings.php
. Not where you'd expect it to be.This PR moves all these classes to their own files, and configures Composer to use a PSR-4 autoloader instead of a classmap.
Closes #25
Closes #26