Skip to content

Commit

Permalink
Refined project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
georgique committed Jul 11, 2024
1 parent ff8ed4c commit 4790449
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 14 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ therefore giving you Yii2 power fully.

## Usage
Entry point:

```php
<?php

namespace app\controllers;
use \georgique\yii2\jsonrpc\Controller;
use georgique\yii2\jsonrpc\Controller;

class JsonRpcController extends Controller {

Expand All @@ -28,11 +29,12 @@ class JsonRpcController extends Controller {
```

Entry point with different way to pass params:

```php
<?php

namespace app\controllers;
use \georgique\yii2\jsonrpc\Controller;
use georgique\yii2\jsonrpc\Controller;

class JsonRpcBodyController extends Controller {

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"autoload": {
"psr-4": {
"georgique\\yii2\\jsonrpc\\": ""
"georgique\\yii2\\jsonrpc\\": "src/"
}
},
"repositories": [
Expand Down
2 changes: 1 addition & 1 deletion demo/controllers/BodyParamsJsonRpcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace app\controllers;

use \georgique\yii2\jsonrpc\Controller;
use georgique\yii2\jsonrpc\Controller;

class BodyParamsJsonRpcController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion demo/controllers/JsonRpcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace app\controllers;

use \georgique\yii2\jsonrpc\Controller;
use georgique\yii2\jsonrpc\Controller;

class JsonRpcController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion demo/controllers/ObjectParamsJsonRpcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace app\controllers;

use \georgique\yii2\jsonrpc\Controller;
use georgique\yii2\jsonrpc\Controller;

class ObjectParamsJsonRpcController extends Controller
{
Expand Down
1 change: 0 additions & 1 deletion demo/tests/api/JsonRpcCest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace api\tests;

use georgique\yii2\jsonrpc\exceptions\ParseErrorException;
use tests\Tester;
use yii\helpers\Json;

Expand Down
2 changes: 1 addition & 1 deletion Action.php → src/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace georgique\yii2\jsonrpc;

use georgique\yii2\jsonrpc\exceptions\JsonRpcException;
use georgique\yii2\jsonrpc\exceptions\InternalErrorException;
use georgique\yii2\jsonrpc\exceptions\InvalidRequestException;
use georgique\yii2\jsonrpc\exceptions\JsonRpcException;
use georgique\yii2\jsonrpc\exceptions\ParseErrorException;
use georgique\yii2\jsonrpc\responses\ErrorResponse;
use georgique\yii2\jsonrpc\responses\SuccessResponse;
Expand Down
1 change: 0 additions & 1 deletion Controller.php → src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use yii\filters\ContentNegotiator;
use yii\web\Response;
use Yii;

/**
* Class Controller
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions JsonRpcRequest.php → src/JsonRpcRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace georgique\yii2\jsonrpc;

use georgique\yii2\jsonrpc\exceptions\InvalidRequestException;
use georgique\yii2\jsonrpc\exceptions\JsonRpcException;
use georgique\yii2\jsonrpc\exceptions\InternalErrorException;
use georgique\yii2\jsonrpc\exceptions\InvalidParamsException;
use georgique\yii2\jsonrpc\exceptions\InvalidRequestException;
use georgique\yii2\jsonrpc\exceptions\JsonRpcException;
use georgique\yii2\jsonrpc\exceptions\MethodNotFoundException;
use yii\base\InlineAction;
use yii\base\InvalidRouteException;
Expand Down Expand Up @@ -138,8 +138,8 @@ public function bindParamsArray($route, array $params)

/**
* Executes JSON-RPC request by route.
* @throws \georgique\yii2\jsonrpc\exceptions\JsonRpcException
* @return mixed
* @throws \georgique\yii2\jsonrpc\exceptions\JsonRpcException
*/
public function execute()
{
Expand Down
1 change: 0 additions & 1 deletion JsonRpcSerializer.php → src/JsonRpcSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use georgique\yii2\jsonrpc\exceptions\InternalErrorException;
use georgique\yii2\jsonrpc\exceptions\JsonRpcException;
use georgique\yii2\jsonrpc\JsonRpcError;
use Yii;
use yii\base\Arrayable;
use yii\base\Component;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace georgique\yii2\jsonrpc\exceptions;

use Throwable;
use yii\base\Exception;

/**
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4790449

Please sign in to comment.