You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.composer/cache/phpstan.phar || wget https://github.com/phpstan/phpstan/releases/download/0.9.1/phpstan.phar -O $HOME/.composer/cache/phpstan.phar; fi
23
+
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.composer/cache/phpstan.phar || wget https://github.com/phpstan/phpstan/releases/download/0.9.2/phpstan.phar -O $HOME/.composer/cache/phpstan.phar; fi
24
24
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.composer/cache/ocular.phar || wget https://scrutinizer-ci.com/ocular.phar -O $HOME/.composer/cache/ocular.phar; fi
25
25
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.composer/cache/cctr || wget https://codeclimate.com/downloads/test-reporter/test-reporter-0.1.4-linux-amd64 -O $HOME/.composer/cache/cctr && chmod +x $HOME/.composer/cache/cctr; fi
26
26
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then $HOME/.composer/cache/cctr before-build; fi
Copy file name to clipboardExpand all lines: README.md
+18
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ A PHP implementation for finding unordered diff between two `JSON` documents.
13
13
* To detect breaking changes by analyzing removals and changes from original `JSON`.
14
14
* To keep original order of object sets (for example `swagger.json`[parameters](https://swagger.io/docs/specification/describing-parameters/) list).
15
15
* To make and apply JSON Patches, specified in [RFC 6902](http://tools.ietf.org/html/rfc6902) from the IETF.
16
+
* To make and apply JSON Merge Patches, specified in [RFC 7386](https://tools.ietf.org/html/rfc7386) from the IETF.
16
17
* To retrieve and modify data by [JSON Pointer](http://tools.ietf.org/html/rfc6901).
17
18
* To recursively replace by JSON value.
18
19
@@ -55,11 +56,23 @@ $r = new JsonDiff(
55
56
);
56
57
```
57
58
59
+
Available options:
60
+
*`REARRANGE_ARRAYS` is an option to enable arrays rearrangement to minimize the difference.
61
+
*`STOP_ON_DIFF` is an option to improve performance by stopping comparison when a difference is found.
62
+
*`JSON_URI_FRAGMENT_ID` is an option to use URI Fragment Identifier Representation (example: "#/c%25d"). If not set default JSON String Representation (example: "/c%d").
63
+
*`SKIP_JSON_PATCH` is an option to improve performance by not building JsonPatch for this diff.
64
+
*`SKIP_JSON_MERGE_PATCH` is an option to improve performance by not building JSON Merge Patch value for this diff.
65
+
66
+
Options can be combined, e.g. `JsonDiff::REARRANGE_ARRAYS + JsonDiff::STOP_ON_DIFF`.
67
+
58
68
On created object you have several handy methods.
59
69
60
70
#### `getPatch`
61
71
Returns [`JsonPatch`](#jsonpatch) of difference
62
72
73
+
#### `getMergePatch`
74
+
Returns [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) value of difference
75
+
63
76
#### `getRearranged`
64
77
Returns new value, rearranged with original order.
65
78
@@ -137,6 +150,11 @@ Gets value from data at path specified `JSON Pointer` string.
137
150
#### `remove`
138
151
Removes value from data at path specified by segments.
0 commit comments