-
Notifications
You must be signed in to change notification settings - Fork 460
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 RegexGroupParser for more immutability and less pass-by-ref #3508
Conversation
e283d69
to
aa6a193
Compare
This pull request has been marked as ready for review. |
//cc @mvorisek lets wait until a few of the open Regex-inference PRs are merged so we don't step on each others toes |
{ | ||
return new self( | ||
-1, | ||
100, |
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 know you moved the code only, but why 100?
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.
in the initial implementation there we so many arrays involved, that I used a different start-index to trigger php warnings in case I mixed up the keys between different arrays ;)
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.
please add a comment into the code
); | ||
} | ||
|
||
public function nextAlternationId(): self |
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.
name it better, it does not return int
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.
it returns a "copy" of the current object, which contains the next alternation id.
I think the name fits.
Thank you. |
less magic, less error prone
Part 2