Skip to content

Commit f41f153

Browse files
committed
README code examples updated.
1 parent 358bbfc commit f41f153

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ composer require remorhaz/php-json-patch
3030
Patch tool utilizes JSON data accessor interfaces defined in package
3131
**[remorhaz/php-json-data](https://github.com/remorhaz/php-json-data)**. Read more about them in package documentation.
3232
There is a ready-to-work implementation in that package that works with native PHP structures (like the ones you get as
33-
a result of `json_decode` function). You can use `RawSelectableReader` class to bind to patch data and
34-
`RawSelectableWriter` class to bind to the document that is to be patched. You can also implement your own accessors
33+
a result of `json_decode` function). You can use `Remorhaz\JSON\Data\Reference\Selector` class to bind to patch data and
34+
`Remorhaz\JSON\Data\Reference\Writer` class to bind to the document that is to be patched. You can also implement your own accessors
3535
if you need to work with another sort of data (like unparsed JSON text, for example).
3636

3737
## Using patch tool
@@ -46,19 +46,19 @@ To apply JSON Patch to the JSON document you need just 4 simple steps:
4646
```php
4747
<?php
4848

49-
use \Remorhaz\JSON\Data\RawSelectableReader;
50-
use \Remorhaz\JSON\Data\RawSelectableWriter;
49+
use \Remorhaz\JSON\Data\Reference\Selector;
50+
use \Remorhaz\JSON\Data\Reference\Writer;
5151
use \Remorhaz\JSON\Patch\Patch;
5252

5353
// Setting up document.
5454
$data = (object) ['a' => (object) ['b' => 'c', 'd' => 'e'];
55-
$dataWriter = new RawSelectableWriter($data);
55+
$dataWriter = new Writer($data);
5656

5757
// Setting up patch.
5858
$patchData = [
5959
(object) ['op' => 'add', 'path' => '/a/f', 'value' => 'g'],
6060
];
61-
$patchReader = new RawSelectableReader($patchData);
61+
$patchSelector = new Selector($patchData);
6262

6363
// Applying the patch.
64-
(new Patch($dataWriter))->apply($patchReader); // $data->a->f property is added and set to 'g'
64+
(new Patch($dataWriter))->apply($patchSelector); // $data->a->f property is added and set to 'g'

0 commit comments

Comments
 (0)