2) Modify annotations and parameter names according PSR
3) Changed logic in isJson method and in related methods.
method must obviously return false when json_decode getting error, because from the method name follows, that it check is valid input json string or not. If developer wants to know what error at his json string he just debug it (it not the task of current method).
in method we need obviously check the input data is not the array or object, because json_decode does not accept them as an argument
removed checking is_string($data) before call isJson method, because this is not necessary, since json_decode function perfectly handles other types of data (except array and object, which we check in the method inside)
1) Tests for methods of JsonQueryable trait:
2) Modify annotations and parameter names according PSR 3) Changed logic in
isJson
method and in related methods.false
when json_decode getting error, because from the method name follows, that it check is valid inputjson string
or not. If developer wants to know what error at hisjson string
he just debug it (it not the task of current method).json_decode
does not accept them as an argumentis_string($data)
before callisJson
method, because this is not necessary, sincejson_decode
function perfectly handles other types of data (except array and object, which we check in the method inside)