From 099fe7c6425dfdc17c9aac61e57cab4158416934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 30 Jan 2022 11:08:41 +0100 Subject: [PATCH] Fix: Add examples --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0c554d58..58add960 100644 --- a/README.md +++ b/README.md @@ -98,10 +98,12 @@ declare(strict_types=1); use Ergebnis\Json\Pointer; -$two = Pointer\ReferenceToken::fromJsonString('foo~1bar'); $one = Pointer\ReferenceToken::fromString('foo/bar'); +$two = Pointer\ReferenceToken::fromJsonString('foo~1bar'); +$three = Pointer\ReferenceToken::fromString('foo/9000'); -$one->equals($two); // true +$one->equals($two); // true +$one->equals($three); // false ``` ### `JsonPointer` @@ -183,8 +185,10 @@ use Ergebnis\Json\Pointer; $one = Pointer\JsonPointer::fromJsonString('/foo/bar'); $two = Pointer\JsonPointer::fromJsonString('/foo~1bar'); +$three = Pointer\JsonPointer::fromUriFragmentIdentifierString('#/foo/bar'); -$one->equals($two); // false +$one->equals($two); // false +$one->equals($three); // true ``` You can append a `ReferenceToken` to a `JsonPointer`: