- Rename the whole-value output methods to
to*(conversions), keepingget*for component and property accessors. Keep theget*spellings as deprecated aliases;getBinary()is exempt as the accessor of the canonical state. - Detect embedding strategies via the new
Contracts\StrategyDetectionInterfacedeprecating the oldIpInterface::isEmbedded()and associated methods. - Convert IP addresses to and from integers:
fromInteger()/toInteger()via the newContracts\Factory4Interface(IPv4 and Multi only), plus arbitrary-precisionfromIntegerString()/toIntegerString()and fixed-widthtoHexString()on all classes. - Add arbitrary-precision base-256 <-> base-10 conversion to
Util\Binary:toDecimalString()andfromDecimalString()(GMP fast path when the extension is loaded, backed by pure-PHP fallback). - Extend
Contracts\OutputInterfacefrom\JsonSerializable. - Expand
Contracts\OutputInterface:getOctets(),getSegments(), and canonicaltoString()(deferable method for Stringable equivalent). - Add address arithmetic methods
next(),previous()andoffset(int $offset)toContracts\ArithmeticInterface. Over/underflowing the address space throwsException\OverflowException. - Split embedding strategies into canonical and non-canonical packers via the
new
Strategy\CanonicalEmbeddingInterfacebridge. - Add strict parsing methods to the new
Contracts\FactoryInterfaceinterface: try/from protocol, binary, hex. - Deprecate
factory()in favour of the strict named constructorsfromProtocol()/fromBinary(). - Introduce
@experimentalcapability interfaces underDarsyn\IP\Contracts\. Their shape may change before7.0, but remains backwards compatible for6.x - Allow overriding the global formatter per call via an optional
Formatter\ProtocolFormatterInterfaceparameter ontoDotAddress(),toCompactedAddress()andtoProtocolAppropriateAddress()(deprecatedget*aliases accept the same argument, but any other value triggers a deprecation notice and falls back to the global formatter instead of throwing aTypeError). - Move CIDR mask generation from the protected
AbstractIP::generateBinaryMask()to the public staticUtil\Binary::mask(). - Performance: compute network masks (
getNetworkIp()/getBroadcastIp()) and the greatest common CIDR (getCommonCidr()) directly on raw bytes. - Add arithmetic primitives to
Util\Binary:increment(),decrement()andaddIntegerOffset(). Over/underflowing throws new exception. - Widen the
$previousconstructor argument on all exception classes from?\Exceptionto?\Throwable. - Add support for PHP
8.5in README, and GitHub Action CI workflows. - Access protected method via Closure in unit tests, instead of reflection, to
fix deprecation warnings in PHP
8.5. - Define all data-provider arguments as test method arguments, to fix
deprecation warnings in PHPUnit (cherry-picked from
5.0.2). - Drop all PHP versions except floor (
7.4) and latest (8.5) for running static analysis. - Type-narrow out-of-range CIDRs to remove unnecessary
@phpstan-ignoreinstructions. - Bugfix: don't compress single 16-bit zero group (according to RFC 5952 §
4.2.2). - Bugfix: stop
MbString::subString()from swallowing valid0. - Add Bash script for testing GitHub Action workflows locally using Docker.
- Add code style ruleset definition via PHP-CS-Fixer configuration. Apply the code style to the entire codebase, and enable checking as another CI job in GitHub Actions.
- Bugfix: classify full
fc00::/7block as private use. - Add (or update) community standards:
SECURITY.md,CODE_OF_CONDUCT.mdandCONTRIBUTING.md - Bugfix: detect embedded IPv4 across the entire 6to4 block (
2002::/16, RFC 3056 § 2), not just canonical 6to4 addresses with a zeroed 80-bit tail. - Bugfix: align
isPublicUse(),isUnicastGlobal()andisDocumentation()with the IANA special-purpose address registries, and update RFC references/citations for all address classification methods. - Rename
isPublicUse()toisGloballyReachable(), conforming to the official wording used in the IANA special-purpose address registries ("Public Use" does not appear in them). KeepisPublicUse()as a deprecated alias. - Add NAT64 (RFC 6052 § 2.2) embedding strategy, with named constructors for
the Well-known Prefix (
64:ff9b::/96), operator Network-specific Prefixes, and the RFC 8215 Local-use prefix (64:ff9b:1::/48). - Add
Teredoembedding strategy for2001::/32(according to RFC 4380 § 4). - Add
Compositeembedding strategy that recognises and extracts version 4 addresses across several underlying strategies, while packing through a single canonical strategy. - Bugfix: classify a NAT64 Well-known Prefix (
64:ff9b::/96, RFC 6052 § 2.1) address by the version 4 address it embeds rather than trusting the prefix, so an embedded non-globally-reachable address is no longer reported as globally reachable (closes a potential SSRF deny-list bypass).
- Rename default branch name from
develop/masterto6.x; branch5.xfrom5.0.0tag for ongoing support (bugfixes only). Update GitHub Actions CI workflows, and update README with description on the6.x/5.xsplit. - Drop support for PHP versions less than
7.1. - Fix PHP
8.4deprecation errors (nullable arguments must be explicit). - Add strict types.
- Add native type support. Remove unnecessary type annotations in doc blocks. Remove unit tests that assert invalid types no longer allowed by PHP's strict typing.
5.0.1added PHP8.4support, but this is deprecated due to true support (without supresing deprecation warnings) being unavailable without lifting the minimum PHP version (5.6).PHP
8.4is now only supported (officially) on6.x.
- Officially deprecate PHP
8.4support for the5.xbranch. Highest PHP version supported for5.xis8.3, upgrade to6.xfor higher PHP versions. - Update version requirements in README,
composer.jsonand GitHub Action CI workflows. - Define all data-provider arguments as test method arguments, to fix deprecation warnings in PHPUnit.
- Remove
@phpstan-ignoreinstruction for non-issue in unit tests.
- Add support for PHP
8.4. - Reference comment added for generating documentation on Podman.
- Removed Doctrine functionality, and split it off into its own package:
darsyn/ip-doctrine. List it as a Composer dependency suggestion. - Change from Psalm to PHPStan for
static analysis.
- Add types to all function arguments lists and return values.
- Update the codebase to pass static analysis on
maxlevel (standard, deprecation, and bleeding edge rules).
- Test against PHP versions
8.2and8.3in CI pipeline. - Update README with notes on version compatibility.
- Explicitly state the requirement of the
ctypePHP extension. - Add PHPUnit attributes alongside annotations to be compatible with the highest version of PHPUnit for any supported PHP version.
- Added
IpInterface::equals()method for comparing two IP addresses. - Added
getCommonCidr(IpInterface $ip): intfor determining how in range two IP addresses are according to their common CIDR value. - Added
isBenchmarking(),isDocumentation(), andisPublicUse()type methods for both IPv4 and IPv6 addresses. - Added
isBroadcast(),isShared(), andisFutureReserved()type methods for IPv4 addresses. - Added
getMulticastScope(),isUniqueLocal(),isUnicast(), andisUnicastGlobal()type methods for IPv6 addresses. - Added
Ipv6::fromEmbedded()factory method to create an instance of an IPv4-embedded address as IPv6 instead of Multi. - Made internal helper methods for dealing with binary data into utility
classes:
Darsyn\IP\Util\BinaryandDarsyn\IP\Util\MbString. - Complete documentation overhaul
- Increase test coverage.
- Started using static analysis both locally and via GitHub actions.
- Documentation and tests are excluded from the Git archive to reduce download size when installing Composer dependency as dist.
- Updated Code of Conduct to Contributor Covenant v2.1
- Add return types to DocComments to prevent
symfony/error-handlerfrom throwing deprecation errors
- Add Code of Conduct to project.
- Add new internal helper for dealing with binary strings.
- Add namespace indicator to function calls to speed up symbol resolution.
- Add
__toString()to IP objects. - Update unit tests, now runnable on all PHP versions 5.6 to 8.1
- Complete rewrite of library.