Skip to content

Commit

Permalink
Improved exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
smortensen committed May 17, 2018
1 parent 0f4b4e5 commit 7313070
Show file tree
Hide file tree
Showing 20 changed files with 628 additions and 517 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ vendor/
coverage/
.idea/
.source
composer.lock
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [5.0.0] - 2018-05-16
### Added
- The "Client::decode" method now throws an "ErrorException" when the input is not a valid JSON-RPC 2.0 reply string
- The "Client::query" and "Client::notify" methods now return the object handle, so you can chain method calls if you like

### Changed
- The "Client::decode" method now returns a list of "Response" objects (rather than an associative array of raw JSON-RPC 2.0 keys and values)
- The four exception classes have been moved (e.g. "Datto\JsonRpc\Exception\Application" => "Datto\JsonRpc\Exception**s**\**Application**Exception")
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $server = new Server($api);
$reply = $server->reply($message); // {"jsonrpc":"2.0","id":1,"result":3}
```

*See the "examples" folder for the full examples.*
*See the [examples](https://github.com/datto/php-json-rpc/tree/master/examples) folder for full working examples.*


## Requirements
Expand All @@ -65,11 +65,10 @@ This package is released under an open-source license: [LGPL-3.0](https://www.gn

## Installation

If you're using [Composer](https://getcomposer.org/), you can use this package
([datto/json-rpc](https://packagist.org/packages/datto/json-rpc))
by inserting a line into the "require" section of your "composer.json" file:
If you're using [Composer](https://getcomposer.org/), you can include this library
([datto/json-rpc](https://packagist.org/packages/datto/json-rpc)) like this:
```
"datto/json-rpc": "~4.0"
composer require "datto/json-rpc" "~5.0"
```


Expand All @@ -84,6 +83,12 @@ by inserting a line into the "require" section of your "composer.json" file:
2. Take a look at the code "examples/src"—then replace it with your own!


## Changelog

See what has changed:
[Changelog](https://github.com/datto/php-json-rpc/blob/master/CHANGELOG.md)


## Unit tests

You can run the suite of unit tests from the project directory like this:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Fully unit-tested JSON-RPC 2.0 for PHP",
"keywords": ["php", "json", "rpc", "jsonrpc", "json-rpc", "php-json-rpc"],
"homepage": "http://datto.com",
"license": "LGPL-3.0",
"license": "LGPL-3.0+",
"authors": [
{
"name": "Spencer Mortensen",
Expand Down
Loading

0 comments on commit 7313070

Please sign in to comment.