From f3b8e6c96119b153aeb1783aac4116a07d275b76 Mon Sep 17 00:00:00 2001 From: Zan Baldwin Date: Tue, 2 Apr 2024 11:46:18 +0200 Subject: [PATCH] Update README/Docs --- README.md | 33 ++++++++++++++++++++------------- docs/08-doctrine.md | 6 ++++-- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5f4171f..981ec2d 100644 --- a/README.md +++ b/README.md @@ -10,30 +10,32 @@ accuracy or readability of the documentation - are always welcome. Full documentation is available in the [`docs/`](docs/) folder. -## Code of Conduct +## Compatibility -This project includes and adheres to the [Contributor Covenant as a Code of -Conduct](CODE_OF_CONDUCT.md). +This library has extensive test coverage using PHPUnit on PHP versions: `5.6`, +`7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`, and `8.3`. -## Upgrading +Static analysis is performed with PHPStan at `max` level on PHP `8.3`, using +both core and deprecation rules. -This library is fairly similar to how it was in `3.3.1`; the main differences -are: +The Doctrine features included in this library are compatible with Doctrine DBAL +`^2.3 || ^3.0`. This is **not** enforced via Composer (in case you want to use +this library in a project that uses Doctrine DBAL `4+` without using the +Doctrine features this library provides). -- There are three main classes instead of one: [`IPv4`](src/Version/IPv4.php), +## Brief Example + +- There are three main classes: [`IPv4`](src/Version/IPv4.php), [`IPv6`](src/Version/IPv6.php), and [`Multi`](src/Version/Multi.php) (for both version 4 and 6 addresses). - Objects are created using a static factory method [`IpInterface::factory()`](src/IpInterface.php) instead of the constructor to speed up internal processes. -- A few methods have been renamed (see [the API reference](docs/09-api.md)). -- Finally, the default for representing version 4 addresses internally has - changed [from IPv4-compatible to IPv4-mapped](docs/05-strategies.md). - -## Brief Example +- When using `Multi`, the default strategy for representing version 4 addresses + internally is [IPv4-mapped](docs/05-strategies.md). ```php -isPrivateUse()) { } ``` +## Code of Conduct + +This project includes and adheres to the [Contributor Covenant as a Code of +Conduct](CODE_OF_CONDUCT.md). + # License Please see the [separate license file](LICENSE.md) included in this repository diff --git a/docs/08-doctrine.md b/docs/08-doctrine.md index c50d0f2..b71b55f 100644 --- a/docs/08-doctrine.md +++ b/docs/08-doctrine.md @@ -1,6 +1,8 @@ # Doctrine Support -This library can be used to support IP address as column types with Doctrine. +This library can be used to support IP address as column types with Doctrine +DBAL versions `^2.3 || ^3.0`. + Three Doctrine types are provided to match the three version classes: - `Darsyn\IP\Doctrine\IPV4Type` supports the `IPv4` class. @@ -31,7 +33,7 @@ Now you can happily store IP addresses in your entities like nobody's business: use Darsyn\IP\Version\Multi as IP; use Doctrine\ORM\Mapping as ORM; - #[ORM\Entity] +#[ORM\Entity] class AnalyticsEntity { #[ORM\Column(type: 'ip')]