Skip to content

Commit 24894cc

Browse files
committed
docs(api): 📚 state the declaring contract for all methods
1 parent fce31ad commit 24894cc

1 file changed

Lines changed: 63 additions & 52 deletions

File tree

docs/10-api.md

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,65 @@
11
# API Reference
22

3-
| Method | Returns | IPv4 | IPv6 | Multi |
4-
|--------------------------------------------|----------------------|------|------|-------|
5-
| `factory(string $ip, [$strategy])` | Static `IpInterface` ||||
6-
| `getBinary()` | `string` ||||
7-
| `getOctets()` | `list<int>` ||||
8-
| `toString()` | `string` ||||
9-
| `jsonSerialize()` | `string` ||||
10-
| `toIntegerString()` | `string` ||||
11-
| `toHexString()` | `string` ||||
12-
| `equals(IpInterface $ip)` | `bool` ||||
13-
| `getVersion()` | `int` ||||
14-
| `isVersion(int $version)` | `bool` ||||
15-
| `isVersion4()` | `bool` ||||
16-
| `isVersion6()` | `bool` ||||
17-
| `getNetworkIp(int $cidr)` | Static `IpInterface` ||||
18-
| `getBroadcastIp(int $cidr)` | Static `IpInterface` ||||
19-
| `next()` | Static `IpInterface` ||||
20-
| `previous()` | Static `IpInterface` ||||
21-
| `offset(int $offset)` | Static `IpInterface` ||||
22-
| `inRange(IpInterface $ip, int $cidr)` | `bool` ||||
23-
| `getCommonCidr(IpInterface $ip)` | `int` ||||
24-
| `isMapped()` | `bool` ||||
25-
| `isDerived()` | `bool` ||||
26-
| `isCompatible()` | `bool` ||||
27-
| `isEmbedded()` | `bool` ||||
28-
| `isLinkLocal()` | `bool` ||||
29-
| `isLoopback()` | `bool` ||||
30-
| `isMulticast()` | `bool` ||||
31-
| `isPrivateUse()` | `bool` ||||
32-
| `isUnspecified()` | `bool` ||||
33-
| `isBenchmarking()` | `bool` ||||
34-
| `isDocumentation()` | `bool` ||||
35-
| `isGloballyReachable()` | `bool` ||||
36-
| `isBroadcast()` | `bool` || ||
37-
| `isShared()` | `bool` || ||
38-
| `isFutureReserved()` | `bool` || ||
39-
| `getDotAddress()` | `string` || ||
40-
| `toInteger()` | `int` || ||
41-
| `getCompactedAddress()` | `string` | |||
42-
| `getExpandedAddress()` | `string` | |||
43-
| `getCompactedAddress()` | `string` | |||
44-
| `getSegments()` | `list<int>` | |||
45-
| `getMulticastScope()` | `?int` | |||
46-
| `isUniqueLocal()` | `bool` | |||
47-
| `isUnicast()` | `bool` | |||
48-
| `isUnicastGlobal()` | `bool` | |||
49-
| `isEmbeddedAccordingToStrategy($strategy)` | `bool` | |||
50-
| `isNat64WellKnown()` | `bool` | |||
51-
| `isNat64LocalUse()` | `bool` | |||
52-
| `isTeredo()` | `bool` | |||
53-
| `getEmbeddedIp([$strategy])` | `IPv4` | |||
54-
| `getProtocolAppropriateAddress()` | `string` | | ||
3+
| Contract | Method | Returns | IPv4 | IPv6 | Multi |
4+
|------------------------------|---------------------------------------------------|--------------------------------|------|------|-------|
5+
| `IpInterface` | `factory(string $ip, [$strategy])` _(deprecated)_ | Static `IpInterface` ||||
6+
|| `isPublicUse()` _(deprecated)_ | `bool` ||||
7+
| `FactoryInterface` | `fromProtocol(string $ip, [$strategy])` | Static `IpInterface` ||||
8+
|| `tryFromProtocol(string $ip, [$strategy])` | Static `IpInterface` or `null` ||||
9+
|| `fromBinary(string $binary, [$strategy])` | Static `IpInterface` ||||
10+
|| `tryFromBinary(string $binary, [$strategy])` | Static `IpInterface` or `null` ||||
11+
|| `fromHex(string $hex, [$strategy])` | Static `IpInterface` ||||
12+
|| `tryFromHex(string $hex, [$strategy])` | Static `IpInterface` or `null` ||||
13+
|| `fromIntegerString(string $integer, [$strategy])` | Static `IpInterface` ||||
14+
|| `isValid(string $ip, [$strategy])` | `bool` ||||
15+
| `Factory4Interface` | `fromInteger(int $integer, [$strategy])` | Static `IpInterface` || ||
16+
| `OutputInterface` | `getBinary()` | `string` ||||
17+
|| `getOctets()` | `list<int>` ||||
18+
|| `toIntegerString()` | `string` ||||
19+
|| `toHexString()` | `string` ||||
20+
|| `toString()` | `string` ||||
21+
|| `__toString()` | `string` ||||
22+
| ↳ (`JsonSerializable`) | `jsonSerialize()` | `string` ||||
23+
| `Output4Interface` | `toDotAddress([$strategy])` | `string` || ||
24+
|| `toInteger()` | `int` || ||
25+
| `Output6Interface` | `toCompactedAddress([$strategy])` | `string` | |||
26+
|| `toExpandedAddress()` | `string` | |||
27+
|| `getSegments()` | `list<int>` | |||
28+
| `VersionIdentityInterface` | `getVersion()` | `int` ||||
29+
|| `isVersion(int $version)` | `bool` ||||
30+
|| `isVersion4()` | `bool` ||||
31+
|| `isVersion6()` | `bool` ||||
32+
| `ComparisonInterface` | `inRange(IpInterface $ip, int $cidr)` | `bool` ||||
33+
|| `getCommonCidr(IpInterface $ip)` | `int` ||||
34+
|| `equals(IpInterface $ip)` | `bool` ||||
35+
| `StrategyDetectionInterface` | `isEmbeddedAccordingToStrategy($strategy)` | `bool` | |||
36+
|| `getEmbeddedIp([$strategy])` | `IPv4` | |||
37+
|| `isMapped()` | `bool` | |||
38+
|| `isDerived()` | `bool` | |||
39+
|| `isCompatible()` | `bool` | |||
40+
|| `isNat64WellKnown()` | `bool` | |||
41+
|| `isNat64LocalUse()` | `bool` | |||
42+
|| `isTeredo()` | `bool` | |||
43+
| `ClassificationInterface` | `isLinkLocal()` | `bool` ||||
44+
|| `isLoopback()` | `bool` ||||
45+
|| `isMulticast()` | `bool` ||||
46+
|| `isPrivateUse()` | `bool` ||||
47+
|| `isUnspecified()` | `bool` ||||
48+
|| `isBenchmarking()` | `bool` ||||
49+
|| `isDocumentation()` | `bool` ||||
50+
|| `isGloballyReachable()` | `bool` ||||
51+
| `Classification4Interface` | `isBroadcast()` | `bool` || ||
52+
|| `isShared()` | `bool` || ||
53+
|| `isFutureReserved()` | `bool` || ||
54+
| `Classification6Interface` | `getMulticastScope()` | `?int` | |||
55+
|| `isUniqueLocal()` | `bool` | |||
56+
|| `isUnicast()` | `bool` | |||
57+
|| `isUnicastGlobal()` | `bool` | |||
58+
| `ArithmeticInterface` | `getNetworkIp(int $cidr)` | Static `IpInterface` ||||
59+
|| `getBroadcastIp(int $cidr)` | Static `IpInterface` ||||
60+
|| `next()` | Static `IpInterface` ||||
61+
|| `previous()` | Static `IpInterface` ||||
62+
|| `offset(int $offset)` | Static `IpInterface` ||||
63+
| `MultiVersionInterface` | `setDefaultEmbeddingStrategy($strategy)` | `void` | | ||
64+
|| `toProtocolAppropriateAddress([$strategy])` | `string` | | ||
65+
|| `isEmbedded()` | `bool` | | ||

0 commit comments

Comments
 (0)