Contracts: extract experimental capability interfaces#120
Conversation
Introduce composable capability interfaces under `Darsyn\IP\Contracts\`. Tagged `@experimental` ahead of the 7.0 interface decomposition.
Greptile SummaryThis PR extracts capability-specific interfaces from the monolithic
Confidence Score: 4/5Safe to merge for 6.x — all changes are purely additive interface extractions with no behavioural modifications and backward-compatible constant access. The refactoring is structurally sound and introduces no breaking changes for 6.x consumers. The one concern worth tracking before 7.0 stabilises is that src/Contracts/ComparisonInterface.php — the Important Files Changed
Class Diagram%%{init: {'theme': 'neutral'}}%%
classDiagram
class OutputInterface {
+getBinary() string
+__toString() string
}
class Output4Interface {
+getDotAddress() string
}
class Output6Interface {
+getCompactedAddress() string
+getExpandedAddress() string
}
class VersionIdentityInterface {
+getVersion() int
+isVersion(int) bool
+isVersion4() bool
+isVersion6() bool
}
class ArithmeticInterface {
+getNetworkIp(int) static
+getBroadcastIp(int) static
}
class ComparisonInterface {
+equals(IpInterface) bool
+inRange(IpInterface, int) bool
+getCommonCidr(IpInterface) int
}
class ClassificationInterface {
+isLinkLocal() bool
+isLoopback() bool
+isMulticast() bool
+isPrivateUse() bool
+isUnspecified() bool
+isBenchmarking() bool
+isDocumentation() bool
+isGloballyReachable() bool
}
class Classification4Interface {
+isBroadcast() bool
+isShared() bool
+isFutureReserved() bool
}
class Classification6Interface {
+MULTICAST_* constants
+getMulticastScope() ?int
+isUniqueLocal() bool
+isUnicast() bool
+isUnicastGlobal() bool
}
class IpInterface {
+factory(string) static
+isMapped() bool
+isDerived() bool
+isCompatible() bool
+isEmbedded() bool
+isPublicUse() bool
}
class Version4Interface
class Version6Interface
Output4Interface --|> OutputInterface
Output6Interface --|> OutputInterface
Classification4Interface --|> ClassificationInterface
Classification6Interface --|> ClassificationInterface
IpInterface --|> ArithmeticInterface
IpInterface --|> ClassificationInterface
IpInterface --|> ComparisonInterface
IpInterface --|> OutputInterface
IpInterface --|> VersionIdentityInterface
Version4Interface --|> IpInterface
Version4Interface --|> Classification4Interface
Version4Interface --|> Output4Interface
Version6Interface --|> IpInterface
Version6Interface --|> Classification6Interface
Version6Interface --|> Output6Interface
Reviews (1): Last reviewed commit: "feature(contracts): ✨ extract experiment..." | Re-trigger Greptile |
Darsyn\IP\Contracts\.@experimentalahead of the 7.0 interface decomposition.