FakerPHP / Faker

Faker is a PHP library that generates fake data for you
https://fakerphp.github.io
Other
3.47k stars 331 forks source link

Add safeIpv4 and safeIpv6 #831

Open ttrig opened 6 months ago

ttrig commented 6 months ago

What is the reason for this PR?

Add the posibility to generate "safe" documentation IP addresses:

Author's checklist

Summary of changes

Added two new methods:

Review checklist

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

brother commented 3 months ago

I think the issue is valid as proposed.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

brother commented 2 months ago

Still a neat feature suggestion. Having real IPs in test data is not a great pattern really.

pimjansen commented 2 months ago

Still a neat feature suggestion. Having real IPs in test data is not a great pattern really.

Define "real" ip addresses. For each usecase there is something to be said. If you want it strict you would need to manually provide the cidr ranges which means it gets too complex as well. And it that case its more like a 1.1.1.1 till 255.255.255.255 as well

brother commented 2 months ago

Still a neat feature suggestion. Having real IPs in test data is not a great pattern really.

Define "real" ip addresses. For each usecase there is something to be said. If you want it strict you would need to manually provide the cidr ranges which means it gets too complex as well. And it that case its more like a 1.1.1.1 till 255.255.255.255 as well

Real in contrast to them provided in this helper which are defined as for documentation purposes. For the rare cases wherw you actually need a routable IP the current IP helpers are available still and would work fine.

And I understand the problem changing the default into the documentation IPs and so on, that hasn't been proposed (yet).