Skip to content

Commit

Permalink
Fix: Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jan 30, 2022
1 parent 7a8a247 commit 099fe7c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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`:
Expand Down

0 comments on commit 099fe7c

Please sign in to comment.