-
Notifications
You must be signed in to change notification settings - Fork 26
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
Merge IP constructors into base class #21
Conversation
Rather than go through a rebase - it was simpler to copy paste the code over into a new branch. |
@rlanvin - What are your thoughts on the PRs? |
src/IP.php
Outdated
/** | ||
* @param int $ip | ||
*/ | ||
private function fromInt($ip) |
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.
For the from* methods, it would be nice to have type hinting. As discussed in #8 it makes sense to only support PHP >= 7.
I also think these from* should be static and return $ip.
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.
When you say "should return $ip
", do you mean return the \GMP
instance or an instance of PhpIP\IP
?
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 mean the GMP instance, so in the constructor it would look like "$this->ip = self::fromInt($ip)".
@samuelwilliams My apologies. I got carried away by other projects and completely forgot about the open PRs here. Thanks for reminding me. |
Do you want this PR to change the minimum PHP requirements in |
@samuelwilliams No please make a separate independent PR for this. And it should not have any dependencies or include any other commits from another other currently open PRs. |
No description provided.