Skip to content

Refactoring IpHelper - #33

Closed
nibra wants to merge 17 commits into
joomla-framework:4.x-devfrom
nibra:refactoring/ip-helper
Closed

Refactoring IpHelper#33
nibra wants to merge 17 commits into
joomla-framework:4.x-devfrom
nibra:refactoring/ip-helper

Conversation

@nibra

@nibra nibra commented Apr 1, 2021

Copy link
Copy Markdown
Contributor

Pull Request for Issue #32

Summary of Changes

  • Add tests verifying the bug. These tests reveal several other issues, see Drone report.

ATTN: This PR builds on PR #31

Testing Instructions

Run the tests (or just check Drone report).

Documentation Changes Required

No

@nibra nibra changed the title Refactoring/ip helper Refactoring IpHelper Apr 1, 2021
@nibra
nibra marked this pull request as draft April 1, 2021 12:24
@nibra nibra linked an issue Apr 1, 2021 that may be closed by this pull request
@nibra
nibra marked this pull request as ready for review April 1, 2021 21:52
@nibra nibra self-assigned this Apr 2, 2021
@nibra
nibra requested a review from a team April 2, 2021 01:16
@Llewellynvdm

Copy link
Copy Markdown

I have been reading over the changes here and it all looks brilliant. Did not yet pull and test them manually.

I have one question you are making changes to a number of public functions very dramatically... what back-porting, or warning of change, do we have for those who have used those. As they are public, and therefore it does have a measure of promise, right?

Comment thread src/IpHelper.php
Comment thread src/IpHelper.php
@Llewellynvdm

Llewellynvdm commented Apr 2, 2021

Copy link
Copy Markdown

There are more... but I think you get my question. Not that I don't agree the changes are valid. Just indeed going to break stuff. Besides the fact that the whole class has mutated...

@nibra

nibra commented Apr 2, 2021

Copy link
Copy Markdown
Contributor Author

Those name changes do no harm, as method names are not case sensitive. The readability, though, is better with uppercase IP.

Comment thread src/IpHelper.php Outdated
@nibra

nibra commented Apr 2, 2021

Copy link
Copy Markdown
Contributor Author

The refactoring (and the added tests) changed the CRAP index from 8190 down to 53... Some parts of the original code were never able to run; it was trying to treat a netmask as an integer for IPv6 ranges...

@Llewellynvdm

Copy link
Copy Markdown

Yea, I get that... just trying to catch the guys like me who may have started using these methods directly...

@nibra

nibra commented Apr 2, 2021

Copy link
Copy Markdown
Contributor Author

API was restricted to the public methods; the class originally was final, so protected members were not accessible from outside.

Comment thread src/IpHelper.php Outdated
nibra added a commit that referenced this pull request Aug 14, 2022
@rdeutz

rdeutz commented Jul 6, 2025

Copy link
Copy Markdown
Contributor

@nibra do you want to update the PR to 3.x or 4.x? If not we are going to close it.

@Hackwar
Hackwar changed the base branch from 1.x-dev to 4.x-dev July 9, 2025 12:41
@nibra nibra closed this by deleting the head repository Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IpHelper does not detect invalid IP addresses

5 participants