Closed outdooracorn closed 2 years ago
Merging #60 (f8fcc60) into master (b9da3c5) will increase coverage by
0.09%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #60 +/- ##
==========================================
+ Coverage 96.85% 96.95% +0.09%
==========================================
Files 14 15 +1
Lines 573 591 +18
==========================================
+ Hits 555 573 +18
Misses 18 18
Impacted Files | Coverage Δ | |
---|---|---|
src/InvalidFieldTypeException.php | 100.00% <100.00%> (ø) |
|
src/JsonPatch.php | 99.06% <100.00%> (+0.05%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Realised I didn't explain what this PR addresses! :see_no_evil:
We noticed the following edge cases:
"op"
field is boolean true
, it is interpreted as an "add"
operation instead of throwing an exception. This is due to true
always matching the first switch case (Add::OP
)."op"
field is an Array (list) or Object, it results in a "PHP Notice Array/Object to string conversion" in the UnknownOperationException
"path"
or "from"
fields are not a string, an exception will be thrown in JsonPatch::apply()
rather than JsonPatch::import()
The second commit, makes sure test code coverage doesn't decrease. I suggest we ignore the code climate issue. :)
Another late addition to our improvements on error handling (#53).
Fixes the following edge cases:
"op"
field is booleantrue
, it is interpreted as an"add"
operation instead of throwing an exception. This is due totrue
always matching the first [switch case] (Add::OP
)."op"
field is an Array (list) or Object, it results in a "PHP Notice Array/Object to string conversion" in the [UnknownOperationException
]"path"
or"from"
fields are not a string, an exception will be thrown inJsonPatch::apply()
rather thanJsonPatch::import()