IpAddress::fromString improvements #9
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 14 minutes 5 seconds
Due date
c.fahner
14 minutes 5 seconds
No due date set.
Dependencies
No dependencies set.
Reference
slendium/http#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding while working on slendium/http-superglobals#1: the
SocketAddressinterface explicitly expects anIpv4Address|Ipv6AddresswhileIpAddress::fromString()returns only the genericIpAddresstype. This means type guards would have to be added every time this method interacts with aSocketAddress, adding unnecessary work. Additionally thefromStringmethods on bothIpv4Address,Ipv6AddressandIpAddressshould includeExceptionas part of their return types to enforce handling all possible cases.This issue changes
IpAddress::fromString()to returnIpv4Address|Ipv6Address|Exception. Likewise with the ipv4 and ipv6 variants of this method.SocketAddressis not an interface, but the method should be changed nonetheless.