Closed mpedrummer closed 8 years ago
What's the purpose of that?
I can't remember. Maybe pretty printing - maybe some edge case. Feel free to remove the line and send a PR.
(But i remember, that the last replace helps to handle empty arrays properly, see https://github.com/jakoch/PHPTracRPC/issues/2
The idea was to ditch replacing and use
$this->request = json_encode(array_pop($this->request), JSON_FORCE_OBJECT);
instead, but that didn't work either.)
Fair enough. My code is full of "I can't remember" too :)
I'll submit a pull request sometime today.
Inside
doRequest()
, the code does a json_encode, and then modifies the resulting string somewhat. What's the purpose of that?The second line of code, replacing the
':'
with': '
, modifies date values passed in, and results in an error from the Trac server.If this conversion is just for prettification (commenting it out hasn't broken anything, yet), perhaps looking for
'":'
, and replacing with'": '
would work just as well, without mangling the dates?