-
Notifications
You must be signed in to change notification settings - Fork 20
Rename isPublicUse() to isGloballyReachable()
#107
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
base: 6.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -415,14 +415,14 @@ public function testIsDocumentation(string $value, bool $isDocumentation): void | |
|
|
||
| /** | ||
| * @test | ||
| * @dataProvider \Darsyn\IP\Tests\DataProvider\IPv4::getPublicUseIpAddresses() | ||
| * @dataProvider \Darsyn\IP\Tests\DataProvider\IPv4::getGloballyReachableIpAddresses() | ||
| */ | ||
| #[PHPUnit\Test] | ||
| #[PHPUnit\DataProviderExternal(IPv4DataProvider::class, 'getPublicUseIpAddresses')] | ||
| public function testIsPublicUse(string $value, bool $isPublicUse): void | ||
| #[PHPUnit\DataProviderExternal(IPv4DataProvider::class, 'getGloballyReachableIpAddresses')] | ||
| public function testIsGloballyReachable(string $value, bool $isGloballyReachable): void | ||
| { | ||
| $ip = IP::factory($value); | ||
| $this->assertSame($isPublicUse, $ip->isPublicUse()); | ||
| $this->assertSame($isGloballyReachable, $ip->isGloballyReachable()); | ||
| } | ||
|
|
||
| /** | ||
|
Comment on lines
415
to
428
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
All three test classes ( |
||
|
|
||
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.
@deprecatedon concrete implementationsThe
@deprecatedannotation exists onIpInterface::isPublicUse()but is absent from the concrete implementations inIPv4,IPv6, andMulti. IDEs and static analysers (PHPStan, Psalm) resolve deprecation warnings from the declared type at the call site. When user code holds a variable typed as the concrete class rather thanIpInterface, the tooling will silently acceptisPublicUse()calls without any deprecation notice, defeating the purpose of the annotation.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!